Showing posts with label master. Show all posts
Showing posts with label master. 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 Linked Server Config from one server to another

Is it advisable to copy the sysservers table and sysoledbusers view from the
master DB on one server to master on a 2nd server?
I have 20 linked servers that I need to add to 2 new servers and I would lik
e to avoid configuring them individually.You wouldn't want to copy the system tables to accomplish
this.
There is a script on SQL Server Central that scripts out
remote, linked servers. Check the following on their site:
http://www.sqlservercentral.com/scr...butions/620.asp
-Sue
On Thu, 25 Mar 2004 05:41:06 -0800, Joe
<anonymous@.discussions.microsoft.com> wrote:

>Is it advisable to copy the sysservers table and sysoledbusers view from th
e master DB on one server to master on a 2nd server?
>I have 20 linked servers that I need to add to 2 new servers and I would like to av
oid configuring them individually.

Thursday, March 8, 2012

Copying data from one table to another in SQL Server

Hi,

I have two tables: 'Master' and 'Maximo'. I need to populate the sub-tables in 'Master' with the data from the equivalent sub-tables in 'Maximo'.

I'm aware that I can do this for each individual sub-table by using the Insert and Into commands and specifying the fields to populate.

However, there are 300 sub-tables which need to be populated.

Is there a batch command in SQL that would allow the easy migration of data from one table into another? The field structure is the same on both, so that should not be an issue.

I'm using Windows 2000 terminal to access the server with the databases on it. SQL Server 2000 and using MS SQL Server Enterprise manager.

Apologies if this is a really dumb question. I'm not very familiar with SQL and have rather been thrown in at the deep end with this.

Thanks in advance.Only thing i can suggest is create a dts using code such as:

"insert into <tablename>
select * from <tablename>"

once created you can re run the dts as many times as you like.|||Thanks for the suggestion. I'll give it a go.