SP running in instace1 inserting into instace2

  • Hello,

    Is it possible to run a stored procedure from a database in one instance of SQL Server that can insert into a table in another database in a different instance of SQL Server?

    Thanks,

    Dan

  • Of course. Just qualify your names fully:

    FROM server_name.db_name.owner_name.table_name

    where server_name will include the instance specification.

  • mromm,

    Does this look correct I have one of those system generated server names!?

    Select * Into G-6F85G465CSGUJ\Archive.PSPArchive.dbo.Secure From Secure_1

    It does not like the dash "-" though...

    Dan

  • Dan, run SELECT @@SERVERNAME to find the name of your server. If in contains dash, put the name into square brakets: [server_name]. Finally, create a table on the destination server and use INSERT... SELECT instead of SELECT INTO.

    Michael

  • Michael

    Ok, thanks. I got it working now...

    Thanks again,

    Dan

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply