adinica (4/5/2013)
Thank you. It was exactly what i was trying right now. I have a question, how do I refer to the server I am on in the openquery? Is there such a thing as linked server local?
well it's possible, but i'm not sure why you'd want to do it.
if you are already connected to the sql server itself, there's no real need to create a "Loopback" linked server to itself, is there?
you can query data directly already.
I've tested this, and it does work, but i think we need to figure out WHY you think you want to use a linked server?
in this case, my developer machine is "DEV223", and here's my loopback linked server to itself:
/****** Object: LinkedServer [MyLoopbackServer] Script Date: 04/05/2013 13:57:06 ******/
EXEC master.dbo.sp_addlinkedserver
@server = N'MyLoopbackServer',
@provider=N'SQLNCLI',
@datasrc=N'DEV223',
@catalog=N'SandBox'
/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'MyLoopbackServer',
@useself=N'True',
@locallogin=NULL,
@rmtuser=NULL,
@rmtpassword=NULL
Lowell