Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Linked Servers Syntax - "drop if exists" and "select * into from" Expand / Collapse
Author
Message
Posted Wednesday, January 23, 2013 11:25 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 15, 2013 4:16 AM
Points: 38, Visits: 250
Hi,

Can anyone let me know the syntax for "drop if exists" and "select * into from" using Linked Server tables.
Post #1410909
Posted Wednesday, January 23, 2013 11:48 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, October 9, 2014 3:22 PM
Points: 177, Visits: 522
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 :)

Post #1410916
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse