The osql command is awesome! Save your the script for your stored
procedures in a .sql file. Then you can run them by doing
osql -Usa -P<password> -d<database name> -i<filename.sql> -ooutput.log
You can even make a batch file and save it on the server. The output.log
(or whatever file you choose to call it) will save whereever osql is called
unless you specify a path. Then you can see the result of trying to load
the procedures.
Your stored procedure file format should be like
CREATE PROCEDURE A
AS
BEGIN
END
GO
GRANT EXECUTE ON A TO PUBLIC
GO
CREATE PROCEDURE B
AS
BEGIN
END
GO
GRANT EXECUTE ON B TO PUBLIC
GO
<...AND SO ON FOR ALL 50+ procedures....>
If you need to change databases for a procedure do
<stored procedure a script>
GO
USE <database name>
GO
<stored procedure b>
--
*************************************
Andy S.
andy_mcdba (AT) yahoo (DOT) com
*************************************
"Brandon" <barhob (AT) yahoo (DOT) com> wrote
Quote:
I work at a company that does not allow me direct access
the the SQL server via a GUI environment. I need to deploy
50+ stored procedures using a .bat file and I am really
not sure how to even go about this. I am looking into the
OSQL command think this might do it but I am not sure.
Can someone PLEASE help me@!@!
Brandon
barhob (AT) yahoo (DOT) com |