简体   繁体   中英

ms sql call stored procedure with date time parameter

how do one call a stored procedure that has date input .

spName getDate()

does not work.

the question is about calling within ms sql managment studio.

SQL Server 2008

declare @d date = getdate() /*Or datetime looking at the title*/
exec spName @d

Earlier Versions

declare @d datetime
set @d = getdate()
exec spName @d

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM