Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQL Sever Access Error

 
   Database Forums (Home) -> Security RSS
Next:  Broken Replication issue.  
Author Message
King Coffee

External


Since: Dec 26, 2007
Posts: 3



(Msg. 1) Posted: Thu Nov 27, 2008 10:49 pm
Post subject: SQL Sever Access Error
Archived from groups: microsoft>public>sqlserver>security (more info?)

Hi,

I copied and restore a SQL 2005 database to SQL Sever 2008 SSMS. I can
access it OK with Windows Authentication. But when I try SQL Sever
Authentication, I get the following error:
The database <DataBase Name> is not accessible. (ObjectExplorer)

It connects to the database OK... but it can access it.

King

 >> Stay informed about: SQL Sever Access Error 
Back to top
Login to vote
Abba

External


Since: Nov 13, 2008
Posts: 39



(Msg. 2) Posted: Fri Nov 28, 2008 3:25 am
Post subject: Re: SQL Sever Access Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey King,

Has this SQLServer login got the permissions on the database?

hth,
AbbA

"King Coffee" wrote in message

> Hi,
>
> I copied and restore a SQL 2005 database to SQL Sever 2008 SSMS. I can
> access it OK with Windows Authentication. But when I try SQL Sever
> Authentication, I get the following error:
> The database <DataBase Name> is not accessible. (ObjectExplorer)
>
> It connects to the database OK... but it can access it.
>
> King

 >> Stay informed about: SQL Sever Access Error 
Back to top
Login to vote
Russell Fields

External


Since: Feb 21, 2007
Posts: 457



(Msg. 3) Posted: Fri Nov 28, 2008 11:57 am
Post subject: Re: SQL Sever Access Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

King,

Restoring a database with a user that is based on a SQL Server login to
another server has a potential problem with the SIDs not matching. Check
out the following to see if it resolves your problem:

EXECUTE sp_change_users_login 'Auto_Fix', 'SQLLoginName'

This assumes that your new server has the login 'SQLLoginName' and that your
database has a user 'SQLLoginName' that is based on the login
'SQLLoginName'.

You could also check in advance to see whether the SIDs match up. (Using
old system views._

SELECT name, sid from master.dbo.syslogins WHERE name = 'SQLLoginName'
SELECT name, sid from database.dbo.sysusers WHERE name = 'SQLLoginName'

RLF


"King Coffee" wrote in message

> Hi,
>
> I copied and restore a SQL 2005 database to SQL Sever 2008 SSMS. I can
> access it OK with Windows Authentication. But when I try SQL Sever
> Authentication, I get the following error:
> The database <DataBase Name> is not accessible. (ObjectExplorer)
>
> It connects to the database OK... but it can access it.
>
> King
 >> Stay informed about: SQL Sever Access Error 
Back to top
Login to vote
Uri Dimant

External


Since: Aug 24, 2003
Posts: 739



(Msg. 4) Posted: Mon Dec 01, 2008 1:25 am
Post subject: Re: SQL Sever Access Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Russel
It is easy doing with a new syntax Smile)

ALTER USER uname WITH LOGIN =loginname



"Russell Fields" wrote in message

> King,
>
> Restoring a database with a user that is based on a SQL Server login to
> another server has a potential problem with the SIDs not matching. Check
> out the following to see if it resolves your problem:
>
> EXECUTE sp_change_users_login 'Auto_Fix', 'SQLLoginName'
>
> This assumes that your new server has the login 'SQLLoginName' and that
> your database has a user 'SQLLoginName' that is based on the login
> 'SQLLoginName'.
>
> You could also check in advance to see whether the SIDs match up. (Using
> old system views._
>
> SELECT name, sid from master.dbo.syslogins WHERE name = 'SQLLoginName'
> SELECT name, sid from database.dbo.sysusers WHERE name = 'SQLLoginName'
>
> RLF
>
>
> "King Coffee" wrote in message
>
>> Hi,
>>
>> I copied and restore a SQL 2005 database to SQL Sever 2008 SSMS. I can
>> access it OK with Windows Authentication. But when I try SQL Sever
>> Authentication, I get the following error:
>> The database <DataBase Name> is not accessible. (ObjectExplorer)
>>
>> It connects to the database OK... but it can access it.
>>
>> King
>
 >> Stay informed about: SQL Sever Access Error 
Back to top
Login to vote
Display posts from previous:   
   Database Forums (Home) -> Security All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]