Wednesday, March 28, 2012
Running a SSRS report in a report viewer control in .net
The ReportViewer supports local mode where the report definition is distributed with the application and the application feeds the report with data. In local mode, the Report Server is not needed. More details here.sql
Running a SSRS report in a report viewer control in .net
The ReportViewer supports local mode where the report definition is distributed with the application and the application feeds the report with data. In local mode, the Report Server is not needed. More details here.
Monday, March 12, 2012
Run Query on database on a different server
Both servers are SQL2000 SP4 standard.No if you use OPENDATASOURCE
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_2be1.asp
Having the link server is more convenient is you will be pulling data on a
regular basis.
"WANNABE" wrote:
> Must I have a linked server in order to pull data from another SQL server '
> Both servers are SQL2000 SP4 standard.
>
>|||Thanks, that was what I was looking for...
What are some issues regarding Linked server, that need to be considered
before implementing Linked servers '
======================================================"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
<EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.microsoft.com> wrote in message
news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...
> No if you use OPENDATASOURCE
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_2be1.asp
> Having the link server is more convenient is you will be pulling data on a
> regular basis.
>
> "WANNABE" wrote:
>> Must I have a linked server in order to pull data from another SQL server
>> '
>> Both servers are SQL2000 SP4 standard.
>>|||Implementing linked servers is very straightforward. There are some gotchas,
like collation compatibility, etc. but, as long as the connectivity is there,
it offers an easy way to access data from one server to another
http://www.microsoft.com/technet/prodtechnol/sql/2000/books/c08ppcsq.mspx
http://msdn2.microsoft.com/en-us/library/ms188279.aspx
"WANNABE" wrote:
> Thanks, that was what I was looking for...
> What are some issues regarding Linked server, that need to be considered
> before implementing Linked servers '
> ======================================================> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
> <EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.microsoft.com> wrote in message
> news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...
> > No if you use OPENDATASOURCE
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_2be1.asp
> >
> > Having the link server is more convenient is you will be pulling data on a
> > regular basis.
> >
> >
> > "WANNABE" wrote:
> >
> >> Must I have a linked server in order to pull data from another SQL server
> >> '
> >> Both servers are SQL2000 SP4 standard.
> >>
> >>
> >>
>
>
Run Query on database on a different server
Both servers are SQL2000 SP4 standard.
No if you use OPENDATASOURCE
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_2be1.asp
Having the link server is more convenient is you will be pulling data on a
regular basis.
"WANNABE" wrote:
> Must I have a linked server in order to pull data from another SQL server ?
> Both servers are SQL2000 SP4 standard.
>
>
|||Thanks, that was what I was looking for...
What are some issues regarding Linked server, that need to be considered
before implementing Linked servers ?
================================================== ====
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
<EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.micro soft.com> wrote in message
news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...[vbcol=seagreen]
> No if you use OPENDATASOURCE
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_2be1.asp
> Having the link server is more convenient is you will be pulling data on a
> regular basis.
>
> "WANNABE" wrote:
|||Implementing linked servers is very straightforward. There are some gotchas,
like collation compatibility, etc. but, as long as the connectivity is there,
it offers an easy way to access data from one server to another
http://www.microsoft.com/technet/prodtechnol/sql/2000/books/c08ppcsq.mspx
http://msdn2.microsoft.com/en-us/library/ms188279.aspx
"WANNABE" wrote:
> Thanks, that was what I was looking for...
> What are some issues regarding Linked server, that need to be considered
> before implementing Linked servers ?
> ================================================== ====
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
> <EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.micro soft.com> wrote in message
> news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...
>
>
Run Query on database on a different server
Both servers are SQL2000 SP4 standard.No if you use OPENDATASOURCE
http://msdn.microsoft.com/library/d...br />
2be1.asp
Having the link server is more convenient is you will be pulling data on a
regular basis.
"WANNABE" wrote:
> Must I have a linked server in order to pull data from another SQL server
'
> Both servers are SQL2000 SP4 standard.
>
>|||Thanks, that was what I was looking for...
What are some issues regarding Linked server, that need to be considered
before implementing Linked servers '
========================================
==============
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
< EdgardoValdezMCTSMCITPMCSDMCDBA@.discussi
ons.microsoft.com> wrote in message
news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...[vbcol=seagreen]
> No if you use OPENDATASOURCE
> http://msdn.microsoft.com/library/d... />
z_2be1.asp
> Having the link server is more convenient is you will be pulling data on a
> regular basis.
>
> "WANNABE" wrote:
>|||Implementing linked servers is very straightforward. There are some gotchas,
like collation compatibility, etc. but, as long as the connectivity is there
,
it offers an easy way to access data from one server to another
http://www.microsoft.com/technet/pr...s/c08ppcsq.mspx
http://msdn2.microsoft.com/en-us/library/ms188279.aspx
"WANNABE" wrote:
> Thanks, that was what I was looking for...
> What are some issues regarding Linked server, that need to be considered
> before implementing Linked servers '
> ========================================
==============
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
> < EdgardoValdezMCTSMCITPMCSDMCDBA@.discussi
ons.microsoft.com> wrote in messa
ge
> news:4E58387B-10BF-42D5-8C61-55EC4E3C1D70@.microsoft.com...
>
>
Run Multiple Stored Procedures in order with a script?
scripts to run. The scripts always come in a folder numbered in the order
they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
I've been running them all manaully one by one so that I can look for errors
in the results. I'd love to be able to point a batch file to the folder
with all the scripts, have them run one by one, and have the results output
in one file with:
Results.txt:
001 - ScriptA.sql
Command Completed Successfully
002 - ScriptB.sql
Command Completed Successfully
003 - ScriptC.sql
Error in line 1...etc
004 - ScriptD.sql
Command Completed Successfully
etc.
I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
However, this is often causes problems as sometimes the end of one script
will join directly to the start of the first script making statements that
don't exist (EndscriptGo).. two statements joint into one. Or other times
scripts will be left out for some reason. Piping has caused many problems
and isn't trusted anymore.
I tried using osql
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
g
but I don't know how to run scripts 001 through say 108 in order, or how to
have them output into one file.
Is there a way to use this or something else (like run 001*.sql, then run
001+1*.sql [I have no idea how to program!) so that I can just point it to
the folder with the numbered scripts and have them run one by one in order?
Any help is REALLY REALLY appreciated!!!!
Thank you
Why not put the names of the scripts in a table and loop thru with a cursor
and call oSql one script at a time?
Andrew J. Kelly SQL MVP
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
> errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
> output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
> to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
> order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Okay, that is way over my head!
I would have to create a new DB for it because I can't add a new table to
the live DB.
If I tried adding all the script names to a table wouldn't I have to type
all the names of the scritps in the table? If there's a way to automate
that I could try it, but it sounds like it could end up being as manual a
process as running them one by one.
What do you think?
Thanks
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeJdMvA0EHA.3908@.TK2MSFTNGP12.phx.gbl...
> Why not put the names of the scripts in a table and loop thru with a
cursor[vbcol=seagreen]
> and call oSql one script at a time?
> --
> Andrew J. Kelly SQL MVP
>
> "Tom" <none@.none.com> wrote in message
> news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
100+[vbcol=seagreen]
order[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
run[vbcol=seagreen]
to
>
|||See
http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
It will execute a proc for each file in a directory in order of the file name.
Create a proc which takes two parameters, file path and file name and
executes a osql command to run that file with output to a file.
Set @.ProcSp to be this proc and you are done.
"Tom" wrote:
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Awesome, I'll check it out!
Thanks so much Nigel!
Tom
"Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> See
> http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
> It will execute a proc for each file in a directory in order of the file
name.[vbcol=seagreen]
> Create a proc which takes two parameters, file path and file name and
> executes a osql command to run that file with output to a file.
> Set @.ProcSp to be this proc and you are done.
>
> "Tom" wrote:
100+[vbcol=seagreen]
order[vbcol=seagreen]
errors[vbcol=seagreen]
output[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
to[vbcol=seagreen]
run[vbcol=seagreen]
to[vbcol=seagreen]
order?[vbcol=seagreen]
|||Nigel, is there an output file in this?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Nigel,
How do I create the @.procSP and what exactly do I put in it in this case?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Tom wrote:
> but it sounds like it could end up
> being as manual a process as running them one by one.
> What do you think?
Yes, but only the first time...
David Gugick
Imceda Software
www.imceda.com
|||Consider this:
1. Create a text file with the .sql files listed one per line.
2. Create a command/batch file to submit each to osql.exe
3. Have osql send results to the screen, but instead redirect results to a
logfile
For example:
text.txt contents
sqlscript1.sql
sqlscript2.sql
sqlscript3.sql
sqlcommand.cmd contents
for /F %%i IN (text.txt) DO osql -Usa -Ppass -Sdb123 -i%%i >> logfile.txt
So, for each file in text.txt, submit the osql script file and redirect to
logfile.
Check out Windows Help on the For command, it's quite handy. I suggest using
the text.txt file so you can edit which scripts run and in which order, in
case your numeric sequence needs to be reordered.
Larry
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
Run Multiple Stored Procedures in order with a script?
scripts to run. The scripts always come in a folder numbered in the order
they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
I've been running them all manaully one by one so that I can look for errors
in the results. I'd love to be able to point a batch file to the folder
with all the scripts, have them run one by one, and have the results output
in one file with:
Results.txt:
001 - ScriptA.sql
Command Completed Successfully
002 - ScriptB.sql
Command Completed Successfully
003 - ScriptC.sql
Error in line 1...etc
004 - ScriptD.sql
Command Completed Successfully
etc.
I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
However, this is often causes problems as sometimes the end of one script
will join directly to the start of the first script making statements that
don't exist (EndscriptGo).. two statements joint into one. Or other times
scripts will be left out for some reason. Piping has caused many problems
and isn't trusted anymore.
I tried using osql
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
g
but I don't know how to run scripts 001 through say 108 in order, or how to
have them output into one file.
Is there a way to use this or something else (like run 001*.sql, then run
001+1*.sql [I have no idea how to program!) so that I can just point it to
the folder with the numbered scripts and have them run one by one in order?
Any help is REALLY REALLY appreciated!!!!
Thank you
Why not put the names of the scripts in a table and loop thru with a cursor
and call oSql one script at a time?
Andrew J. Kelly SQL MVP
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
> errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
> output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
> to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
> order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Okay, that is way over my head!
I would have to create a new DB for it because I can't add a new table to
the live DB.
If I tried adding all the script names to a table wouldn't I have to type
all the names of the scritps in the table? If there's a way to automate
that I could try it, but it sounds like it could end up being as manual a
process as running them one by one.
What do you think?
Thanks
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeJdMvA0EHA.3908@.TK2MSFTNGP12.phx.gbl...
> Why not put the names of the scripts in a table and loop thru with a
cursor[vbcol=seagreen]
> and call oSql one script at a time?
> --
> Andrew J. Kelly SQL MVP
>
> "Tom" <none@.none.com> wrote in message
> news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
100+[vbcol=seagreen]
order[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
run[vbcol=seagreen]
to
>
|||See
http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
It will execute a proc for each file in a directory in order of the file name.
Create a proc which takes two parameters, file path and file name and
executes a osql command to run that file with output to a file.
Set @.ProcSp to be this proc and you are done.
"Tom" wrote:
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Awesome, I'll check it out!
Thanks so much Nigel!
Tom
"Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> See
> http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
> It will execute a proc for each file in a directory in order of the file
name.[vbcol=seagreen]
> Create a proc which takes two parameters, file path and file name and
> executes a osql command to run that file with output to a file.
> Set @.ProcSp to be this proc and you are done.
>
> "Tom" wrote:
100+[vbcol=seagreen]
order[vbcol=seagreen]
errors[vbcol=seagreen]
output[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
to[vbcol=seagreen]
run[vbcol=seagreen]
to[vbcol=seagreen]
order?[vbcol=seagreen]
|||Nigel, is there an output file in this?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Nigel,
How do I create the @.procSP and what exactly do I put in it in this case?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Tom wrote:
> but it sounds like it could end up
> being as manual a process as running them one by one.
> What do you think?
Yes, but only the first time...
David Gugick
Imceda Software
www.imceda.com
|||Consider this:
1. Create a text file with the .sql files listed one per line.
2. Create a command/batch file to submit each to osql.exe
3. Have osql send results to the screen, but instead redirect results to a
logfile
For example:
text.txt contents
sqlscript1.sql
sqlscript2.sql
sqlscript3.sql
sqlcommand.cmd contents
for /F %%i IN (text.txt) DO osql -Usa -Ppass -Sdb123 -i%%i >> logfile.txt
So, for each file in text.txt, submit the osql script file and redirect to
logfile.
Check out Windows Help on the For command, it's quite handy. I suggest using
the text.txt file so you can edit which scripts run and in which order, in
case your numeric sequence needs to be reordered.
Larry
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
Run Multiple Stored Procedures in order with a script?
scripts to run. The scripts always come in a folder numbered in the order
they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
I've been running them all manaully one by one so that I can look for errors
in the results. I'd love to be able to point a batch file to the folder
with all the scripts, have them run one by one, and have the results output
in one file with:
Results.txt:
001 - ScriptA.sql
Command Completed Successfully
002 - ScriptB.sql
Command Completed Successfully
003 - ScriptC.sql
Error in line 1...etc
004 - ScriptD.sql
Command Completed Successfully
etc.
I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
However, this is often causes problems as sometimes the end of one script
will join directly to the start of the first script making statements that
don't exist (EndscriptGo).. two statements joint into one. Or other times
scripts will be left out for some reason. Piping has caused many problems
and isn't trusted anymore.
I tried using osql
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
g
but I don't know how to run scripts 001 through say 108 in order, or how to
have them output into one file.
Is there a way to use this or something else (like run 001*.sql, then run
001+1*.sql [I have no idea how to program!) so that I can just point it to
the folder with the numbered scripts and have them run one by one in order?
Any help is REALLY REALLY appreciated!!!!
Thank you
Why not put the names of the scripts in a table and loop thru with a cursor
and call oSql one script at a time?
Andrew J. Kelly SQL MVP
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
> errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
> output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
> to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
> order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Okay, that is way over my head!
I would have to create a new DB for it because I can't add a new table to
the live DB.
If I tried adding all the script names to a table wouldn't I have to type
all the names of the scritps in the table? If there's a way to automate
that I could try it, but it sounds like it could end up being as manual a
process as running them one by one.
What do you think?
Thanks
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeJdMvA0EHA.3908@.TK2MSFTNGP12.phx.gbl...
> Why not put the names of the scripts in a table and loop thru with a
cursor[vbcol=seagreen]
> and call oSql one script at a time?
> --
> Andrew J. Kelly SQL MVP
>
> "Tom" <none@.none.com> wrote in message
> news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
100+[vbcol=seagreen]
order[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
run[vbcol=seagreen]
to
>
|||See
http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
It will execute a proc for each file in a directory in order of the file name.
Create a proc which takes two parameters, file path and file name and
executes a osql command to run that file with output to a file.
Set @.ProcSp to be this proc and you are done.
"Tom" wrote:
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Awesome, I'll check it out!
Thanks so much Nigel!
Tom
"Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> See
> http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
> It will execute a proc for each file in a directory in order of the file
name.[vbcol=seagreen]
> Create a proc which takes two parameters, file path and file name and
> executes a osql command to run that file with output to a file.
> Set @.ProcSp to be this proc and you are done.
>
> "Tom" wrote:
100+[vbcol=seagreen]
order[vbcol=seagreen]
errors[vbcol=seagreen]
output[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
to[vbcol=seagreen]
run[vbcol=seagreen]
to[vbcol=seagreen]
order?[vbcol=seagreen]
|||Nigel, is there an output file in this?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Nigel,
How do I create the @.procSP and what exactly do I put in it in this case?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
how[vbcol=seagreen]
> to
> run
it
> to
> order?
>
|||Tom wrote:
> but it sounds like it could end up
> being as manual a process as running them one by one.
> What do you think?
Yes, but only the first time...
David Gugick
Imceda Software
www.imceda.com
|||Consider this:
1. Create a text file with the .sql files listed one per line.
2. Create a command/batch file to submit each to osql.exe
3. Have osql send results to the screen, but instead redirect results to a
logfile
For example:
text.txt contents
sqlscript1.sql
sqlscript2.sql
sqlscript3.sql
sqlcommand.cmd contents
for /F %%i IN (text.txt) DO osql -Usa -Ppass -Sdb123 -i%%i >> logfile.txt
So, for each file in text.txt, submit the osql script file and redirect to
logfile.
Check out Windows Help on the For command, it's quite handy. I suggest using
the text.txt file so you can edit which scripts run and in which order, in
case your numeric sequence needs to be reordered.
Larry
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point it to
> the folder with the numbered scripts and have them run one by one in
order?
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
|||Have you thought about using DTS?. The Active-X filesystem
object would help you figure out the file names and I'm
sure DTS would help you setup a loop to execute your
programs.
Vinay
vinaydottoomuatschwabptdotcom
>--Original Message--
>Tom wrote:
>Yes, but only the first time...
>--
>David Gugick
>Imceda Software
>www.imceda.com
>.
>
Run Multiple Stored Procedures in order with a script?
scripts to run. The scripts always come in a folder numbered in the order
they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
I've been running them all manaully one by one so that I can look for errors
in the results. I'd love to be able to point a batch file to the folder
with all the scripts, have them run one by one, and have the results output
in one file with:
Results.txt:
001 - ScriptA.sql
Command Completed Successfully
--
002 - ScriptB.sql
Command Completed Successfully
--
003 - ScriptC.sql
Error in line 1...etc
--
004 - ScriptD.sql
Command Completed Successfully
--
etc.
I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
However, this is often causes problems as sometimes the end of one script
will join directly to the start of the first script making statements that
don't exist (EndscriptGo).. two statements joint into one. Or other times
scripts will be left out for some reason. Piping has caused many problems
and isn't trusted anymore.
I tried using osql
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
g
but I don't know how to run scripts 001 through say 108 in order, or how to
have them output into one file.
Is there a way to use this or something else (like run 001*.sql, then run
001+1*.sql [I have no idea how to program!) so that I can just point it
to
the folder with the numbered scripts and have them run one by one in order'
Any help is REALLY REALLY appreciated!!!!
Thank youWhy not put the names of the scripts in a table and loop thru with a cursor
and call oSql one script at a time?
Andrew J. Kelly SQL MVP
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
> errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
> output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.
lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
> to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point i
t to
> the folder with the numbered scripts and have them run one by one in
> order'
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>|||Okay, that is way over my head!
I would have to create a new DB for it because I can't add a new table to
the live DB.
If I tried adding all the script names to a table wouldn't I have to type
all the names of the scritps in the table? If there's a way to automate
that I could try it, but it sounds like it could end up being as manual a
process as running them one by one.
What do you think?
Thanks
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeJdMvA0EHA.3908@.TK2MSFTNGP12.phx.gbl...
> Why not put the names of the scripts in a table and loop thru with a
cursor
> and call oSql one script at a time?
> --
> Andrew J. Kelly SQL MVP
>
> "Tom" <none@.none.com> wrote in message
> news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
100+[vbcol=seagreen]
order[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
run[vbcol=seagreen]
to[vbcol=seagreen]
>|||See
http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
It will execute a proc for each file in a directory in order of the file nam
e.
Create a proc which takes two parameters, file path and file name and
executes a osql command to run that file with output to a file.
Set @.ProcSp to be this proc and you are done.
"Tom" wrote:
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for erro
rs
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results outpu
t
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
> OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.
lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how t
o
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point i
t to
> the folder with the numbered scripts and have them run one by one in order
'
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>|||Awesome, I'll check it out!
Thanks so much Nigel!
Tom
"Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> See
> http://www.nigelrivett.net/s_ProcessAllFilesInDir.html
> It will execute a proc for each file in a directory in order of the file
name.[vbcol=seagreen]
> Create a proc which takes two parameters, file path and file name and
> executes a osql command to run that file with output to a file.
> Set @.ProcSp to be this proc and you are done.
>
> "Tom" wrote:
>
100+[vbcol=seagreen]
order[vbcol=seagreen]
errors[vbcol=seagreen]
output[vbcol=seagreen]
script[vbcol=seagreen]
that[vbcol=seagreen]
times[vbcol=seagreen]
problems[vbcol=seagreen]
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo[vbcol=seagreen]
to[vbcol=seagreen]
run[vbcol=seagreen]
to[vbcol=seagreen]
order'[vbcol=seagreen]|||Nigel, is there an output file in this?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder[vbcol=seagreen]
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
how[vbcol=seagreen]
> to
> run
it[vbcol=seagreen]
> to
> order'
>|||Nigel,
How do I create the @.procSP and what exactly do I put in it in this case?
Thanks,
Tom
"Tom" <none@.none.com> wrote in message
news:uJKqlyC0EHA.2600@.TK2MSFTNGP09.phx.gbl...
> Awesome, I'll check it out!
> Thanks so much Nigel!
>
> Tom
> "Nigel Rivett" <sqlnr@.hotmail.com> wrote in message
> news:3FD23957-DF3C-4EEB-9987-869B69B6C195@.microsoft.com...
> name.
> 100+
> order
> errors
folder[vbcol=seagreen]
> output
> script
> that
> times
> problems
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
how[vbcol=seagreen]
> to
> run
it[vbcol=seagreen]
> to
> order'
>|||Tom wrote:
> but it sounds like it could end up
> being as manual a process as running them one by one.
> What do you think?
Yes, but only the first time...
David Gugick
Imceda Software
www.imceda.com|||Consider this:
1. Create a text file with the .sql files listed one per line.
2. Create a command/batch file to submit each to osql.exe
3. Have osql send results to the screen, but instead redirect results to a
logfile
For example:
text.txt contents
--
sqlscript1.sql
sqlscript2.sql
sqlscript3.sql
sqlcommand.cmd contents
--
for /F %%i IN (text.txt) DO osql -Usa -Ppass -Sdb123 -i%%i >> logfile.txt
So, for each file in text.txt, submit the osql script file and redirect to
logfile.
Check out Windows Help on the For command, it's quite handy. I suggest using
the text.txt file so you can edit which scripts run and in which order, in
case your numeric sequence needs to be reordered.
Larry
"Tom" <none@.none.com> wrote in message
news:eDGJSmA0EHA.4028@.TK2MSFTNGP15.phx.gbl...
> Hello. I have to run many sql scripts each day. Sometimes I'll have 100+
> scripts to run. The scripts always come in a folder numbered in the order
> they need to be run (001 - ScriptA, 002 - ScriptB, etc.).
> I've been running them all manaully one by one so that I can look for
errors
> in the results. I'd love to be able to point a batch file to the folder
> with all the scripts, have them run one by one, and have the results
output
> in one file with:
> Results.txt:
> 001 - ScriptA.sql
> Command Completed Successfully
> --
> 002 - ScriptB.sql
> Command Completed Successfully
> --
> 003 - ScriptC.sql
> Error in line 1...etc
> --
> 004 - ScriptD.sql
> Command Completed Successfully
> --
> etc.
>
> I have tried piping them using c:\Scipts\*.sql > c:\AllScripts.sql
> However, this is often causes problems as sometimes the end of one script
> will join directly to the start of the first script making statements that
> don't exist (EndscriptGo).. two statements joint into one. Or other times
> scripts will be left out for some reason. Piping has caused many problems
> and isn't trusted anymore.
> I tried using osql
>
OSQL -Usa -Ppass -Sdb123 -iC:\scripts\001scriptA.sql -oC:\logs\001scriptA.lo
> g
> but I don't know how to run scripts 001 through say 108 in order, or how
to
> have them output into one file.
> Is there a way to use this or something else (like run 001*.sql, then run
> 001+1*.sql [I have no idea how to program!) so that I can just point i
t to
> the folder with the numbered scripts and have them run one by one in
order'
>
> Any help is REALLY REALLY appreciated!!!!
>
> Thank you
>
>
Run multiple SSIS packages in order
I built 3 diffrent packages and i want to be executed in order. The first one is exporting some tables to another database and the other two packages are based on the database built in the first package.
Any suggestions?
Thank you in advance:)
I assume you wish to automate this process. The simplest option would be to create a SQL Server Agent job, and just have three steps within the job, one for each package.
A more SSIS orientated approach would be to use a master package, that has three execute package tasks, one for each of your existing packages. Link the Execute package Tasks together with workflow constraints to enforce the order of execution for the tasks and hence the packages.
|||Darren,
Just a question: when we're talking about the maximum number of DTSX inside a DTSPROJ only limitation is the memory?
TIA
|||Yes.
If you do have a lot then I'd be tempted to write a more dynamic process.
Perhaps use a SQL table to contain the list of packages, and also have a column for the order. You could then use the Exec SQL Task with simple SELECT query to extract the list of packages in order of execution. You could store this results in a variable, and then loop and shred this via the For Each Loop.
This example uses Data Flow task to get the result set into a variable, but I normally find an Exec SQL Task easier. It does show the shredding of the results via the loop though.
Shredding a Recordset
(http://www.sqlis.com/default.aspx?59)
|||I used the SQL Server Agent Job.
thanks for the help :)
Saturday, February 25, 2012
RTM install order with VS2005 ?
Also, are there any issues/gotchas with installing SQL 2005 Developer edition and SQL 2005 Express from the VS2005 RTM on the same machine ?
During the betas, there were all sorts of hoops you had to jump through, and do things in certain orders, but with RTM will the standard installs of SQL 2005 Developer, VS 2005 and SQL 2005 Express all work regardless of install order ?
Thanks,
Andy Mackie.Order shouldn't matter at all any more, nor should there be any gotchas with the SxS scenario you describe.|||It shouldn't matter, but I stuck with the MS recommendations of VS2005 first - using a custom install so it did not install SQL Express - then SQL 2005 all up.
No problems at all
HTH,
Richard
|||Hello Richard,
I was wondering if you or anyone has had success installing VS2005 first, including Express Edition of SQL Server, and then installing the whole SQL Server on top of that. It seems to have problems installing the management tools - notably SQL Server Managemetn Studio - when I do it in that order.
What I'm really asking is if it's possible to install SSMS if you already have SQL Express 2005 installed?|||
Hi Robert,
I installed VS2005, but explicitly excluded SQL Express edition. I then did a full install of SQL Server 2005.
In theory I don't see why you should not be able to install JUST the client tools onto your machine, using the SQL server disks. I did an install a while back with no client tools on the server, then realised I needed to add them in. I was able to add them in OK.
I have a feeling that VS2005 puts it's own set of client tools on when you put Enterprise edition on, which may give you problems. Presumably you can Uninstall the EE components using the VS2005 disks, then put on SQL server?
Hope this helps,
Richard
RTM install order with VS2005 ?
Also, are there any issues/gotchas with installing SQL 2005 Developer edition and SQL 2005 Express from the VS2005 RTM on the same machine ?
During the betas, there were all sorts of hoops you had to jump through, and do things in certain orders, but with RTM will the standard installs of SQL 2005 Developer, VS 2005 and SQL 2005 Express all work regardless of install order ?
Thanks,
Andy Mackie.Order shouldn't matter at all any more, nor should there be any gotchas with the SxS scenario you describe.|||It shouldn't matter, but I stuck with the MS recommendations of VS2005 first - using a custom install so it did not install SQL Express - then SQL 2005 all up.
No problems at all
HTH,
Richard
|||Hello Richard,
I was wondering if you or anyone has had success installing VS2005 first, including Express Edition of SQL Server, and then installing the whole SQL Server on top of that. It seems to have problems installing the management tools - notably SQL Server Managemetn Studio - when I do it in that order.
What I'm really asking is if it's possible to install SSMS if you already have SQL Express 2005 installed?|||
Hi Robert,
I installed VS2005, but explicitly excluded SQL Express edition. I then did a full install of SQL Server 2005.
In theory I don't see why you should not be able to install JUST the client tools onto your machine, using the SQL server disks. I did an install a while back with no client tools on the server, then realised I needed to add them in. I was able to add them in OK.
I have a feeling that VS2005 puts it's own set of client tools on when you put Enterprise edition on, which may give you problems. Presumably you can Uninstall the EE components using the VS2005 disks, then put on SQL server?
Hope this helps,
Richard
Tuesday, February 21, 2012
RTM install order with VS2005 ?
Also, are there any issues/gotchas with installing SQL 2005 Developer edition and SQL 2005 Express from the VS2005 RTM on the same machine ?
During the betas, there were all sorts of hoops you had to jump through, and do things in certain orders, but with RTM will the standard installs of SQL 2005 Developer, VS 2005 and SQL 2005 Express all work regardless of install order ?
Thanks,
Andy Mackie.Order shouldn't matter at all any more, nor should there be any gotchas with the SxS scenario you describe.|||It shouldn't matter, but I stuck with the MS recommendations of VS2005 first - using a custom install so it did not install SQL Express - then SQL 2005 all up.
No problems at all
HTH,
Richard
|||Hello Richard,
I was wondering if you or anyone has had success installing VS2005 first, including Express Edition of SQL Server, and then installing the whole SQL Server on top of that. It seems to have problems installing the management tools - notably SQL Server Managemetn Studio - when I do it in that order.
What I'm really asking is if it's possible to install SSMS if you already have SQL Express 2005 installed?|||
Hi Robert,
I installed VS2005, but explicitly excluded SQL Express edition. I then did a full install of SQL Server 2005.
In theory I don't see why you should not be able to install JUST the client tools onto your machine, using the SQL server disks. I did an install a while back with no client tools on the server, then realised I needed to add them in. I was able to add them in OK.
I have a feeling that VS2005 puts it's own set of client tools on when you put Enterprise edition on, which may give you problems. Presumably you can Uninstall the EE components using the VS2005 disks, then put on SQL server?
Hope this helps,
Richard