• alex 64682 (1/7/2013)


    Many thanks for all the responses. I haven't encountered Openrowset before but it looks like the best option. Not entirely sure where to place the remote IP Address, port number etc for the connection string though, don't suppose anyone has examples of this type of thing?

    I believe that the IP address can be part of the HOSTNAME shown by e4d4 in his example below.

    e4d4 (1/4/2013)


    You could use linkedservers, openrowset http://msdn.microsoft.com/en-us/library/ms190312.aspx or openquery http://msdn.microsoft.com/en-us/library/ms188427.aspx

    eg. openrowset SELECT * FROM OPENROWSET('SQLOLEDB', 'Server=HOSTNAME;UID=DB_USER;PWD=StronPassword;','select * table');

    Beware though, that the arguments passed to OPENROWSET must be string literals; no local variables are allowed.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St