﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Changing setting for first day of the week / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 05:36:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>[quote][b]Lowell (10/22/2012)[/b][hr][quote][b]matt.gyton (10/22/2012)[/b][hr]Hi Lowell,These are just standard SQL Agent Jobs being run on a schedule, so I'm assuming I could just change the default language setting for the login they are being run under (currently the SQL Agent Service account)?Would changing the default language for 'NT SERVICE\SQLSERVERAGENT' do this?Thanks[/quote]i think so yes, but you'd have to test it. it would be better to change whatever script you are using to not be sensuitive to datefirst instead; can you explain what is not running or occuring correctly because of that setting?[/quote]Basically each Job runs a windows CmdExec command, which kicks off a Netbackup procedure. There are 4 jobs, Weekly1, Weekly2, Weekly3 and Monthly.  Each weekend, one of these jobs must be run consecutively on the Friday, Saturday and Sunday as follows:Week 1: Weekly1 runs Friday, Saturday and Sunday.Week 2: Weekly2 runs Friday, Saturday and Sunday.Week 3: Weekly3 runs Friday, Saturday and Sunday.Week 4: Monthly runs Friday, Saturday and Sunday.The problem is that because SQL considers Sunday the first day of the week, the Friday and Saturday are considered to be part of one week, but the Sunday is part of the next week, so instead of running on consecutive days they run as follows:Week 1: Weekly1 runs Sunday......Friday, Saturday.Week 2: Weekly2 runs Sunday......Friday, Saturday.Week 3: Weekly3 runs Sunday......Friday, Saturday.Week 4: Monthly runs Sunday......Friday, Saturday.Hope that makes sense!!</description><pubDate>Mon, 22 Oct 2012 07:27:53 GMT</pubDate><dc:creator>matt.gyton</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>[quote][b]matt.gyton (10/22/2012)[/b][hr]Hi Lowell,These are just standard SQL Agent Jobs being run on a schedule, so I'm assuming I could just change the default language setting for the login they are being run under (currently the SQL Agent Service account)?Would changing the default language for 'NT SERVICE\SQLSERVERAGENT' do this?Thanks[/quote]i think so yes, but you'd have to test it. it would be better to change whatever script you are using to not be sensuitive to datefirst instead; can you explain what is not running or occuring correctly because of that setting?</description><pubDate>Mon, 22 Oct 2012 07:09:19 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>Hi Lowell,These are just standard SQL Agent Jobs being run on a schedule, so I'm assuming I could just change the default language setting for the login they are being run under (currently the SQL Agent Service account)?Would changing the default language for 'NT SERVICE\SQLSERVERAGENT' do this?Thanks</description><pubDate>Mon, 22 Oct 2012 06:57:52 GMT</pubDate><dc:creator>matt.gyton</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>those set options are  connection specific; they are not server wide.just because you set it someplace, does not mean it's going to affect jobs or anything else on the server.each job would need to be edited to have new set options.if you are connecting with , say .NET, you need to set the options there.SSMS has a place where you can change most of those settings via the GUI , and every ODBC driver has the ability to set them as well.Note that even if you could set these items server wide, they would be over-riden by the connections settings themselves.[img]http://www.stormrage.com/SQLStuff/ssms_conn_settings.png[/img]</description><pubDate>Mon, 22 Oct 2012 06:10:24 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>Thanks Dugi - that looks good!Currently the jobs just run under the domain account that runs the SQL Agent Services, although this account is not listed under the Logins in SSMS.  There is a login called 'NT SERVICE\SQLSERVERAGENT' though - is this what needs changing?  Or do I need to add the domain service account to the logins and set the language for that?</description><pubDate>Mon, 22 Oct 2012 06:07:44 GMT</pubDate><dc:creator>matt.gyton</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>Also I don't know which language you are using, however you can change the language for the user like:Check the language that has the first date Monday... more correct check the value of the DateFirs col, that is third col in your results. is it 1!SELECT * FROM sys.syslanguagesThen, now try to change the language of the user that you've created to run schedule jobs, like this:USE [master]GOALTER LOGIN [user] WITH DEFAULT_LANGUAGE = "Your language that you have choose to be from syslanguages"GOSample:USE [master]GOALTER LOGIN [YourUserName] WITH DEFAULT_LANGUAGE = [Deutsch]GO</description><pubDate>Mon, 22 Oct 2012 05:44:59 GMT</pubDate><dc:creator>Dugi</dc:creator></item><item><title>RE: Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>Did you try: SET DATEFIRST 1;GOCheck the first date with SELECT @@DATEFIRST</description><pubDate>Mon, 22 Oct 2012 05:36:22 GMT</pubDate><dc:creator>Dugi</dc:creator></item><item><title>Changing setting for first day of the week</title><link>http://www.sqlservercentral.com/Forums/Topic1375345-391-1.aspx</link><description>Hi there,I am having some trouble with some SQL Job schedules because I believe SQL is using Sunday as the first day of the week by default.  I have separate jobs for each weekend which must run Friday, Saturday, Sunday consecutively.  Unfortunately, as SQL considers Sunday the first day of the week, they are running first on the Sunday and then the following Friday and Saturday. Is there a way to change the setting for the first day of the week?So, effectively I would be looking to go from this:1 - Sunday2 - Monday3 - Tuesday4 - Wednesday5 - Thursday6 - Friday7 - Saturday...to this...1 - Monday2 - Tuesday3 - Wednesday4 - Thursday5 - Friday6 - Saturday7 - SundayAny ideas? I'm also not sure if changing this could affect anything else other than for SQL Jobs?Thanks</description><pubDate>Mon, 22 Oct 2012 05:16:22 GMT</pubDate><dc:creator>matt.gyton</dc:creator></item></channel></rss>