you could use the following approach as well:
insert into Table1
select *
from Table2 a
where not exists
(
select *
from Table1 b
where a.Table2Key = b.Table1Key
)
after some diggin' around I came across to this thread http://www.sqlservercentral.com/Forums/Topic13346-8-1.aspx?Highlight=drop+identity.
There is a suggestion there to use a dynamic procedure of this sort:
Create Procedure CreateTable (@Table sysname, @Target sysname, @Condition...
SQLDenis: I know it's undocumented but it's the best thing I've come across that deals with the issue I need to resolve, so, drop, create, rename etc. won't do the trick (pleaz read below). I'm sure the statement is correct, something else must be wrong.
SQLSister: Well, I'm not interested in...
my problem i'm facing is relevant to a closed thread (thread183-1149286). The script provided works fine and table access is also fine untill... the SQL service is restarted. From then on, the object seems not to be accesible anymore and the following error message appears when a SELECT...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.