SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Day of the week
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cullyK
Starting Member

5 Posts

Posted - 02/07/2007 :  04:04:28  Show Profile  Reply with Quote
I have a stored procedure that i don't want to run on a friday or a saturday, so i need to find out what day of the week it is.

I guess i start out by getting todays date but is there then a function to get the day of the week from the date

Thanks in advance

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 02/07/2007 :  04:06:00  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
select datename(weekday, getdate())


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

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 02/07/2007 :  07:48:19  Show Profile  Reply with Quote
if you are scheduling your stored procedure with SQL Agent you can control which day to run


KH

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000