Come si scrive un'istruzione IF con più argomenti in T-SQL?Istruzione argomento IF multiplo - T-SQL
attuale errore Origine:
DECLARE @StartDate AS DATETIME
DECLARE @EndDate AS DATETIME
SET @StartDate = NULL
SET @EndDate = NULL
IF (@StartDate IS NOT NULL AND @EndDate IS NOT NULL)
BEGIN
-- do some work
END
Si getta il seguente errore:
Incorrect syntax near the keyword 'AND'. Incorrect syntax near the keyword 'AND'. Incorrect syntax near ')'.
Funziona sulla mia macchina? Sto pensando che l'errore potrebbe essere tra il tuo 'BEGIN' e' END'. Oppure, se non hai nulla tra 'BEGIN' e' END', questo sarebbe il problema. – Aaronaught
Grazie per l'input. Era la sezione '--do some work' che stava causando il problema. Sto costruendo una dichiarazione SQL dinamica ... ugh! –