Link to home
Start Free TrialLog in
Avatar of eshurak
eshurakFlag for United States of America

asked on

Create table from table on a Linked Server

Hello,
Using MS SQL Server 2000 I'm trying to create a new table that will contain all table and fields from another table on a Linked Server.  

Using:
CREATE TABLE INT_USER AS(select * from interaction.interaction.dbo.INT_USER);

I get the following error message:

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS'.

I can just run the select statement and return records.

Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of St3veMax
St3veMax
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eshurak

ASKER

Great that worked.  Could you tell me why? Or when to use create table vs. select * into?
Quite simply; If you have a table that you wish to insert into that already exists - use Insert Into otherwise use Select Into.

Be aware that depending on the number of rows in your source database; this could take some time. Also be aware of referential integrity on your new database.

HTH