문제

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

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top