Simple SQL server question?

5 pts.
Tags:
dBASE
Microsoft Access
Microsoft SQL Server 2000
I want to do something that WAS easy in my former world (a dBase environment) but I can't figure out how to do it in MS Access/SQL Server 2000. I would GREATLY appreciate anyone's help. This is what I want to do, in order: 1) Select the top # records of a table, "#" is a field in another table. 2)Replace a field in the table with a value for just those selected records. 3) Append all the records with that value to another table. 4) Delete all the records in the original table with the value I put in. If I were working in the dbase world, it would go something like this... SELECT a USE table1 replace next 200 (or whatever number) receivedate with #1/1/2009# Select b Use table2 Append from table1 for receivedate<>0 select a delete all from table1 for recievedate<>0 close all Sounds so simple, but I don't know how to do it in SQL Server or Access. Help!!!!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Using SQL 2000 you’ll need to create a temp table (a table with a # as the first character in the table name) then put the selected rows into the temp table. Update the values in the temp table as needed, then write those values to the destination table then delete them from the source table.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: