validity SET DATEFIRST

D

DraguVaso

Hi,

Some questions about the SET DATEFIRST-function...

When I do a "SELECT @@DATEFIRST" then I got "7", which is normal and the
standard.

When I open a Blank Query in the Query Analyzer and I do a "SET DATEFIRST
1", and I do afterwarths in the same (!!) Query-window a "SELECT
@@DATEFIRST" I receive "1", which is also normal and expected.

BUT:

When I run after that in another (!!) Query window the "SELECT @@DATEFIRST"
I receive "7".. and not "1" as I expected...

Or when I do a "SET DATEFIRST 1", and after that I close the Query Analyzer
and open a new one and do a "SELECT @@DATEFIRST" I also receive "7"....

So now my question/remark: it seems to me that the "SET DATEFIRST3 function
doesn't really affec the SQL Server, but only the query's that follow. Is
this true or not? For me that's good behaviour, because I don't want to
afect the settigns of my SQL Server, But I need to be sure....

Thansk a lot in advance,

Pieter
 
T

Tibor Karaszi

Yes, SET setting only affects the current connection. Or only the stored procedure or trigger if
executed inside a stored procedure or trigger.
 
D

DraguVaso

Thanks for the quick answer!!

Tibor Karaszi said:
Yes, SET setting only affects the current connection. Or only the stored procedure or trigger if
executed inside a stored procedure or trigger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top