Link to home
Start Free TrialLog in
Avatar of ohayden
ohayden

asked on

Store Procedure....

How do I create a stored procedure to copy the contents
of one table (with a where statement on a field) to another
table that already exist and MAY have data in it already that we can't kill?
Avatar of mcix
mcix

Do the tables have the same format?
Something like that:

INSERT INTO tab1
  SELECT c1,c2,c3 FROM tab2 -- select only those columns that will match the columns of the first table
   WHERE c1 = 'NY' -- any condition

If that's notwhat you meant, please rephrase your question
(as someone noticed, a well asked question already contains 1/2 of answer :)

ASKER CERTIFIED SOLUTION
Avatar of gmoriak
gmoriak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ohayden

ASKER

I already solved the problem but your answer was exactly how I did it, so even though I did use your answer the points are yours..... thanks.