Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 getdate() little problem...

Author  Topic 

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2007-01-10 : 06:17:54
Hi I am running SP's and wanted to display the time after it has been executed.

Please help me incorporate the getdate() function.

i.e.

Print 'SP_Successfully_executed: ' + getdate()

intended result:
SP_Successfully_executed: Jan 10 2007 11:18AM

I know the above does not work, but let me please let me know of any solutions!

Thanks!

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-10 : 06:21:43
You need to use CONVERT function:

Print 'SP_Successfully_executed: ' + Convert(varchar(20),getdate())



Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-10 : 06:21:44
Print 'SP_Successfully_executed: ' + cast(getdate() as varchar)


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

dnf999
Constraint Violating Yak Guru

253 Posts

Posted - 2007-01-10 : 06:27:03
Thanks!
Go to Top of Page
   

- Advertisement -