Question

i am using new installed sql server 2008

i am trying to copy data from one table to another..i wrote query like this;

insert into Clr  select * from Color_tbl

but this is showing error like this:

Invalid object name 'Clr'.

what i have to do? i have change any setting?

clr is not an existing table..i hop if i execute this query that will create clr table automatically...

I used to copy data from one table to another table like this: but i dont know what happend after installing new Sql server??

any help is very appriciable

Was it helpful?

Solution

Without knowing anything else about your database and schemas, you could try using fully qualified names, like so:

INSERT INTO [DBContainingClr].[SchemaContainingClr].Clr
SELECT * FROM [DBContainingColor_tbl].[SchemaContainingColor_tbl].Color_tbl 

UPDATE: OP has clarified that he is in fact trying to CREATE the table Clr, and it doesn't exist at the moment. In which case the syntax should be:

SELECT * INTO Clr FROM Color_Tbl
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top