User GETDATE() to put current date into SQL variable

Viewed 124731

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.

5 Answers
Related