Showing posts with label across. Show all posts
Showing posts with label across. Show all posts

Friday, March 23, 2012

Script to compare logins between 2 servers

Does anyone have the above in their code library? I need to compare logins between 2 servers in preparation to move a large number of DBs across.

Ideally, I am looking for duplicates.

In SQL Server 2000 you would query the syslogins table in the master database.

Code Snippet

USE master

GO

SELECT * FROM syslogins

In SQL Server 2005 you would use the new system information views. You can query the sys.syslogins view

Code Snippet

USE master

GO

SELECT * FROM sys.syslogins

Hope this helps get you on track. You can very easily write a comparison script and with a little work automate your findings.

NOTE: You can leave out the USE master - GO parts of the scripts for sql server 2005. the sys.syslogins view is available from all databases.

Script to compare logins between 2 servers

Does anyone have the above in their code library? I need to compare logins between 2 servers in preparation to move a large number of DBs across.

Ideally, I am looking for duplicates.

In SQL Server 2000 you would query the syslogins table in the master database.

Code Snippet

USE master

GO

SELECT * FROM syslogins

In SQL Server 2005 you would use the new system information views. You can query the sys.syslogins view

Code Snippet

USE master

GO

SELECT * FROM sys.syslogins

Hope this helps get you on track. You can very easily write a comparison script and with a little work automate your findings.

NOTE: You can leave out the USE master - GO parts of the scripts for sql server 2005. the sys.syslogins view is available from all databases.

Tuesday, March 20, 2012

Script out dbmail configuration?

Is there any way to script out the dbmail configuration? It would be quite handy to have a script to deploy for uniformity across servers...

Currently it's quite a pita to have to configure dbmail by hand on every server.

Thank you.

That is a very nice request, I will file a design request on this.

Currently there are APIs (SMO and SPs) that exists to create a profile, account . You can use them to create a reusable script to run on multiple servers.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/58ae749d-6ada-4f9c-bf00-de7c7a992a2d.htm

Cut and paste the above link in BOL and you should be able to see sample script for this scenario.

Gops Dwarak

Script out dbmail configuration?

Is there any way to script out the dbmail configuration? It would be quite handy to have a script to deploy for uniformity across servers...

Currently it's quite a pita to have to configure dbmail by hand on every server.

Thank you.

That is a very nice request, I will file a design request on this.

Currently there are APIs (SMO and SPs) that exists to create a profile, account . You can use them to create a reusable script to run on multiple servers.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/58ae749d-6ada-4f9c-bf00-de7c7a992a2d.htm

Cut and paste the above link in BOL and you should be able to see sample script for this scenario.

Gops Dwarak