Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Tuesday, March 27, 2012

Correct invalid SID

I migrated my SQL 2000 secuity from one NT Domain to another. In the process of changing the login names in the master..sysxlogins table, the SID did not get updated.

Is there an easy way to correct the SID entry without dropping and recreating each user?

Do you mean that you have manually changed the login names in sysxlogins and you wish to update the SID entries as well? Can you explain what you meant by "the process of changing the login names in the master..sysxlogins table"?

Thanks
Laurentiu

|||

I ran the following in the master db:

UPDATE sysxlogins

Set [name] = 'NEWDOMAIN\' + substring([name], patindex('%\%', [name])+1, 200)

WHERE [name] like 'OLDDOMAIN\%'

It changed all the login names to point to the new domain. The problem was the SIDs changed (which I didn't think about) in the new domain. Users can get in, but when we try to use the function suser_sid(), the correct network sid is being returned and we cant compare it to the one in sysxlogins or sysusers because it doesn't match.

|||

If you move from domain A to domain B, the Windows logins from domain A are normally invalidated. An exception to this would be if domain B was trusted by domain A, then you could still use the A logins even though the server runs in domain B.

This kind of domain change is not a supported operation. There is no supported solution for fixing this. It's not only the logins that you would need to fix, but all the database users as well. If you plan to change the domain for your server often, then you should use only SQL authentication.

Thanks
Laurentiu

sql

Tuesday, March 20, 2012

copying sql server logins and users

Hi All,
I have a user database with 20 users. I have to transfer this database to some other location (location B) with the user and login, so that others would be able to login (assuming i have provided them username and pwd for logging). I can take the backup of the database, which can be restored at location b, in which the users will also be available.
Now my question i
Is there a mechansim to copy sql server logins also, such that, when the database is restored at location b, the users will be able to simply login...
Thanks
GYKThis should help
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q246133&
Ray Higdon MCSE, MCDBA, CCNA
--
"GYK" <anonymous@.discussions.microsoft.com> wrote in message
news:40A125DF-6C22-48DA-9780-DA7A7ED52B5E@.microsoft.com...
> Hi All,
> I have a user database with 20 users. I have to transfer this database to
some other location (location B) with the user and login, so that others
would be able to login (assuming i have provided them username and pwd for
logging). I can take the backup of the database, which can be restored at
location b, in which the users will also be available.
> Now my question is
> Is there a mechansim to copy sql server logins also, such that, when the
database is restored at location b, the users will be able to simply
login...
> Thanks
> GYK

Monday, February 13, 2012

Copy Specific Cells between Tables based on Login ID

I want to copy FirstName and LastName cells from table1 to table2. Which FirstName and LastName cells depend on the username, i.e. which person has logged in.

Q1) How can this be done? (I have chosen to SELECT from Table1 and output to variables (C# code); then INSERT these variables into Table2. [Finding it very difficult]).

Any suggestions/comments would be appreciated. Thank you in advance.

You can achieve what you need in a single statement

In SQL Server and Oracle

insert into test3 (lib_id, lib_name, lib_desc)
select lib_id, lib_name, lib_desc from test2 where lib_id=1