Home All Groups Group Topic Archive Search About

Installing stored procedures and functions

Author
1 Sep 2006 2:13 PM
William Sullivan
I can't find much information on creating an install package to add stored
procs and functions to a sql server.  Of particular interest is encrypting
them at installation time.  Any pointers are welcome.  Thanks.

Author
1 Sep 2006 2:40 PM
rocket salad
Basically, you have to script this yourself and run the script during the
installation. You'll need to ask for connection and account information for
an instance of SQL Server during installation and then use those deatails to
execute your create scripts. You can create the scripts through SSMS by right
clicking the database in question and selecting 'create scripts'. Output
these to a file and execute them against a database (after a bit of tweaking
if necessary).

Any data for the database would then need to be inserted after creation.

Thinking about it, you dont actually have to script this, you could compile
an app to do it. The same logic would apply, though.

Hope that helps.

Show quote
"William Sullivan" wrote:

> I can't find much information on creating an install package to add stored
> procs and functions to a sql server.  Of particular interest is encrypting
> them at installation time.  Any pointers are welcome.  Thanks.
Author
1 Sep 2006 2:42 PM
Tracy McKibben
William Sullivan wrote:
> I can't find much information on creating an install package to add stored
> procs and functions to a sql server.  Of particular interest is encrypting
> them at installation time.  Any pointers are welcome.  Thanks.

You don't really "install" them, you simply execute the script
containing the CREATE PROCEDURE or CREATE FUNCTION statements, just as
you do in Query Analyzer.  You'll use something like OSQL or SQLCMD to
execute them.


--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

AddThis Social Bookmark Button