Wednesday, March 28, 2012

SET DATEFIRST and ASP.NET

Hi Everyone,
My scenario is that I am writing and application on a server which host
several ASP.NET applications. In my application I would like to use a
function which relies on a custom function which unfortunately is dependent
on the SQL Server's SET DATEFIRST command which sets the first day of the
w for the current session.
The ASPNET account is solely responsible for opening and closing SQL
Connections for example, if I want data from a view, I run a function which
opens the connection gets the data and then closes it. If I issue a SET
DATEFIRST in one function and dont in another, will it get the default in
the second because I closed down the connection. >?
GoofyActually, while waiting I have done an experiement. The logic holds true.
Once the connection under which the SET DATEFIRST is used is closed, when a
new connection is re-opened, the default is restored so you can use this
independent of anyone else.
"Goofy" <me@.mine.com> wrote in message
news:udxrRrJCHHA.204@.TK2MSFTNGP04.phx.gbl...
> Hi Everyone,
> My scenario is that I am writing and application on a server which host
> several ASP.NET applications. In my application I would like to use a
> function which relies on a custom function which unfortunately is
> dependent on the SQL Server's SET DATEFIRST command which sets the first
> day of the w for the current session.
> The ASPNET account is solely responsible for opening and closing SQL
> Connections for example, if I want data from a view, I run a function
> which opens the connection gets the data and then closes it. If I issue a
> SET DATEFIRST in one function and dont in another, will it get the default
> in the second because I closed down the connection. >?
>
>
> --
> Goofy
>

0 comments:

Post a Comment