Re: about automation tool



Thanx for your previous reply, its very useful , but i need a tool for
this process .if you know any such type of tool please reply me as soon as
possible.

Can you elaborate on your requirements?

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Gautam" <Gautam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:78274903-9DBB-4332-808F-5DBF766C6135@xxxxxxxxxxxxxxxx
Hi,
I am using sqlserver2005
Thanx for your previous reply, its very useful , but i need a tool for
this process .if you know any such type of tool please reply me as soon as
possible.


"Dan Guzman" wrote:

> hi, my self gautam , i am a DBA . Is there any automation tool which is
> usefil for running all batch file?

Windows includes a FOR command that can be used to iterate over a list of
files and execute a command for each. For example:

FOR %%f IN (Tables\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (PrimaryKeys\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (ForeignKeys\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (UniqueConstraints\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (Indexes\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (Views\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"
FOR %%f IN (StoredProcedures\*.sql) DO SQLCMD -E -S MyServer -E -I -i "%%f"

This method works best when you have one script per object type and don't
need to control the execution order. In cases where you have hard
dependencies (e.g. view that references other view), you'll need to make
sure scripts run in the correct order. This can be accomplished with a
number of techniques, such as individual SQLCMD commands or using ":r"
within a SQLCMD file to specify the external scripts in the desired order.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Gautam" <Gautam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:16EC7068-D3C8-4F08-A0ED-71AA8171C932@xxxxxxxxxxxxxxxx
> hi, my self gautam , i am a DBA . Is there any automation tool which is
> usefil for running all batch file? Means, Suppose in a database there > are
> more than 350 table , 25 procedure and 25 functions are present in a
> database .i maintain total around 400 scripts in individual. But when > we
> create a new database we will run each single script so, its take so > much
> time .. so i want a automation or other tool which is useful for > running
> all scripts in one time ?


.



Relevant Pages

  • Re: Generic Script Resource
    ... The "/k" switch prevents CMD from exiting thus the resource's process ... does not "terminate" causing the failed state. ... >> Now the batch file DOES run and enables ABE. ... >>> as generic applications and .vbs scripts are clustered as generic ...
    (microsoft.public.windows.server.clustering)
  • Use Group Policy to assign computer startup scripts for 2007 Office deployment
    ... TechNet article to accomplish it using startup scripts, ... It is supposed to run the batch file listed in the ... article from Computer Configuration Windows Settings Scripts Shutdown. ... XP machines. ...
    (microsoft.public.windows.group_policy)
  • Re: UNC Path to local host
    ... Another possibility may be to use the Environment Variable called ComputerName - e.g. ... the localhost entry does for URL paths? ... machine at the beginning of the path to run some scripts - i.e. ... an option for this particular script, and editing each batch file to point to ...
    (microsoft.public.windows.server.general)
  • Re: Login Script Trouble
    ... I figured this one out with regards to why the batch file didn't ... inherit the permissions from the scripts folder. ...
    (microsoft.public.windows.server.general)
  • Re: assigning DB-user to server role
    ... scripts are a lot easier to post here that the GUI steps. ... >> You should be able to grant object permissions to the roles only. ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.security)