Some examples of the storage process being invoked in ASP. (2)
Source: Internet
Author: User
Writing a Stored Procedure part II
by Nathan Pond
--------------------------------------------------------------------------------
This article is a continuation the my previous article, writing a Stored Procedure
Let me start out by the correcting (or rather updating) something I said in my-I-article. I said there that I wasn ' t aware of the a way to update a stored the procedure without it and deleting it. Now I am. :-) There is a ALTER comand can use as this:
ALTER PROCEDURE Sp_mystoredprocedure
As
......
Go
This would overwrite the stored procedure that being there with the new set of commands, but'll keep permissions, so it is Better than dropping and recreating the procedure. Many to Pedro Vera-perez for e-mailing me with this info.
As promised I am going to dive into the more detail about stored procedures. Let me start off by answering a common question I received via e-mail. Many people wrote asking if it is possible, and if so I to does it, to use stored procedures does to more than select state ments. Absolutely!!! Anything can accomplish in a SQL statement can is accomplished in a stored procedure, simply because a stored pro Cedure can execute SQL statements. Let's look in a simple INSERT example.
CREATE PROCEDURE Sp_myinsert
@FirstName varchar (20),
@LastName varchar (30)
As
INSERT into Names (FirstName, LastName)
VALUES (@FirstName, @LastName)
Go
Now, call this procedure with the parameters and it'll insert a new row into the Names table with the FirstName and last Name columns approiately assigned. And is a example of how to call this procedure with parameters from ASP page:
<%
Dim DataConn, sSQL
Dim FirstName, LastName
FirstName = "Nathan"
LastName = "Pond"
Set DataConn = Server.CreateObject ("ADODB. Connection ")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service