|
-
Nov 4th, 2005, 10:21 PM
#1
Thread Starter
Addicted Member
Stored Procedure
I have one stored procedure in MS SQL Server.
sp_DeleteEmployee @id INT
I can call this stored procedure by two way.
One is:
VB Code:
cnn.Execute "sp_DeleteEmployee " & txtID.Text
The other used Command Objcet and Parameter, then execute the Command Object.
Which one is better? why?
-
Nov 5th, 2005, 08:58 AM
#2
Re: Stored Procedure
This was just discussed yesterday in this thread...
http://www.vbforums.com/showthread.php?t=369262
-
Nov 5th, 2005, 11:42 AM
#3
Re: Stored Procedure
And please don't name your stored procedures with an sp_ prefix.
-
Nov 6th, 2005, 11:26 PM
#4
Thread Starter
Addicted Member
Re: Stored Procedure
Why shouldn't I name your stored procedures with an sp_ prefix?
-
Nov 7th, 2005, 01:58 AM
#5
Re: Stored Procedure
SQL Server assumes a stored procedure with a sp_ prefix is a system stored procedure. The Master database is checked first and if the procedure exists there it will be executed. If not then the procedure in the current database is executed.
-
Nov 7th, 2005, 07:10 AM
#6
Re: Stored Procedure
 Originally Posted by ychhuong
Why shouldn't I name your stored procedures with an sp_ prefix?
You can name my SPs whatever you want, I was just giving you some advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|