Tuesday, March 20, 2012

automatic script generation

Hi,
Is it possible to automate the 'All tasks - generate
sqlscripts' for tables and stored procs thru SQL
enterprise manager. I want the scripts to be automatically
generated monthly instead of doing manually - pls help.
regards,
bharathbharath,
Make and application that leverages the SQL-DMO libraries.
There are classes which can be used to generate scripts.
You may also use sp_OA* procs instead of a little app,
but I have done so, and I will advise you that
it is an exercise in tedium. Better to make a little app.
See "SQL-DMO" in Books Online.
James Hokes
"bharath" <anonymous@.discussions.microsoft.com> wrote in message
news:62ce01c3e625$7ecfec80$a001280a@.phx.gbl...
quote:

> Hi,
> Is it possible to automate the 'All tasks - generate
> sqlscripts' for tables and stored procs thru SQL
> enterprise manager. I want the scripts to be automatically
> generated monthly instead of doing manually - pls help.
> regards,
> bharath
|||Hi,
JAmes.. thanks a lot.. can u give me an example so that i
understand better (regarding the apps)...
regards,
bharath
quote:

>--Original Message--
>bharath,
>Make and application that leverages the SQL-DMO libraries.
>There are classes which can be used to generate scripts.
>You may also use sp_OA* procs instead of a little app,
>but I have done so, and I will advise you that
>it is an exercise in tedium. Better to make a little app.
>See "SQL-DMO" in Books Online.
>James Hokes
>"bharath" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:62ce01c3e625$7ecfec80$a001280a@.phx.gbl...
automatically[QUOTE]
>
>.
>
|||For sp_OA* variant, you can find a nice script at
http://support.microsoft.com/defaul...b;en-us;233392.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"bharath" <anonymous@.discussions.microsoft.com> wrote in message
news:658a01c3e629$6bd589b0$a401280a@.phx.gbl...[QUOTE]
> Hi,
> JAmes.. thanks a lot.. can u give me an example so that i
> understand better (regarding the apps)...
> regards,
> bharath
>
> message
> automatically|||There is also a nice program to do this that is included in Ken Hendersons
new book "SQL Server Architecture"
Wayne Snyder MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
(Please respond only to the newsgroups.)
I support the Professional Association for SQL Server
(www.sqlpass.org)
"bharath" <anonymous@.discussions.microsoft.com> wrote in message
news:62ce01c3e625$7ecfec80$a001280a@.phx.gbl...
quote:

> Hi,
> Is it possible to automate the 'All tasks - generate
> sqlscripts' for tables and stored procs thru SQL
> enterprise manager. I want the scripts to be automatically
> generated monthly instead of doing manually - pls help.
> regards,
> bharath
|||bharath,
Well, off the top of my head, there's an SQL Server class, and first you
create an instance of that.
Then there's the databases collection off of the Server class, and you drill
down through the object hierarchy to get at the .Script method of the actual
object you're interested in.
There are separate collections for Tables, Views, StoredProcedures, etc.
Anyhow, there are a bizzillion flags you can set, such as whether or not to
include permissions, indexes, triggers, etc.
As I said, all the documentation you'll ever need is in Books Online, so I
can't really give you 'sample code'. I don't even know what language you're
planning to write it in.
James Hokes
"bharath" <anonymous@.discussions.microsoft.com> wrote in message
news:658a01c3e629$6bd589b0$a401280a@.phx.gbl...[QUOTE]
> Hi,
> JAmes.. thanks a lot.. can u give me an example so that i
> understand better (regarding the apps)...
> regards,
> bharath
>
> message
> automatically|||Dejan,
That articles does not mention the sp_OA* variation on this concept.
Looks more like VBA in Microsoft Access.
James Hokes
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:#5FRhuj5DHA.488@.TK2MSFTNGP12.phx.gbl...
quote:

> For sp_OA* variant, you can find a nice script at
> http://support.microsoft.com/defaul...b;en-us;233392.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> Solid Quality Learning
> More than just Training
> www.SolidQualityLearning.com
> "bharath" <anonymous@.discussions.microsoft.com> wrote in message
> news:658a01c3e629$6bd589b0$a401280a@.phx.gbl...
>

No comments:

Post a Comment