I’m trying to get the current date into a variable inside a SQL stored procedure using the following commands
DECLARE @LastChangeDate as date
SET @LastChangeDate = SELECT GETDATE()
This gives me the following error: “Incorrect Syntax near ‘SELECT'”
This is the first stored procedure I’ve ever written, so I’m unfamiliar with how variables work inside SQL.
You don’t need the
SELECT