This is a bit off topic for a SQL group but perhaps someone has some
experience with what I am trying to do.
I am going to deployment with dozens of individual object scripts (tables,
procs, etc) . I want to combine all the individual scripts into one large
one so the realease engineer doesn't have to worry about keeping track of
them all.
So basically what I want to do is concatenate all the individual files into
a larger file.
I borrowed some code and patched together a batch file that runs in the
command processor and looks like this:
echo off
chdir C:\Documents and Settings\dave\My Documents\SQL\Deploy
rem Create tables
echo Generate CREATE TABLE SQL script [CreateTables.sql] ...
echo PRINT ' Create tables ...' > CreateTables.sql
cat ./Tables/dbo.table1.tab ./Tables/dbo.table2.tab ./Tables/dbo.table3.tab[vbcol=seagreen]
But this fails on the command "cat" ("'cat' is not recognized as an internal
or external command, operable program or batch file").
Does anyone have any experience with something like this?
How can I concatenate the files through the command line? I can copy them
all to a file but then I have to worry about ordering (or I have to rename
my files).
Thanks for any ideas.
DaveTry the type command is windows (type * > newfilename.sql...)
cat is on unix...
"Dave" <dave@.nospam.ru> wrote in message
news:e4xIXRYJFHA.1176@.TK2MSFTNGP12.phx.gbl...
> This is a bit off topic for a SQL group but perhaps someone has some
> experience with what I am trying to do.
> I am going to deployment with dozens of individual object scripts (tables,
> procs, etc) . I want to combine all the individual scripts into one large
> one so the realease engineer doesn't have to worry about keeping track of
> them all.
> So basically what I want to do is concatenate all the individual files
> into
> a larger file.
> I borrowed some code and patched together a batch file that runs in the
> command processor and looks like this:
> echo off
> chdir C:\Documents and Settings\dave\My Documents\SQL\Deploy
> rem Create tables
> echo Generate CREATE TABLE SQL script [CreateTables.sql] ...
> echo PRINT ' Create tables ...' > CreateTables.sql
> cat ./Tables/dbo.table1.tab ./Tables/dbo.table2.tab
> ./Tables/dbo.table3.tab
>
> But this fails on the command "cat" ("'cat' is not recognized as an
> internal
> or external command, operable program or batch file").
> Does anyone have any experience with something like this?
> How can I concatenate the files through the command line? I can copy them
> all to a file but then I have to worry about ordering (or I have to rename
> my files).
> Thanks for any ideas.
> Dave
>
>|||Thanks but when I change to the followingm I get the error: "The syntax of
the command is incorrect."
type ./Tables/dbo.table1.tab ./Tables/dbo.table2.tab ./Tables/dbo.table3.tab
> CreateTables.sql
Can you be more specific on the syntax
"dfate" <dfate2001-rock@.yahoo.com> wrote in message
news:eqWuHUYJFHA.484@.TK2MSFTNGP15.phx.gbl...
> Try the type command is windows (type * > newfilename.sql...)
> cat is on unix...
> "Dave" <dave@.nospam.ru> wrote in message
> news:e4xIXRYJFHA.1176@.TK2MSFTNGP12.phx.gbl...
(tables,[vbcol=seagreen]
large[vbcol=seagreen]
of[vbcol=seagreen]
them[vbcol=seagreen]
rename[vbcol=seagreen]
>
Friday, February 10, 2012
Concatenating SQL Scripts
Labels:
bit,
concatenating,
database,
deployment,
dozens,
group,
microsoft,
mysql,
oracle,
perhaps,
scripts,
server,
someexperience,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment