Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Monday, March 12, 2012

Script Help

Would really appreciate some help/ideas. The stored procedures for my
application are all saved to a folder in the file system of my deeloper work
station. What is the best way to loop through the folder and execute the sql
(create procedure...)in each file?
Thanks for any tipsOne method is to run your scripts with a FOR command from the command-prompt
that invokes OSQL. For example:
FOR %f IN (*.SQL) DO OSQL -i "%f" /E /S MyServer
Hope this helps.
Dan Guzman
SQL Server MVP
"Mardy" <Mardy@.discussions.microsoft.com> wrote in message
news:F9E35C8D-A44A-484A-A63B-D3571A908AF8@.microsoft.com...
> Would really appreciate some help/ideas. The stored procedures for my
> application are all saved to a folder in the file system of my deeloper
> work
> station. What is the best way to loop through the folder and execute the
> sql
> (create procedure...)in each file?
> Thanks for any tips|||FYI, I generally just copy all of the procedures to one file and run that:
COPY *.* SP.sql
But this will only work if you have a GO statement at the bottom of each.
"Dan Guzman" wrote:

> One method is to run your scripts with a FOR command from the command-prom
pt
> that invokes OSQL. For example:
> FOR %f IN (*.SQL) DO OSQL -i "%f" /E /S MyServer
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Mardy" <Mardy@.discussions.microsoft.com> wrote in message
> news:F9E35C8D-A44A-484A-A63B-D3571A908AF8@.microsoft.com...
>
>

Script for moving a file to a different folder

Hi All,
Is there a script(.rss file) that can move a .rdl file to a different folder
than the one in which it is in.
eg. Assume File is on The "Reports" folder in the Report Server. Now I wish
to move it into the "Reports\Vehicles" folder. Is there a script that can
facilitate this rather than doing it manually.
Regards
SanjeevIt could be done easily using MoveItem call.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sanjeev" <sanjeev@.microsoft.com> wrote in message
news:O%23ATGnbtEHA.2804@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> Is there a script(.rss file) that can move a .rdl file to a different
> folder than the one in which it is in.
> eg. Assume File is on The "Reports" folder in the Report Server. Now I
> wish to move it into the "Reports\Vehicles" folder. Is there a script that
> can facilitate this rather than doing it manually.
> Regards
> Sanjeev
>|||Thanks. That worked perfectly.
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:OBwnvZmtEHA.2600@.TK2MSFTNGP10.phx.gbl...
> It could be done easily using MoveItem call.
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Sanjeev" <sanjeev@.microsoft.com> wrote in message
> news:O%23ATGnbtEHA.2804@.TK2MSFTNGP14.phx.gbl...
>> Hi All,
>> Is there a script(.rss file) that can move a .rdl file to a different
>> folder than the one in which it is in.
>> eg. Assume File is on The "Reports" folder in the Report Server. Now I
>> wish to move it into the "Reports\Vehicles" folder. Is there a script
>> that can facilitate this rather than doing it manually.
>> Regards
>> Sanjeev
>