Click to See Complete Forum and Search --> : Stored Proc in SQL server
Sadovod
Jan 31st, 2001, 08:57 AM
Is there a way to dynamically create Stored Procedure in ASP page using ADO for SQL server ?
msdnexpert
Jan 31st, 2001, 12:12 PM
Kindly elaborate the application wherein you want to dynamically create stored procedures?
I meant ASP page using ADO,
say,
connection.execute ("create stored procedure"),
some how to store it in server and than to be able to
execute it from ASP page
Yes, you can do this by executing straight SQL.
Try this:
connConnection.Execute("CREATE PROCEDURE spTest AS" & vbCRLF & "Select field1, field2 from myTable")
This will create a stored procedure called spNew with the following SQL in it:
Select field1, field2 from myTable
When you open the sproc in EM, it looks like this:
CREATE PROCEDURE spTestNew AS
Select field1, field2 from content
GO
You can now execute this sproc as you would execute or use any other sproc.
HtH
Imar
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.