I am running a query using the MS Query Analyzer. I am inserting a large number of fields into a table, one of the fields is a date field where I enter the date (Hard Coded) that the query is run. I was wondering if it was possible to have the script get the date while it is running via the Date() function. I have tried the following:
Declare @DateVar SmallDateTime
Set @DateVar = Date()
I am getting an error on the second line, so I guess the Date() function is not native to SQL. So is there another way of accomplishing this?