Saturday, February 25, 2012

connecting sql server

i created a database, when i query a simple select statement , i get an
error:
"Cannot open database requested in login 'XYZ_Database'.
Login fails, Login failed for user 'sa''
But when i change , the database name to Northwind, it works.
i checked that user rights of 'sa' for XYZ_database and Northwind are the
same?
i get the same error, when i used integrated security to connect too.
what would be the case here?
Hi,
It seems the database creator/owner might be some other user.
Execute the below command to check the database owner:-
sp_helpdb 'XYZ_Database'
If the owner is a non SA user , then change the database owner using:-
sp_changedbowner system procedure (Refer books online for information)
Thanks
Hari
MCDBA
"e-mid" <someone@.somewhere> wrote in message
news:#uip9U6VEHA.208@.TK2MSFTNGP10.phx.gbl...
> i created a database, when i query a simple select statement , i get an
> error:
> "Cannot open database requested in login 'XYZ_Database'.
> Login fails, Login failed for user 'sa''
>
> But when i change , the database name to Northwind, it works.
> i checked that user rights of 'sa' for XYZ_database and Northwind are the
> same?
> i get the same error, when i used integrated security to connect too.
> what would be the case here?
>
|||Hari;
user of the database seems to be sa; here is the properties of the database:
"XYZ_database 3.00 MB sa 7 Jun 21 2004 Status=ONLINE,
Updateability=READ_WRITE, UserAccess=MULTI_USER, Recovery=FULL,
Version=539, Collation=Latin1_General_CI_AS, SQLSortOrder=0,
IsTornPageDetectionEnabled, IsAutoCreateStatistics, IsAutoUpdateStatistics
80"
what else can be the problem?
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:#Sh3WY6VEHA.1144@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hi,
> It seems the database creator/owner might be some other user.
> Execute the below command to check the database owner:-
> sp_helpdb 'XYZ_Database'
> If the owner is a non SA user , then change the database owner using:-
> sp_changedbowner system procedure (Refer books online for information)
> Thanks
> Hari
> MCDBA
>
>
> "e-mid" <someone@.somewhere> wrote in message
> news:#uip9U6VEHA.208@.TK2MSFTNGP10.phx.gbl...
the
>
|||i am becoming insane.
i did not change even a letter but it is working now ?!
"e-mid" <someone@.somewhere> wrote in message
news:u7BQSe6VEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Hari;
> user of the database seems to be sa; here is the properties of the
database:[vbcol=seagreen]
> "XYZ_database 3.00 MB sa 7 Jun 21 2004 Status=ONLINE,
> Updateability=READ_WRITE, UserAccess=MULTI_USER, Recovery=FULL,
> Version=539, Collation=Latin1_General_CI_AS, SQLSortOrder=0,
> IsTornPageDetectionEnabled, IsAutoCreateStatistics, IsAutoUpdateStatistics
> 80"
> what else can be the problem?
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:#Sh3WY6VEHA.1144@.TK2MSFTNGP10.phx.gbl...
an
> the
>
|||Good.
Thanks
Hari
MCDBA
"e-mid" <someone@.somewhere> wrote in message
news:OFRlQt6VEHA.2408@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> i am becoming insane.
> i did not change even a letter but it is working now ?!
>
> "e-mid" <someone@.somewhere> wrote in message
> news:u7BQSe6VEHA.2520@.TK2MSFTNGP12.phx.gbl...
> database:
IsAutoUpdateStatistics[vbcol=seagreen]
> an
are[vbcol=seagreen]
too.
>

No comments:

Post a Comment