September 13, 2013 at 8:02 am
This was removed by the editor as SPAM
September 13, 2013 at 8:24 am
Almost a nice question, but actually not correct. The assumption that the server default language is us_english isn't adequate; you have to assume that the default language for the login used to connect SSMS to the server is us_english, because the new query will use a new session, which will use the login's default language, not the language that has been set for the first query's session, and the login's default can be different from the server default. The set statement commented "just to make sure" in the first query merely makes sure that the session containing that query will use us_english, not that the other session will.
In SQL 2012 there's another complication - if it's a contained database, the second call will use the databases default language if the login hasn't set a different default language, and the databases default language may be different from the server default. Was that what the instruction to connect to the same database for the second query as for the first was about? If it's not a contained database, the database is irrelevant; and even if it is, the assumption you need is that the login's default language is us-english. so the database would be irrelevant if the right assumption had been stated instead of an inadequate one.
Tom
September 13, 2013 at 8:35 am
rodjkidd (9/13/2013)
Silly me, didn't have coffee yet and missed the second part!Yes per session!! So new session will be 7
Rodders...
Maybe. If your login's default language is British it will be 1, and I guess it may be that as your server is in Britain. And so on. The question says assume the server default is us-english, but it should say assume the login default is us-english.
Tom
September 13, 2013 at 10:57 am
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
Yah I thought that was a nice touch too. π
September 13, 2013 at 11:49 am
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
Well, any reduction in wining is a good thing. But the default mentioned was the wrong one. The server default language is irrelevant if the user default language is different.
Tom
September 13, 2013 at 7:20 pm
Great question! Thank You!
September 14, 2013 at 12:49 am
Nice simple question to begin the week with (in my region),
good to know some new info; the default value of @@DATEFIRST for language 'us_english' is 7;
as I tried for many other languages I got the same default result as [1].
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
September 15, 2013 at 9:31 pm
Nice and steady wins the race - easy QotD for the week.
Hope this helps...
Ford Fairlane
Rock and Roll Detective
September 18, 2013 at 4:13 am
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
+1 for the author. Even ensured that people having different language settings get the scenario correctly. π
September 18, 2013 at 8:10 am
sqlnaive (9/18/2013)
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
+1 for the author. Even ensured that people having different language settings get the scenario correctly. π
Actually no, it didn't, the author got that wrong (specified the wrong default - should have been the login's language defeult, not the server's). If you'd read earlier comments you would have understood that. Not that it matters, in terms of qotD, because it was obvious what the author meant to do and that should be enough, s kudos to teh author for trying to tie it down completely, but technically it isn't possible to detemine the result from the stated conditions.
Tom
September 18, 2013 at 9:14 am
L' Eomot InversΓ© (9/18/2013)
sqlnaive (9/18/2013)
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
+1 for the author. Even ensured that people having different language settings get the scenario correctly. π
Actually no, it didn't, the author got that wrong (specified the wrong default - should have been the login's language defeult, not the server's). If you'd read earlier comments you would have understood that. Not that it matters, in terms of qotD, because it was obvious what the author meant to do and that should be enough, s kudos to teh author for trying to tie it down completely, but technically it isn't possible to detemine the result from the stated conditions.
Totally agreed with you L' Eomot. I got your point. However as the author has mentioned as follows:
set language 'us_english' --just to make sure
it is going to set the default language for that session as 'us_english' no matter what the other settings are. I myself has 'british' as default in my environment. But got the answer right. Though there can be some doubt at point where the command is run in new session, but again author has mentioned that "assume the default server language is us_english" so you have to ensure the same before answering. I didn't understand where the issue is.
September 18, 2013 at 5:39 pm
sqlnaive (9/18/2013)
it is going to set the default language for that session as 'us_english' no matter what the other settings are. I myself has 'british' as default in my environment. But got the answer right. Though there can be some doubt at point where the command is run in new session, but again author has mentioned that "assume the default server language is us_english" so you have to ensure the same before answering. I didn't understand where the issue is.
The issue us that if the server default is US english and the login default is something else, it's the login default that will be used in the new session; so specifying what the server default is doesn't help, unless the login default is the same. Usually, it will be (because when you cretae a login, the default for its default language is the server default); but not always - you can specify a different default language for the login, and what's used in the new session is determined by the login default, not by the server default.
And of course the session default isn the current session makes not one bit of difference to the session language in the new session created by telling SSMS to open a new query.
Tom
September 19, 2013 at 1:15 am
L' Eomot InversΓ© (9/18/2013)
sqlnaive (9/18/2013)
it is going to set the default language for that session as 'us_english' no matter what the other settings are. I myself has 'british' as default in my environment. But got the answer right. Though there can be some doubt at point where the command is run in new session, but again author has mentioned that "assume the default server language is us_english" so you have to ensure the same before answering. I didn't understand where the issue is.you can specify a different default language for the login, and what's used in the new session is determined by the login default, not by the server default.
Gotcha, in rare case, people might fall for it where user lang setting is different than that of serve level (which in this case should be us_english). However i got the idea of the author and so applied the statement "set language 'us_english' --just to make sure" in new session and got it correct. π
September 26, 2013 at 3:15 pm
Koen Verbeeck (9/13/2013)
Very nice question to close off the week.And kudos for mentioning the default language, so there's less whining in the discussion π
+1
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 14 posts - 16 through 28 (of 28 total)
You must be logged in to reply to this topic. Login to reply