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.
LVL 3
eshurakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

St3veMaxCommented:
Does the table already exist? If not you can use the code below.

HTH

SELECT * INTO NewDatabase.dbo.INT_User FROM LinkedServer.OldDatabase.dbo.INT_User

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eshurakAuthor Commented:
Great that worked.  Could you tell me why? Or when to use create table vs. select * into?
0
St3veMaxCommented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.