Linked Servers Syntax - "drop if exists" and "select * into from"

  • Hi,

    Can anyone let me know the syntax for "drop if exists" and "select * into from" using Linked Server tables.

  • Hello I have

    on the server 1.1.1.2

    i think

    SELECT * FROM [1.1.1.1].DATABASE.dbo.TABLE

    and try

    DROP TABLE table_name [1.1.1.1].DATABASE.dbo.TABLE;

    IF EXISTS (SELECT COUNT(*) FROM sys.object WHERE OBJECT_ID = OBJECT_ID(N'TABLE'))

    DROP TABLE IF EXISTS table_name [1.1.1.1].DATABASE.dbo.TABLE;

    but the second query i didnt use before 🙂

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

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