Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting via stored procidure

Status
Not open for further replies.

Alira

Programmer
Mar 21, 2001
77
CA
Hi All!
I have to insert a record into sql table from text file...
This is my first attepmt doing it with SQL server and I can do it by executins insert statement in vb code, but!:) I would like to know how to use storproc. By the way, will it be concidered as trigering?
If I will pass variables should I name them the same in storproc and in VB?
Have a great day!:)
 
OK I may be shot down in flames here but.
A trigger is a stored procedure the lies on the server but is only run when something happens on the table upon which it resides (UPDATE, INSERT or DELETE)

The main difference between a VB insert into SQL and a Stored procedure is where they are executed, a VB routine the results are executed on the client and the resultant recordset is the passed to the server, but a stored procedure is executed on the SQL server.
 
I'm no expert at all here, but I'll just mention things I have heard of to get you started: you can look into them yourself in BOL, or someone in this forum will be able to give you more specific advice.

- The T-SQL command BULK Insert.

- Use the 'xp_cmdshell' procedure (from within your SP) to run the BCP command-line utility

- Create a job, and use the sp_start_job procedure (from within your SP) to start and run the job.

No doubt there are other ways, but these are ones that have caught my eye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top