Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 create table

Author  Topic 

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2008-11-25 : 19:46:56
I am trying to create a table from an existing table using SQL 2005 Express. This is the code I am using:

create table test_increment.tmp
select * from test_increment

What is wrong?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-25 : 20:04:37
quote:
Originally posted by jcb267

I am trying to create a table from an existing table using SQL 2005 Express. This is the code I am using:


select * into tmp from test_increment
What is wrong?

Go to Top of Page

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2008-11-25 : 20:15:22
That does not work either.

I get this error message:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'test_increment'.

quote:
Originally posted by sodeep

quote:
Originally posted by jcb267

I am trying to create a table from an existing table using SQL 2005 Express. This is the code I am using:


select * into tmp from test_increment
What is wrong?



Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2008-11-25 : 22:48:18
select * into test_increment.tmp from test_increment

--------------------------------------------------
S.Ahamed
Go to Top of Page

karthickbabu
Posting Yak Master

151 Posts

Posted - 2008-11-25 : 23:58:41
quote:
Originally posted by jcb267

That does not work either.

I get this error message:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'test_increment'.

quote:
Originally posted by sodeep

quote:
Originally posted by jcb267

I am trying to create a table from an existing table using SQL 2005 Express. This is the code I am using:


select * into tmp from test_increment
What is wrong?







select * into tmp from test_increment

Its works, If you get this error message "Invalid object name 'test_increment'"
Then there is no object name in your database. Check it.

====================================================
you realize you've made a mistake, take immediate steps to correct it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-26 : 00:07:54
try this too (just in case you're in wrong db context)

use yourdbname
select * into tmp from test_increment

Go to Top of Page
   

- Advertisement -