Monday, March 26, 2012

set default schema on connection string

Hi,
We have a aps.net 2.0 web application and sqlserver 2005.
We keep the connection string in the web.config file.
We need to set the for the web application...
so we do not have to hard code the default schema in every call.
Is it possible to set default schema in the connection string?
Thanks
NalakaHi,
can't you set default schema for the SQL Server user which you use for the
ASP.NET application?
Sample from Books Online
USE AdventureWorks;
ALTER USER Abolrous WITH DEFAULT_SCHEMA = Purchasing;
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Nalaka" <nalaka12@.nospam.nospam> wrote in message
news:uGEIEY5IGHA.2708@.tk2msftngp13.phx.gbl...
> Hi,
> We have a aps.net 2.0 web application and sqlserver 2005.
> We keep the connection string in the web.config file.
> We need to set the for the web application...
> so we do not have to hard code the default schema in every call.
> Is it possible to set default schema in the connection string?
>
> Thanks
> Nalaka
>

0 comments:

Post a Comment