John Porter
asked on
Cannot Authenticate User to Database SQL SERVER 2005
Hello Experts,
I have a SQL Sserver 2005 Database that was created on another system... It is authenticating with the sa password.
When I attach the databse to the new SQL Server, My application (accessing the DB with OleDB SQL Native Client) cannot log onto the SQL Server databse.
When I go to sa properties, and the User Mapping page, I am unable to map to the desired database. If I create a new database I can map to it. This feels like a SID issue.
Does anyone know how to get around this??
Thanks!
I have a SQL Sserver 2005 Database that was created on another system... It is authenticating with the sa password.
When I attach the databse to the new SQL Server, My application (accessing the DB with OleDB SQL Native Client) cannot log onto the SQL Server databse.
When I go to sa properties, and the User Mapping page, I am unable to map to the desired database. If I create a new database I can map to it. This feels like a SID issue.
Does anyone know how to get around this??
Thanks!
ASKER
I am definitely in Mixed mode.
Like I mentioned, I can map any user (includingsa) to a new database of the same name but cannot map to this existing datbase.
It feels like something with the old database that is preventing this from happening. Could it be a SID problem??
Thanks
Like I mentioned, I can map any user (includingsa) to a new database of the same name but cannot map to this existing datbase.
It feels like something with the old database that is preventing this from happening. Could it be a SID problem??
Thanks
Yeah, ok... could be a SID thing then. Annoyingly, you can't remove 'dbo', which is the user that maps to 'sa'.
Umm.... let me think and get back to you.
Rob
Umm.... let me think and get back to you.
Rob
Hi,
Try the following...
1. Go to the security folder of the <attached database> and delete all the users in that folder.
2. Now restart the sql services
And try to access the database using sa user...
If its still giving error check the roles under security under <attached database> and delete user defined roles in database roles as well as application roles.
and this might work...
let me know if you face any issues...
all the best...
Try the following...
1. Go to the security folder of the <attached database> and delete all the users in that folder.
2. Now restart the sql services
And try to access the database using sa user...
If its still giving error check the roles under security under <attached database> and delete user defined roles in database roles as well as application roles.
and this might work...
let me know if you face any issues...
all the best...
Is your application accessing the system as sa?
and check compatibility level of the database you attached. if it is not set to 90 then change it to 90 and restart the server.
Try this:
--Add the new login.
USE master
go
EXEC sp_addlogin '[login name]','[password]','[defa ult db]'
go
--Change the user account to link with your login.
USE [your database name here]
go
EXEC sp_change_users_login 'Update_One', '[login name]', '[user in db you want to map to]'
--Add the new login.
USE master
go
EXEC sp_addlogin '[login name]','[password]','[defa
go
--Change the user account to link with your login.
USE [your database name here]
go
EXEC sp_change_users_login 'Update_One', '[login name]', '[user in db you want to map to]'
Try the following...
select @@SERVERNAME
If this returns the same instance name you are using, then its OK...
otherwise change the instance to the current instance you are using...
To change the instance name run the following...
USE MASTER
GO
SP_DROPSERVER '<Old_Instance_name>'
GO
USE MASTER
GO
SP_ADDSERVER '<New_Instance_name>', 'LOCAL'
GO
select @@SERVERNAME
If this returns the same instance name you are using, then its OK...
otherwise change the instance to the current instance you are using...
To change the instance name run the following...
USE MASTER
GO
SP_DROPSERVER '<Old_Instance_name>'
GO
USE MASTER
GO
SP_ADDSERVER '<New_Instance_name>', 'LOCAL'
GO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope this helps. :)
Rob