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

Était-ce utile?

La 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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top