Linked Servers

  • Is there a way to drop the objects on the linked server DB? Also any way to execute Select * in to xyz from abc

    Both xyz and abc are on linked server.

    Thanks

    Shas3

  • Hey Shas

    If the login that you are using to connect to the linked server has the appropriate permissions, then anything is possible. it all depends on how the servers are linked, and what rights that the linking account has.

    See the BOL, or MSDN for for information:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_1_server_24tv.asp

    When interacting with a linked server, you must use the fully qualified name when dealing with the remote server, eg:

    SERVER.DATABASE.OWNER.TABLE

    Hope that helps,

    Stu

  • It's little tricky, for the regular INSERT/DELETE/UPDATE you can directly refer Select * from Linkedserver_Name.DB_Name.Usercontext.objects_Name. Whereas to drop the object you must use

    Linkedserver_Name.DB_Name.DBO.sp_executesql N (‘DROP table <tabl_Name>’)

    I figured it out there is no way you can do Select into(Both the objects on linked server). But you can do select into from the linked server object to local object. Pls post your ideas here

    Shas3

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

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