Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Moving Records from one table to another in the same database... helphelp!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-01 : 11:36:24
Daniel writes "OK... I am completely and TOTALLY new to SQL. More correctly, I'm learning it and building with it but I still have a novice level grasp on it. Simply put... what I'm trying to do is move records from one table in the database to the other table. If it were that simple I would be ever so happy... but (to me) it's a little more difficult. The real world application of what I'm doing is as follows.

I work at a telecom company on the tech team. Our helpdesk is becoming somewhat lagged down because we have ONE person reading through ALL the e-mails and then assigning them... so I'm doing this ---> On the company intranet I'm building an ASP driven helpdesk with a seperate log-in for the supervisors and the tech team. On the supervisor end it inserts the values into a database and automatically generates an ID for the problem and e-mails the tech team and supervisor with confirmation of the problem. That's working fine (although it took me a while to get it right). It's the tech side that's bugging me... what I want to do is to search through Database1 using an ID put in by a tech team member... once that ID is found, I wish to move that row of information into Database2 and ADD the tech member who signed off to complete the task and delete the row of info from Database1. Sorry for the run on but that's the only way I could put it. I read through a few articles on this site (and they helped as much as I could understand) but I'm still having trouble.
This is my SQL String :

SQL = "INSERT INTO tasks (id, who_reported, computer_number, person, problem) SELECT (id, who_reported, computer_number, person, problem) FROM helpdesk WHERE helpdesk.id =" & Request.Form("id") & ";"

it keeps coming back with this error "Number of query values and destination fields are not the same."

Windows version = WinNT 4.0 Service Pack 6... and I think the SQL driver version is 3.7 or at least that's what I believe it is (reading from the 32-bit ODBC Admin in the control panel.

I haven't had a chance to search this site in depth (yet) so ANY help will be greatly appreciated (even if it's just "Go Here... Read this" help).
"
   

- Advertisement -