Friday, March 30, 2012

No login name for database user.

I am using SQL2000. I took a backup of the database on the live server to setup the database on my new development computer. In the tables, there are 2 owners’ dbo and indiankarma. The tables that are owned by indiankarma are the tables that the site runs from.

The problem: The database user was created by the .bak file and does not have a login name. I created a security login named indiankarma and set the password, default database, server roles, BUT when I set the database access and click OK, it says User 'Indiankarma' already exists. I tried to delete the database user and start from scratch but it tells me the selected user cannot be dropped because the user owns objects.

Now I have tried sp_changedbowner 'indiankarma' which does give the security login name indiankarma database access but it makes the user dbo not indiankarma. I need the web application to read indiankarma.[tablename] not dbo.[tablename]

Can anyone help me with this problem?? Confused

This is a common issue after restoring a database. Check the following blog

http://weblogs.asp.net/steveschofield/archive/2005/12/31/434280.aspx

Regards

|||

I don't think I explained the problem correctly. When I restored the data base it created 2 sets of tables for each table. One set owned by dbo and the other set by indiankarma. So I have a table that is indiankarma.ikuserinfo and a table right below it that is dbo.ikuserinfo. All the site data is in the indiankarma owned tables. (see below 1.1)

1.1

The problem is that the 'indiankarma' database user has no login name. (See below 1.2).

1.21.2

Also, the security login 'indiankarma' does not have access to the database (see below 1.3) and when I try to give it access, I get this error 'User 'Indiankarma' already exists.' (see below 1.4)

1.3 1.3

1.41.4

I need to know what I can do to get database user 'indiankara' a login name and how to permit security login 'indiankarma' database access with the user 'indiankarma'. So it looks like the figure below (see below 1.5) but when I click ok, it does not give me the error. Please help!!! Sorry for all the images, I am bad at explaining problems thought they might help!

1.51.5

|||

I don't think I explained the problem correctly. When I restored the data base it created 2 sets of tables for each table. One set owned by dbo and the other set by indiankarma. So I have a table that is indiankarma.ikuserinfo and a table right below it that is dbo.ikuserinfo. All the site data is in the indiankarma owned tables. (see below 1.1)

1.1

The problem is that the 'indiankarma' database user has no login name. (See below 1.2).

1.21.2

Also, the security login 'indiankarma' does not have access to the database (see below 1.3) and when I try to give it access, I get this error 'User 'Indiankarma' already exists.' (see below 1.4)

1.3 1.3

1.41.4

I need to know what I can do to get database user 'indiankara' a login name and how to permit security login 'indiankarma' database access with the user 'indiankarma'. So it looks like the figure below (see below 1.5) but when I click ok, it does not give me the error. Please help!!! Sorry for all the images, I am bad at explaining problems thought they might help!

1.51.5

|||

I don't think I explained the problem correctly. When I restored the data base it created 2 sets of tables for each table. One set owned by dbo and the other set by indiankarma. So I have a table that is indiankarma.ikuserinfo and a table right below it that is dbo.ikuserinfo. All the site data is in the indiankarma owned tables. (see below 1.1)

1.1

The problem is that the 'indiankarma' database user has no login name. (See below 1.2).

1.21.2

Also, the security login 'indiankarma' does not have access to the database (see below 1.3) and when I try to give it access, I get this error 'User 'Indiankarma' already exists.' (see below 1.4)

1.3 1.3

1.41.4

I need to know what I can do to get database user 'indiankara' a login name and how to permit security login 'indiankarma' database access with the user 'indiankarma'. So it looks like the figure below (see below 1.5) but when I click ok, it does not give me the error. Please help!!! Sorry for all the images, I am bad at explaining problems thought they might help!

1.51.5

|||

I don't think I explained the problem correctly. When I restored the data base it created 2 sets of tables for each table. One set owned by dbo and the other set by indiankarma. So I have a table that is indiankarma.ikuserinfo and a table right below it that is dbo.ikuserinfo. All the site data is in the indiankarma owned tables. (see below 1.1)1.1
The problem is that the 'indiankarma' database user has no login name. (See below 1.2).1.21.2

Also, the security login 'indiankarma' does not have access to the database (see below 1.3) and when I try to give it access, I get this error 'User 'Indiankarma' already exists.' (see below 1.4)1.3
1.31.4
1.4I need to know what I can do to get database user 'indiankara' a login name and how to permit security login 'indiankarma' database access with the user 'indiankarma'. So it looks like the figure below (see below 1.5) but when I click ok, it does not give me the error. Please help!!! Sorry for all the images, I am bad at explaining problems thought they might help!1.51.5

No comments:

Post a Comment