SQL Server – Linked Server – Mapped all users with one statement

Hello Friends, I have setup the Linked server with the help of script here. My one of colleague helps me to write the script with we can map all user with one statement. This script will map all local SQL server users with remote user that you provide in the script. You don’t need to map all user manually. Script: EXEC master.dbo.sp_addlinkedserver @server = N‘dsql2k’, @srvproduct=N”, @provider=N‘SQLOLEDB’, @datasrc=N‘servername’ EXEC master.dbo.sp_addlinkedsrvlogin@rmtsrvname=N‘dsql2k’,@useself=N‘False’, @locallogin=NULL,@rmtuser=N‘sa’,@rmtpassword=‘XXXXXX’ if anybody have any other experience, please share as

» Read more

Query Optimization with Linked Server

Hello Friends, I have faced a problem in SQL queries with Linked server; I just want to share with you all. Let me explain with example as below Say, we have set of applications which are running on SQL 2000, due to some reason we need to migrate sub set of applications to SQL 2008. Now the few applications running on SQL 2008 and few on SQL 2000, applications running on SQL 2008 using some of databases which lie on

» Read more

SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY not working with Linked Server or Remote server ???

Hello Friends, I have faced a problem using SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY with Linked server Let me explain with example as below Question: We have set of applications which are running on SQL 2000, due to some reason we need to migrate sub set of applications to SQL 2008. Now the few applications running on SQL 2008 and few on SQL 2000, applications running on SQL 2008 using some of databases which lie on SQL 2000 with Linked server Now

» Read more

Linked Server

——————————————————— Create  Linked Server through Scripts ——————————————————— USE [master] GO EXEC sp_addlinkedserver @server=’dsql2k’, @srvproduct=”, @provider=’SQLNCLI’, @datasrc=’source_name’ GO USE [master] GO EXEC master.dbo.sp_serveroption @server=N’dsql2k’, @optname=N’rpc’, @optvalue=N’true’ GO EXEC master.dbo.sp_serveroption @server=N’dsql2k’, @optname=N’rpc out’, @optvalue=N’true’ GO select * from master.dbo.sysservers ————————————————————————— Alternative Script to Create Linked Server and Mapping of Users ————————————————————————— Use Master go EXEC master.dbo.sp_addlinkedserver @server = N’dsql2k’, @srvproduct=N”, @provider=N’SQLOLEDB’, @datasrc=N’testserver’ GO EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N’dsql2k’, @locallogin = N’sa’, @useself = N’False’, @rmtuser = N’sa’, @rmtpassword = N’sa’ GO

» Read more