Creating tables remotely

  • I have created a link between two sql server database and what I want to be able to do is create a table on the remote server.  Eg.  I have server A and Server B I want to be able to run a script on server A that can drop and create a table on Server b.

    I can drop the table using the following piece of code but I have not figured out a way to create the table remotely:

    EXECUTE ISDEV.Restore_Inst.dbo.sp_executesql N'drop table Restore_Inst.dbo.QAS_EIM_ACCNT_DTL'

    Any help on this guys would be great!!!

    Les

     

     

  • What is the purpose? Can't you just delete the table instead of drop/create?

    /Kenneth

  • Or Truncate the table so you do not write to the Transaction Log - I am assuming you do not need to keep track of whatever data was contained within that table...

     

    I wasn't born stupid - I had to study.

Viewing 3 posts - 1 through 2 (of 2 total)

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