Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 5th, 2005, 11:43 AM   #1
fosiul.alam
Newbie
 
Join Date: Aug 2005
Posts: 1
Rep Power: 0 fosiul.alam is on a distinguished road
Help me to solve this problem(sqlserver & visual basic)

I am using sqlserver and vb6
Problem - I made 2 tables in sql server. 1) emp and 2) tmpemp
Some data in emp table :
Id Name address
1 Fosiul Uk
2 Steve Uk
3. Martin uk

Want to make a procedure, which will copy record for ID 1 to table tmpemp.

like , if id = 1 from emp table, copy record to tmpemp table.
and want to execute it from visual basic.
like user will select Id from combo box. and that employee record will shift to tmpemp table.
this is basicaly for reporting purpose.
Can any one help me please.
fosiul.alam is offline   Reply With Quote
Old Aug 5th, 2005, 2:58 PM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
you can do this with a simple SQL statment that gets run from vb.

INSERT tmptable (Id, Name, address)
SELECT Id, Name, address
FROM emp
WHERE Id=1

i haven't tested this, but it should work for you. Give it a try and let me know how it worked for you.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:31 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC