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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

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

Flowing Fount of Yak Knowledge

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
Go to Top of Page

In (Som, Ni, Yak)

17689 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


Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000