Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Friday, March 30, 2012

Running bat files in SSIS

Folks -

Did you have any success when running bat files (Execute Process Task) from SSIS through SQL Server Agent jobs? My package will succeed when I run it from my machine, when I ask the DBA to run it manually from the Server but not when we run from a job.

The job will hang and the bat file does not seem to be executed. The executable property does evaluate to the right path and the package owner does have write/execute permissions in the folder where the bat file is located.

Everything I could find close to that is under <http://support.microsoft.com/kb/918760>. Would you shed any light on this? When I run the same bat file from a DTS through SQL Server Agent job, it will work with no issues. Any help would be very much appreciated.

Thanks.

Does the batch file have any prompts that require user input?|||

What is SQL Agent Service account running with?

Is it the same account that you are your DBA use - when running the package manually?

Because when you run the job - it runs with the credential of SQL Agent account.

|||Phil, thxs 4 your reply. No prompts that will require user input. The bat file will do a ftp. Thanks again.|||

How do I check what is SQL Agent Service account running my job? I know when I run the pkg manually it will run under my ID.

I do own the SQL Agent job in the Development environment so the DBA told me that my ID should be trying to execute the bat file (as I said before my ID has the permissions so there is something very strange happening). She said when I move to MO it will be owned by SA.

I can't go to MO if it is not working in DEV Wink

Thanks for your reply.

|||If you are using the SSIS job step to run the package, it runs under the service account that the Agent is set up to use, not the job owner's account. Try setting up a proxy account - check books online for details.|||

Hi,

It's simple. Use an Execute Process Task.

Double Click the Task, Under Process Tab, set the values for the following properties:

1) Executable = cmd.exe

2) Arguments = /c C:\BatchFolder\MyFile.bat.

Make Sure when you run the job, The Service account that runs your job should have access to this batch file.

Thanks

Subhash Subramanyam

|||

Jwelch -

There is a proxy account set by the DBA already... When we add a step to a job, for type we do "Operating system (CmdExec)" and for run as we do "SQLAgentJobProxy".

So... Do you believe this proxy account is the one with no access to run the bat file?

Thanks.

|||

That would be my guess.

Also, is the bat file located on a local drive, network share with UNC path, or a mapped drive?

|||Network share with UNC path.|||Might try copying it locally and see if that makes a difference.|||

I don't have Integration Services installed locally. I will check with the DBA on the permissions mentioned here and I will let you guys know.

Thanks.

|||

Folks,

The feedback I had from my DBA was that the SQLAgentProxyAccount does have access to execute the bat file in question... This is proved when I run a dts through the same job and the same bat file is fired successfully. She also agreed that the Executable Property in the Execute Process Task step was evaluating correctly.

So, our work-around was to remove the bat file execution from the SSIS pkg and add it to the second step of the job. Dirty and scary if you think that the ftp might not be the last step of a whole process. In my case, thanks to God it is... But since we have lack of time right now, this is the solution we put in place.

I would say the issue is still not clarified but I will mark this as closed and if somebody in the future runs into the same problem a new thread could be opened.

Thanks to all.

Running bat files in SSIS

Folks -

Did you have any success when running bat files (Execute Process Task) from SSIS through SQL Server Agent jobs? My package will succeed when I run it from my machine, when I ask the DBA to run it manually from the Server but not when we run from a job.

The job will hang and the bat file does not seem to be executed. The executable property does evaluate to the right path and the package owner does have write/execute permissions in the folder where the bat file is located.

Everything I could find close to that is under <http://support.microsoft.com/kb/918760>. Would you shed any light on this? When I run the same bat file from a DTS through SQL Server Agent job, it will work with no issues. Any help would be very much appreciated.

Thanks.

Does the batch file have any prompts that require user input?|||

What is SQL Agent Service account running with?

Is it the same account that you are your DBA use - when running the package manually?

Because when you run the job - it runs with the credential of SQL Agent account.

|||Phil, thxs 4 your reply. No prompts that will require user input. The bat file will do a ftp. Thanks again.|||

How do I check what is SQL Agent Service account running my job? I know when I run the pkg manually it will run under my ID.

I do own the SQL Agent job in the Development environment so the DBA told me that my ID should be trying to execute the bat file (as I said before my ID has the permissions so there is something very strange happening). She said when I move to MO it will be owned by SA.

I can't go to MO if it is not working in DEV Wink

Thanks for your reply.

|||If you are using the SSIS job step to run the package, it runs under the service account that the Agent is set up to use, not the job owner's account. Try setting up a proxy account - check books online for details.|||

Hi,

It's simple. Use an Execute Process Task.

Double Click the Task, Under Process Tab, set the values for the following properties:

1) Executable = cmd.exe

2) Arguments = /c C:\BatchFolder\MyFile.bat.

Make Sure when you run the job, The Service account that runs your job should have access to this batch file.

Thanks

Subhash Subramanyam

|||

Jwelch -

There is a proxy account set by the DBA already... When we add a step to a job, for type we do "Operating system (CmdExec)" and for run as we do "SQLAgentJobProxy".

So... Do you believe this proxy account is the one with no access to run the bat file?

Thanks.

|||

That would be my guess.

Also, is the bat file located on a local drive, network share with UNC path, or a mapped drive?

|||Network share with UNC path.|||Might try copying it locally and see if that makes a difference.|||

I don't have Integration Services installed locally. I will check with the DBA on the permissions mentioned here and I will let you guys know.

Thanks.

|||

Folks,

The feedback I had from my DBA was that the SQLAgentProxyAccount does have access to execute the bat file in question... This is proved when I run a dts through the same job and the same bat file is fired successfully. She also agreed that the Executable Property in the Execute Process Task step was evaluating correctly.

So, our work-around was to remove the bat file execution from the SSIS pkg and add it to the second step of the job. Dirty and scary if you think that the ftp might not be the last step of a whole process. In my case, thanks to God it is... But since we have lack of time right now, this is the solution we put in place.

I would say the issue is still not clarified but I will mark this as closed and if somebody in the future runs into the same problem a new thread could be opened.

Thanks to all.

Monday, March 26, 2012

Running a LIKE statement when searching for a date field...

I am trying to run a like statement that has a datetime column and for some reason it does not return any values. I looked in the SQL help files and in states in there that when trying to select using a datetime that the preferred way of doing it is using a like statment. Does anybody know a better way of doing this? Here is my example: (I have dates in this column ie 2006-02-13 11:30:54.220)

SELECT * FROM workorderhistory WHERE wheninstalled LIKE '%2006-02%'

Where did you find that preferred way to compare dates is LIKE. You might want to use many date functions to compare dates available in 2k and 2k5.

OR if you incist on using LIKE convert "wheninstalled" to format that you specify in LIKE.

|||datetime is stored in database in an internal format. It is not in YYYY-MM-DD or whatsoever format.

>> I have dates in this column ie 2006-02-13 11:30:54.220
This just how Query Analyser represent the date or format the date and time when it return the records.

>> SELECT * FROM workorderhistory WHERE wheninstalled LIKE '%2006-02%'
To retireve records for month of Feb 2006,

SELECT * FROM workorderhistory WHERE wheninstalled >= '2006-02-01' and wheninstalled < '2006-03-01'



|||

Here is the text from the sql help file.

It is recommended that LIKE be used when you search for datetime values, because datetime entries can contain a variety of dateparts. For example, if you insert the value 19981231 9:20 into a column named arrival_time, the clause WHERE arrival_time = 9:20 cannot find an exact match for the 9:20 string because SQL Server converts it to Jan 1, 1900 9:20AM. A match is found, however, by the clause WHERE arrival_time LIKE '%9:20%'.

Thanks for your help.

|||Thanks for the help... I don't konw why I did not think of doing it that way... Slipped my mind I guess.|||

try this may be helpful for you

SELECT * FROM
WHERE (CAST(FLOOR(CAST([date] AS FLOAT)) AS DATETIME) = '3/14/2006')

|||

How can I use a like statement in there. I tried doing

select * from workorderhistory where (CAST(FLOOR(CAST([date] AS FLOAT)) AS DATETIME) like '03/%') and this did not work. Basically I want to see all the workorders that were installed in the month of march.

Running a LIKE statement when searching for a date field...

I am trying to run a like statement that has a datetime column and for some reason it does not return any values. I looked in the SQL help files and in states in there that when trying to select using a datetime that the preferred way of doing it is using a like statment. Does anybody know a better way of doing this? Here is my example: (I have dates in this column ie 2006-02-13 11:30:54.220)

SELECT * FROM workorderhistory WHERE wheninstalled LIKE '%2006-02%'

Where did you find that preferred way to compare dates is LIKE. You might want to use many date functions to compare dates available in 2k and 2k5.

OR if you incist on using LIKE convert "wheninstalled" to format that you specify in LIKE.

|||datetime is stored in database in an internal format. It is not in YYYY-MM-DD or whatsoever format.

>> I have dates in this column ie 2006-02-13 11:30:54.220
This just how Query Analyser represent the date or format the date and time when it return the records.

>> SELECT * FROM workorderhistory WHERE wheninstalled LIKE '%2006-02%'
To retireve records for month of Feb 2006,

SELECT * FROM workorderhistory WHERE wheninstalled >= '2006-02-01' and wheninstalled < '2006-03-01'



|||

Here is the text from the sql help file.

It is recommended that LIKE be used when you search for datetime values, because datetime entries can contain a variety of dateparts. For example, if you insert the value 19981231 9:20 into a column named arrival_time, the clause WHERE arrival_time = 9:20 cannot find an exact match for the 9:20 string because SQL Server converts it to Jan 1, 1900 9:20AM. A match is found, however, by the clause WHERE arrival_time LIKE '%9:20%'.

Thanks for your help.

|||Thanks for the help... I don't konw why I did not think of doing it that way... Slipped my mind I guess.|||

try this may be helpful for you

SELECT * FROM
WHERE (CAST(FLOOR(CAST([date] AS FLOAT)) AS DATETIME) = '3/14/2006')

|||

How can I use a like statement in there. I tried doing

select * from workorderhistory where (CAST(FLOOR(CAST([date] AS FLOAT)) AS DATETIME) like '03/%') and this did not work. Basically I want to see all the workorders that were installed in the month of march.

Running a asp.net(1.1) app with sql2005 (on a 2.0 framework app)

Hi,
I have developed a simple app using asp.net (vb.net 2003).
Normally I would copy the application files from
c:\Inetpub\wwwroot\
to the server and paste them to the same location on the
server.
I have installed a new server with win2k3 sp1 and installed
beta 2 of sql2005. I have tried the same copying and pasting
but when I run the application, I get the following error:
Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later.
----
A name was started with an invalid character. Error processing resource
'http://localhost/webit/login.aspx'. Line 1, Posit...
<%@. Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb"
Inherits="WebIT.Login"%>
-^
what should i do?
Please help.
Rgs,
MehulI think there's a problem with the IIS 6.0.
I had a sumiliar Problem and there's a discussion about it in the IIS
General UserGroup Now,waiting 4 answer.
"melu" wrote:
> Hi,
> I have developed a simple app using asp.net (vb.net 2003).
> Normally I would copy the application files from
> c:\Inetpub\wwwroot\
> to the server and paste them to the same location on the
> server.
> I have installed a new server with win2k3 sp1 and installed
> beta 2 of sql2005. I have tried the same copying and pasting
> but when I run the application, I get the following error:
>
>
> Cannot view XML input using XSL style sheet. Please correct the error
> and then click the Refresh button, or try again later.
>
> ----
> A name was started with an invalid character. Error processing resource
> 'http://localhost/webit/login.aspx'. Line 1, Posit...
> <%@. Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb"
> Inherits="WebIT.Login"%>
> -^
>
> what should i do?
> Please help.
> Rgs,
> Mehul

Friday, March 23, 2012

Running .Sql Files in a batch

Hi,
I have got multiple .sql files(text files) having T-SQL Statements. I want
to run them all together from query analyzer...how can i do that...
Your help will be appreciatedhI
Let me say you have a file as
Use Pubs
GO
CREATE PROCEDURE spMyProc
AS
SELECT * FROM Titles
--Run this command in QA
EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
"D:\ORD1.sql"'
"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
But bear in mind that "D:\" is a drive on the __server__, not on the client.
Regards
Wojtek|||"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated
Why from QA? Why not write a batch and use isql.exe within?
Regards
Wojtek|||Hi,
I recommend you to run the .SQL files from command prompt using OSQL
redirecting the output to a log file.
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name.sql >
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name1.sql >>
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name2.sql >>
output.log
Thanks
Hari
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
>
> "kailux4" <kailux4@.discussions.microsoft.com> wrote in message
> news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
>> Hi,
>> I have got multiple .sql files(text files) having T-SQL Statements. I
>> want
>> to run them all together from query analyzer...how can i do that...
>> Your help will be appreciated
>

Running .Sql Files in a batch

Hi,
I have got multiple .sql files(text files) having T-SQL Statements. I want
to run them all together from query analyzer...how can i do that...
Your help will be appreciated
hI
Let me say you have a file as
Use Pubs
GO
CREATE PROCEDURE spMyProc
AS
SELECT * FROM Titles
--Run this command in QA
EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
"D:\ORD1.sql"'
"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated
|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
But bear in mind that "D:\" is a drive on the __server__, not on the client.
Regards
Wojtek
|||"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated
Why from QA? Why not write a batch and use isql.exe within?
Regards
Wojtek
|||Hi,
I recommend you to run the .SQL files from command prompt using OSQL
redirecting the output to a log file.
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name.sql >
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name1.sql >>
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name2.sql >>
output.log
Thanks
Hari
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
>
> "kailux4" <kailux4@.discussions.microsoft.com> wrote in message
> news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
>
sql

Running .Sql Files in a batch

Hi,
I have got multiple .sql files(text files) having T-SQL Statements. I want
to run them all together from query analyzer...how can i do that...
Your help will be appreciatedhI
Let me say you have a file as
Use Pubs
GO
CREATE PROCEDURE spMyProc
AS
SELECT * FROM Titles
--Run this command in QA
EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
"D:\ORD1.sql"'
"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
But bear in mind that "D:\" is a drive on the __server__, not on the client.
Regards
Wojtek|||"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
> Hi,
> I have got multiple .sql files(text files) having T-SQL Statements. I want
> to run them all together from query analyzer...how can i do that...
> Your help will be appreciated
Why from QA? Why not write a batch and use isql.exe within?
Regards
Wojtek|||Hi,
I recommend you to run the .SQL files from command prompt using OSQL
redirecting the output to a log file.
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name.sql >
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name1.sql >>
output.log
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name2.sql >>
output.log
Thanks
Hari
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eS%23FL1oaFHA.2900@.TK2MSFTNGP15.phx.gbl...
> hI
> Let me say you have a file as
> Use Pubs
> GO
> CREATE PROCEDURE spMyProc
> AS
> SELECT * FROM Titles
> --Run this command in QA
> EXEC master..xp_cmdshell 'osql.exe -S SERVERNAME -U sa -P pass -i
> "D:\ORD1.sql"'
>
> "kailux4" <kailux4@.discussions.microsoft.com> wrote in message
> news:067CC39F-41E2-4170-B132-927FDB458C9C@.microsoft.com...
>

Runaway log files

Hello,

I am administering a DB which is about 2GB in size and sees few hundred,
maybe up to a few thousand inserts a day plus very few deletions and updates
(less than few hundred). DB has about 200,000 records in it total. For some
time now I have noticed that the transaction logs grow a lot -- like 1GB per
day. I don't know why they are growing so much and would like to find out
why - DB usage that I know of cannot cause such a high growth, to my best
knowledge.

Is there a way to find out what is causing such growth? Can I examine these
logs somehow and see what is in them? I am worried that somehow someone
managed to run mass updates on the DB without my knowledge.

Thanks for help,

Tom Kitta"Tom Kitta" <tom@.energyshop.com> wrote in message
news:D527b.28080$mk1.4594@.news02.bloor.is.net.cabl e.rogers.com...
> Hello,
> I am administering a DB which is about 2GB in size and sees few hundred,
> maybe up to a few thousand inserts a day plus very few deletions and
updates
> (less than few hundred). DB has about 200,000 records in it total. For
some
> time now I have noticed that the transaction logs grow a lot -- like 1GB
per
> day. I don't know why they are growing so much and would like to find out
> why - DB usage that I know of cannot cause such a high growth, to my best
> knowledge.
> Is there a way to find out what is causing such growth? Can I examine
these
> logs somehow and see what is in them? I am worried that somehow someone
> managed to run mass updates on the DB without my knowledge.
> Thanks for help,
> Tom Kitta

Do you mean that your log is growing continuously? That may be normal,
depending on your backup strategy - if you're in Full recovery mode, but
never back up the log, for example. If that's the case, you can look at
backing up the log regularly or changing to Simple recovery mode.

If you're doing that already, and you mean that the log grows more over a
day than you expect, then one possibility is to use Profiler to trace the
"Log File Auto Grow" event, and look for other events before it in the trace
output. If there are one or two queries that require lots of log space, you
should be able to identify them.

Simon

Runaway Log Files

Our production server ran out of disk space over the weekend due to a
runaway log file condition (again).
We had this happen about 2 months ago, prior to SP1, and I reported it here.
MS admitted that had seen the problem, but was not able to reproduce.
In the Event Log, I see thousands of entries like:
Event Type: Warning
Event Source: Schedule and Delivery Processor
Event Category: Logging
Event ID: 123
Date: 8/30/2004
Time: 11:55:16 AM
User: N/A
Computer: KYLE
Description:
The report server failed to write to the trace log.
In the log files, about 8 megabytes in size each until 10 gigabyte disk
capacity was reached, contains repeated entries as follows:
ReportingServicesService!dbcleanup!1308!8/30/2004-11:55:16:: i INFO: Cleaned
0 broken snapshots, 0 chunks
ReportingServicesService!runningjobs!1308!8/30/2004-11:55:16:: i INFO:
Execution Log Entry Expiration timer enabled: Cycle: 50683 seconds
ReportingServicesService!dbcleanup!e44!8/30/2004-11:55:16:: i INFO: Expiring
old execution log entries
ReportingServicesService!dbcleanup!e44!8/30/2004-11:55:16:: i INFO:
Expiration of old execution log entries is complete. Removed 0 entries.
I was hoping this was fixed in SP1, which we are running now. Any ideas?
thx
JeffI already replied to your other post, but will duplicate info here. We have
found the bug and you should contact PSS for a fix to the issue.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeff Dillon" <jeff@.removeemergencyreporting.com> wrote in message
news:OYofuMsjEHA.2948@.TK2MSFTNGP11.phx.gbl...
> Our production server ran out of disk space over the weekend due to a
> runaway log file condition (again).
> We had this happen about 2 months ago, prior to SP1, and I reported it
here.
> MS admitted that had seen the problem, but was not able to reproduce.
> In the Event Log, I see thousands of entries like:
> Event Type: Warning
> Event Source: Schedule and Delivery Processor
> Event Category: Logging
> Event ID: 123
> Date: 8/30/2004
> Time: 11:55:16 AM
> User: N/A
> Computer: KYLE
> Description:
> The report server failed to write to the trace log.
> In the log files, about 8 megabytes in size each until 10 gigabyte disk
> capacity was reached, contains repeated entries as follows:
> ReportingServicesService!dbcleanup!1308!8/30/2004-11:55:16:: i INFO:
Cleaned
> 0 broken snapshots, 0 chunks
> ReportingServicesService!runningjobs!1308!8/30/2004-11:55:16:: i INFO:
> Execution Log Entry Expiration timer enabled: Cycle: 50683 seconds
> ReportingServicesService!dbcleanup!e44!8/30/2004-11:55:16:: i INFO:
Expiring
> old execution log entries
> ReportingServicesService!dbcleanup!e44!8/30/2004-11:55:16:: i INFO:
> Expiration of old execution log entries is complete. Removed 0 entries.
> I was hoping this was fixed in SP1, which we are running now. Any ideas?
> thx
> Jeff
>

Runaway log files

Some of you have run into a problem with the log files being written to and
consuming the entire hard drive. We have identified the issue and have
provided a fix. The KB article itself has not yet been published but the
fix is available through PSS. Please feel free to contact PSS and refer
them to KB 885286.
For everyone who has been waiting for this, thank you for your patience.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.Hi,
When will this fix be available for download?
Erik
"Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
news:OSFl%23KPnEHA.3076@.TK2MSFTNGP15.phx.gbl...
> Some of you have run into a problem with the log files being written to
and
> consuming the entire hard drive. We have identified the issue and have
> provided a fix. The KB article itself has not yet been published but the
> fix is available through PSS. Please feel free to contact PSS and refer
> them to KB 885286.
> For everyone who has been waiting for this, thank you for your patience.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>|||This has become a critical issue for the company I work
for.
A fix is needed pronto. Is this a matter of days for the
fix or "Future Thinking"?
>--Original Message--
>Hi,
>When will this fix be available for download?
>Erik
>"Daniel Reib [MSFT]" <danreib@.online.microsoft.com>
wrote in message
>news:OSFl%23KPnEHA.3076@.TK2MSFTNGP15.phx.gbl...
>> Some of you have run into a problem with the log files
being written to
>and
>> consuming the entire hard drive. We have identified
the issue and have
>> provided a fix. The KB article itself has not yet
been published but the
>> fix is available through PSS. Please feel free to
contact PSS and refer
>> them to KB 885286.
>> For everyone who has been waiting for this, thank you
for your patience.
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties,
and confers no
>rights.
>>
>
>.
>|||At this point the fix is only available through PSS.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Erik Tamminga" <REVERSE_THIS_agnimmate@.REVERSE_THIS_nerrats.ln> wrote in
message news:eqTrhhvnEHA.2096@.TK2MSFTNGP15.phx.gbl...
> Hi,
> When will this fix be available for download?
> Erik
> "Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
> news:OSFl%23KPnEHA.3076@.TK2MSFTNGP15.phx.gbl...
> > Some of you have run into a problem with the log files being written to
> and
> > consuming the entire hard drive. We have identified the issue and have
> > provided a fix. The KB article itself has not yet been published but
the
> > fix is available through PSS. Please feel free to contact PSS and refer
> > them to KB 885286.
> >
> > For everyone who has been waiting for this, thank you for your patience.
> >
> > --
> > -Daniel
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
>|||The fix is available now. You will need to contact PSS and reference the KB
number below. The fix is currently not available as a public download.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dave Laskey" <anonymous@.discussions.microsoft.com> wrote in message
news:0ec501c49f2b$26f188b0$3501280a@.phx.gbl...
> This has become a critical issue for the company I work
> for.
> A fix is needed pronto. Is this a matter of days for the
> fix or "Future Thinking"?
> >--Original Message--
> >Hi,
> >
> >When will this fix be available for download?
> >
> >Erik
> >
> >"Daniel Reib [MSFT]" <danreib@.online.microsoft.com>
> wrote in message
> >news:OSFl%23KPnEHA.3076@.TK2MSFTNGP15.phx.gbl...
> >> Some of you have run into a problem with the log files
> being written to
> >and
> >> consuming the entire hard drive. We have identified
> the issue and have
> >> provided a fix. The KB article itself has not yet
> been published but the
> >> fix is available through PSS. Please feel free to
> contact PSS and refer
> >> them to KB 885286.
> >>
> >> For everyone who has been waiting for this, thank you
> for your patience.
> >>
> >> --
> >> -Daniel
> >> This posting is provided "AS IS" with no warranties,
> and confers no
> >rights.
> >>
> >>
> >>
> >
> >
> >.
> >

Wednesday, March 21, 2012

Run SQL Server Report from .Net WIndows App...

Does a report have to be run from the Report Manager (IIS), or can rdl files
be executed from .Net code in a Windows Application?
I quess what I am asking is, with Crystal and VB 6, I can lauch a report
through a control embedded in the exe file.
Is there a control to place in a Windows Form that can view a report without
haing a IIS Report Manager?
--
Thanks,
ThomasLL, MCDBAI'm pretty sure SQL Reporting Services 2005 will have a WinForms and a
WebForms viewer.
"Thomas.LeBlanc@.NoSpam.Com" wrote:
> Does a report have to be run from the Report Manager (IIS), or can rdl files
> be executed from .Net code in a Windows Application?
> I quess what I am asking is, with Crystal and VB 6, I can lauch a report
> through a control embedded in the exe file.
> Is there a control to place in a Windows Form that can view a report without
> haing a IIS Report Manager?
> --
> Thanks,
> ThomasLL, MCDBAsql

Friday, March 9, 2012

Run Batch Files with SQL Server Agent

Hi,
I am trying to run a batch file using the SQL Server Agent
(I have scheduled a job). I have chosen the step type to
be 'Operating System Command (CmdExec)'. But I am not sure
how to code the actual command.
The batch file is located at: e:\sqlbackups\delete.bat.
How do specify the Agent to call this batch file?
Thanks,
DeeJayHi,
In SQL Agent Jobs -- Step option, after selecting 'Operating System Command
(CmdExec)' , In the command window you can type
e:\sqlbackups\delete.bat
(This will call the batch file delete.bat based on the schedule interval)
Thanks
Hari
MCDBA
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:14f3201c3fa33$599d4120$a001280a@.phx
.gbl...
> Hi,
> I am trying to run a batch file using the SQL Server Agent
> (I have scheduled a job). I have chosen the step type to
> be 'Operating System Command (CmdExec)'. But I am not sure
> how to code the actual command.
> The batch file is located at: e:\sqlbackups\delete.bat.
> How do specify the Agent to call this batch file?
> Thanks,
> DeeJay
>|||Hi
Thanks, but that's exactly how I have been trying to run
it, but it does not work.
I am running the job with an administrative account that
has the required permissions.
I have tested the script by running is manually on the
server and it works fine.
I wonder what gives.
DeeJay
>--Original Message--
>Hi,
>In SQL Agent Jobs -- Step option, after
selecting 'Operating System Command
>(CmdExec)' , In the command window you can type
>e:\sqlbackups\delete.bat
>(This will call the batch file delete.bat based on the
schedule interval)
>Thanks
>Hari
>MCDBA
>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
> news:14f3201c3fa33$599d4120$a001280a@.phx
.gbl...
Agent
sure
>
>.
>|||Do you get any error message, what happens when you try to
run the job ?
How long the batch file takes to run ? We had an issue
where sql agent timed out if the batch file took more than
30 minutes to run. It happened only once and we ran the
file manually from command prompt. You can also try to run
it as a tsql command using Exec
master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
hth.

>--Original Message--
>Hi
>Thanks, but that's exactly how I have been trying to run
>it, but it does not work.
>I am running the job with an administrative account that
>has the required permissions.
>I have tested the script by running is manually on the
>server and it works fine.
>I wonder what gives.
>DeeJay
>selecting 'Operating System Command
>schedule interval)
>Agent
to
>sure
>.
>|||That's the weird part...I do not get any errors. Actually
according to the agent the job completes successfully, but
the files are not deleted.
I tried your suggestion and it did not work. But this time
I do get an error:
The process could not be created for step 1 of job
0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped I/O
operation is in progress). The step failed.
This is really confusing. I do not want to run the
manually every other day.
Thanks,
DeeJay

>--Original Message--
>Do you get any error message, what happens when you try
to
>run the job ?
>How long the batch file takes to run ? We had an issue
>where sql agent timed out if the batch file took more
than
>30 minutes to run. It happened only once and we ran the
>file manually from command prompt. You can also try to
run
>it as a tsql command using Exec
>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>hth.
>
>to
e:\sqlbackups\delete.bat.
>.
>|||For real time error info, try to execute xp_cmdshell from
query analyzer.
I wonder if it is a permission issue, if the job owner is
a sysadmin then then sql server will use service startup
account to execute xp_cmdshell, otherwise it will use a
proxy account. Does sql startup account has permissions to
delete those files ?
hth.

>--Original Message--
>That's the weird part...I do not get any errors. Actually
>according to the agent the job completes successfully,
but
>the files are not deleted.
>I tried your suggestion and it did not work. But this
time
>I do get an error:
>The process could not be created for step 1 of job
>0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped
I/O
>operation is in progress). The step failed.
>This is really confusing. I do not want to run the
>manually every other day.
>Thanks,
>DeeJay
>
>to
>than
>run
run
that
type
not
>e:\sqlbackups\delete.bat.
>.
>|||I tested running the job with me as the owner and I am a
local administrator on this server. I have also tried
using 'sa' and the service startup and nothing is working.
I have tried running the xp_cmdshell procedure in QA and
it also does not work...I just get the output as 'NULL'.
I wonder if it is ONLY using the proxy account. That
account may not have the required permissions.
I will check that.
DeeJay
>--Original Message--
>For real time error info, try to execute xp_cmdshell from
>query analyzer.
>I wonder if it is a permission issue, if the job owner is
>a sysadmin then then sql server will use service startup
>account to execute xp_cmdshell, otherwise it will use a
>proxy account. Does sql startup account has permissions
to
>delete those files ?
>hth.
>
Actually
>but
>time
>I/O
>run
>that
the
Server
>type
>not
>.
>|||Hi,
I forgot that SQL Server 2000 does not have this proxy
account on the local server. I did find a domain
account 'SQLServerAcctCmdExec' and I added this to the
local administrators account and it still did not work.
DeeJay
>--Original Message--
>I tested running the job with me as the owner and I am a
>local administrator on this server. I have also tried
>using 'sa' and the service startup and nothing is working.
>I have tried running the xp_cmdshell procedure in QA and
>it also does not work...I just get the output as 'NULL'.
>I wonder if it is ONLY using the proxy account. That
>account may not have the required permissions.
>I will check that.
>DeeJay
from
is
>to
>Actually
try
the
the
>the
>Server
>.
>|||Make a little change to the batch file and add folloiwng
line at different places:
@.echo In the batch file at line <#>
when you run the batch file in QA it should display these
messages in results window.
In Enterprise Manager, if you open properties of SQL
Server Agent, click on Job System, you will see option to
specify proxy account, use a local admin for it, and then
restart sql services.
hope this helps.

>--Original Message--
>Hi,
>I forgot that SQL Server 2000 does not have this proxy
>account on the local server. I did find a domain
>account 'SQLServerAcctCmdExec' and I added this to the
>local administrators account and it still did not work.
>DeeJay
working.
>from
>is
startup
>try
issue
>the
to
>the
message
>.
>|||I made the change and the script did not return all of the
expected lines. The scripts is doing a 'for' loop so that
could be the reason for not returning all of the lines.
I tried to enter the proxy account, but I am getting
errors:
'Error executing extended stored procedure: Specified User
can not login'.
I am connected to SQL Server with 'sa' and I tried the
local administrator account (will it be a problem if the
local administrator account has been renamed?) and I also
tried with my own domain ID (sysadmin on sql server) and
same results. I did not think I would need change the
account since 'only sysadmins' can run cmdshell jobs and I
have been trying to run the jobs/commands with sysadmin
rights.
Here is the actual script which works fine manually on the
server:
@.echo off
setlocal
:: *** Root path of the directory where the files are to
be deleted:
set
Root=E:\sqlbackups\archtlog\CopyArchdTlo
gBackups\kdirect
:: *** Number of files to keep:
set Keep=590
if not exist "%Root%" goto :err_Root
for /f "skip=%Keep% tokens=*" %%a in ('dir /b /a:-d /o:-
d "%Root%" 2^>NUL') do (
echo Deleting %%a ...
:: *** Remove the "echo" in the next line to 'arm' the
script:
del "%Root%\%%a"
)
goto leave
:err_Root
echo The directory "%Root%" does not exist.
:leave
This is really bugging me!
DeeJay

>--Original Message--
>Make a little change to the batch file and add folloiwng
>line at different places:
>@.echo In the batch file at line <#>
>when you run the batch file in QA it should display these
>messages in results window.
>In Enterprise Manager, if you open properties of SQL
>Server Agent, click on Job System, you will see option to
>specify proxy account, use a local admin for it, and then
>restart sql services.
>hope this helps.
>
a
>working.
and
as 'NULL'.
>startup
a
permissions
successfully,
Overlapped
>issue
more
>to
to
>message
am
>.
>

Run Batch Files with SQL Server Agent

Hi,
I am trying to run a batch file using the SQL Server Agent
(I have scheduled a job). I have chosen the step type to
be 'Operating System Command (CmdExec)'. But I am not sure
how to code the actual command.
The batch file is located at: e:\sqlbackups\delete.bat.
How do specify the Agent to call this batch file?
Thanks,
DeeJayHi,
In SQL Agent Jobs -- Step option, after selecting 'Operating System Command
(CmdExec)' , In the command window you can type
e:\sqlbackups\delete.bat
(This will call the batch file delete.bat based on the schedule interval)
Thanks
Hari
MCDBA
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
> Hi,
> I am trying to run a batch file using the SQL Server Agent
> (I have scheduled a job). I have chosen the step type to
> be 'Operating System Command (CmdExec)'. But I am not sure
> how to code the actual command.
> The batch file is located at: e:\sqlbackups\delete.bat.
> How do specify the Agent to call this batch file?
> Thanks,
> DeeJay
>|||Hi
Thanks, but that's exactly how I have been trying to run
it, but it does not work.
I am running the job with an administrative account that
has the required permissions.
I have tested the script by running is manually on the
server and it works fine.
I wonder what gives.
DeeJay
>--Original Message--
>Hi,
>In SQL Agent Jobs -- Step option, after
selecting 'Operating System Command
>(CmdExec)' , In the command window you can type
>e:\sqlbackups\delete.bat
>(This will call the batch file delete.bat based on the
schedule interval)
>Thanks
>Hari
>MCDBA
>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>> Hi,
>> I am trying to run a batch file using the SQL Server
Agent
>> (I have scheduled a job). I have chosen the step type to
>> be 'Operating System Command (CmdExec)'. But I am not
sure
>> how to code the actual command.
>> The batch file is located at: e:\sqlbackups\delete.bat.
>> How do specify the Agent to call this batch file?
>> Thanks,
>> DeeJay
>
>.
>|||Do you get any error message, what happens when you try to
run the job ?
How long the batch file takes to run ? We had an issue
where sql agent timed out if the batch file took more than
30 minutes to run. It happened only once and we ran the
file manually from command prompt. You can also try to run
it as a tsql command using Exec
master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
hth.
>--Original Message--
>Hi
>Thanks, but that's exactly how I have been trying to run
>it, but it does not work.
>I am running the job with an administrative account that
>has the required permissions.
>I have tested the script by running is manually on the
>server and it works fine.
>I wonder what gives.
>DeeJay
>>--Original Message--
>>Hi,
>>In SQL Agent Jobs -- Step option, after
>selecting 'Operating System Command
>>(CmdExec)' , In the command window you can type
>>e:\sqlbackups\delete.bat
>>(This will call the batch file delete.bat based on the
>schedule interval)
>>Thanks
>>Hari
>>MCDBA
>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>> Hi,
>> I am trying to run a batch file using the SQL Server
>Agent
>> (I have scheduled a job). I have chosen the step type
to
>> be 'Operating System Command (CmdExec)'. But I am not
>sure
>> how to code the actual command.
>> The batch file is located at: e:\sqlbackups\delete.bat.
>> How do specify the Agent to call this batch file?
>> Thanks,
>> DeeJay
>>
>>.
>.
>|||That's the weird part...I do not get any errors. Actually
according to the agent the job completes successfully, but
the files are not deleted.
I tried your suggestion and it did not work. But this time
I do get an error:
The process could not be created for step 1 of job
0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped I/O
operation is in progress). The step failed.
This is really confusing. I do not want to run the
manually every other day.
Thanks,
DeeJay
>--Original Message--
>Do you get any error message, what happens when you try
to
>run the job ?
>How long the batch file takes to run ? We had an issue
>where sql agent timed out if the batch file took more
than
>30 minutes to run. It happened only once and we ran the
>file manually from command prompt. You can also try to
run
>it as a tsql command using Exec
>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>hth.
>>--Original Message--
>>Hi
>>Thanks, but that's exactly how I have been trying to run
>>it, but it does not work.
>>I am running the job with an administrative account that
>>has the required permissions.
>>I have tested the script by running is manually on the
>>server and it works fine.
>>I wonder what gives.
>>DeeJay
>>--Original Message--
>>Hi,
>>In SQL Agent Jobs -- Step option, after
>>selecting 'Operating System Command
>>(CmdExec)' , In the command window you can type
>>e:\sqlbackups\delete.bat
>>(This will call the batch file delete.bat based on the
>>schedule interval)
>>Thanks
>>Hari
>>MCDBA
>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>> Hi,
>> I am trying to run a batch file using the SQL Server
>>Agent
>> (I have scheduled a job). I have chosen the step type
>to
>> be 'Operating System Command (CmdExec)'. But I am not
>>sure
>> how to code the actual command.
>> The batch file is located at:
e:\sqlbackups\delete.bat.
>> How do specify the Agent to call this batch file?
>> Thanks,
>> DeeJay
>>
>>.
>>.
>.
>|||For real time error info, try to execute xp_cmdshell from
query analyzer.
I wonder if it is a permission issue, if the job owner is
a sysadmin then then sql server will use service startup
account to execute xp_cmdshell, otherwise it will use a
proxy account. Does sql startup account has permissions to
delete those files ?
hth.
>--Original Message--
>That's the weird part...I do not get any errors. Actually
>according to the agent the job completes successfully,
but
>the files are not deleted.
>I tried your suggestion and it did not work. But this
time
>I do get an error:
>The process could not be created for step 1 of job
>0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped
I/O
>operation is in progress). The step failed.
>This is really confusing. I do not want to run the
>manually every other day.
>Thanks,
>DeeJay
>>--Original Message--
>>Do you get any error message, what happens when you try
>to
>>run the job ?
>>How long the batch file takes to run ? We had an issue
>>where sql agent timed out if the batch file took more
>than
>>30 minutes to run. It happened only once and we ran the
>>file manually from command prompt. You can also try to
>run
>>it as a tsql command using Exec
>>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>>hth.
>>--Original Message--
>>Hi
>>Thanks, but that's exactly how I have been trying to
run
>>it, but it does not work.
>>I am running the job with an administrative account
that
>>has the required permissions.
>>I have tested the script by running is manually on the
>>server and it works fine.
>>I wonder what gives.
>>DeeJay
>>--Original Message--
>>Hi,
>>In SQL Agent Jobs -- Step option, after
>>selecting 'Operating System Command
>>(CmdExec)' , In the command window you can type
>>e:\sqlbackups\delete.bat
>>(This will call the batch file delete.bat based on the
>>schedule interval)
>>Thanks
>>Hari
>>MCDBA
>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>> Hi,
>> I am trying to run a batch file using the SQL Server
>>Agent
>> (I have scheduled a job). I have chosen the step
type
>>to
>> be 'Operating System Command (CmdExec)'. But I am
not
>>sure
>> how to code the actual command.
>> The batch file is located at:
>e:\sqlbackups\delete.bat.
>> How do specify the Agent to call this batch file?
>> Thanks,
>> DeeJay
>>
>>.
>>.
>>.
>.
>|||I tested running the job with me as the owner and I am a
local administrator on this server. I have also tried
using 'sa' and the service startup and nothing is working.
I have tried running the xp_cmdshell procedure in QA and
it also does not work...I just get the output as 'NULL'.
I wonder if it is ONLY using the proxy account. That
account may not have the required permissions.
I will check that.
DeeJay
>--Original Message--
>For real time error info, try to execute xp_cmdshell from
>query analyzer.
>I wonder if it is a permission issue, if the job owner is
>a sysadmin then then sql server will use service startup
>account to execute xp_cmdshell, otherwise it will use a
>proxy account. Does sql startup account has permissions
to
>delete those files ?
>hth.
>>--Original Message--
>>That's the weird part...I do not get any errors.
Actually
>>according to the agent the job completes successfully,
>but
>>the files are not deleted.
>>I tried your suggestion and it did not work. But this
>time
>>I do get an error:
>>The process could not be created for step 1 of job
>>0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped
>I/O
>>operation is in progress). The step failed.
>>This is really confusing. I do not want to run the
>>manually every other day.
>>Thanks,
>>DeeJay
>>--Original Message--
>>Do you get any error message, what happens when you try
>>to
>>run the job ?
>>How long the batch file takes to run ? We had an issue
>>where sql agent timed out if the batch file took more
>>than
>>30 minutes to run. It happened only once and we ran the
>>file manually from command prompt. You can also try to
>>run
>>it as a tsql command using Exec
>>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>>hth.
>>--Original Message--
>>Hi
>>Thanks, but that's exactly how I have been trying to
>run
>>it, but it does not work.
>>I am running the job with an administrative account
>that
>>has the required permissions.
>>I have tested the script by running is manually on the
>>server and it works fine.
>>I wonder what gives.
>>DeeJay
>>--Original Message--
>>Hi,
>>In SQL Agent Jobs -- Step option, after
>>selecting 'Operating System Command
>>(CmdExec)' , In the command window you can type
>>e:\sqlbackups\delete.bat
>>(This will call the batch file delete.bat based on
the
>>schedule interval)
>>Thanks
>>Hari
>>MCDBA
>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>> Hi,
>> I am trying to run a batch file using the SQL
Server
>>Agent
>> (I have scheduled a job). I have chosen the step
>type
>>to
>> be 'Operating System Command (CmdExec)'. But I am
>not
>>sure
>> how to code the actual command.
>> The batch file is located at:
>>e:\sqlbackups\delete.bat.
>> How do specify the Agent to call this batch file?
>> Thanks,
>> DeeJay
>>
>>.
>>.
>>.
>>.
>.
>|||Hi,
I forgot that SQL Server 2000 does not have this proxy
account on the local server. I did find a domain
account 'SQLServerAcctCmdExec' and I added this to the
local administrators account and it still did not work.
DeeJay
>--Original Message--
>I tested running the job with me as the owner and I am a
>local administrator on this server. I have also tried
>using 'sa' and the service startup and nothing is working.
>I have tried running the xp_cmdshell procedure in QA and
>it also does not work...I just get the output as 'NULL'.
>I wonder if it is ONLY using the proxy account. That
>account may not have the required permissions.
>I will check that.
>DeeJay
>>--Original Message--
>>For real time error info, try to execute xp_cmdshell
from
>>query analyzer.
>>I wonder if it is a permission issue, if the job owner
is
>>a sysadmin then then sql server will use service startup
>>account to execute xp_cmdshell, otherwise it will use a
>>proxy account. Does sql startup account has permissions
>to
>>delete those files ?
>>hth.
>>--Original Message--
>>That's the weird part...I do not get any errors.
>Actually
>>according to the agent the job completes successfully,
>>but
>>the files are not deleted.
>>I tried your suggestion and it did not work. But this
>>time
>>I do get an error:
>>The process could not be created for step 1 of job
>>0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped
>>I/O
>>operation is in progress). The step failed.
>>This is really confusing. I do not want to run the
>>manually every other day.
>>Thanks,
>>DeeJay
>>--Original Message--
>>Do you get any error message, what happens when you
try
>>to
>>run the job ?
>>How long the batch file takes to run ? We had an issue
>>where sql agent timed out if the batch file took more
>>than
>>30 minutes to run. It happened only once and we ran
the
>>file manually from command prompt. You can also try to
>>run
>>it as a tsql command using Exec
>>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>>hth.
>>--Original Message--
>>Hi
>>Thanks, but that's exactly how I have been trying to
>>run
>>it, but it does not work.
>>I am running the job with an administrative account
>>that
>>has the required permissions.
>>I have tested the script by running is manually on
the
>>server and it works fine.
>>I wonder what gives.
>>DeeJay
>>--Original Message--
>>Hi,
>>In SQL Agent Jobs -- Step option, after
>>selecting 'Operating System Command
>>(CmdExec)' , In the command window you can type
>>e:\sqlbackups\delete.bat
>>(This will call the batch file delete.bat based on
>the
>>schedule interval)
>>Thanks
>>Hari
>>MCDBA
>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>>> Hi,
>>>
>>> I am trying to run a batch file using the SQL
>Server
>>Agent
>>> (I have scheduled a job). I have chosen the step
>>type
>>to
>>> be 'Operating System Command (CmdExec)'. But I am
>>not
>>sure
>>> how to code the actual command.
>>>
>>> The batch file is located at:
>>e:\sqlbackups\delete.bat.
>>>
>>> How do specify the Agent to call this batch file?
>>>
>>> Thanks,
>>>
>>> DeeJay
>>>
>>
>>.
>>.
>>.
>>.
>>.
>.
>|||Make a little change to the batch file and add folloiwng
line at different places:
@.echo In the batch file at line <#>
when you run the batch file in QA it should display these
messages in results window.
In Enterprise Manager, if you open properties of SQL
Server Agent, click on Job System, you will see option to
specify proxy account, use a local admin for it, and then
restart sql services.
hope this helps.
>--Original Message--
>Hi,
>I forgot that SQL Server 2000 does not have this proxy
>account on the local server. I did find a domain
>account 'SQLServerAcctCmdExec' and I added this to the
>local administrators account and it still did not work.
>DeeJay
>>--Original Message--
>>I tested running the job with me as the owner and I am a
>>local administrator on this server. I have also tried
>>using 'sa' and the service startup and nothing is
working.
>>I have tried running the xp_cmdshell procedure in QA and
>>it also does not work...I just get the output as 'NULL'.
>>I wonder if it is ONLY using the proxy account. That
>>account may not have the required permissions.
>>I will check that.
>>DeeJay
>>--Original Message--
>>For real time error info, try to execute xp_cmdshell
>from
>>query analyzer.
>>I wonder if it is a permission issue, if the job owner
>is
>>a sysadmin then then sql server will use service
startup
>>account to execute xp_cmdshell, otherwise it will use a
>>proxy account. Does sql startup account has permissions
>>to
>>delete those files ?
>>hth.
>>--Original Message--
>>That's the weird part...I do not get any errors.
>>Actually
>>according to the agent the job completes successfully,
>>but
>>the files are not deleted.
>>I tried your suggestion and it did not work. But this
>>time
>>I do get an error:
>>The process could not be created for step 1 of job
>>0xC38683087ECAA14AB6614A1A74F27555 (reason: Overlapped
>>I/O
>>operation is in progress). The step failed.
>>This is really confusing. I do not want to run the
>>manually every other day.
>>Thanks,
>>DeeJay
>>--Original Message--
>>Do you get any error message, what happens when you
>try
>>to
>>run the job ?
>>How long the batch file takes to run ? We had an
issue
>>where sql agent timed out if the batch file took more
>>than
>>30 minutes to run. It happened only once and we ran
>the
>>file manually from command prompt. You can also try
to
>>run
>>it as a tsql command using Exec
>>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>>hth.
>>--Original Message--
>>Hi
>>Thanks, but that's exactly how I have been trying to
>>run
>>it, but it does not work.
>>I am running the job with an administrative account
>>that
>>has the required permissions.
>>I have tested the script by running is manually on
>the
>>server and it works fine.
>>I wonder what gives.
>>DeeJay
>>>--Original Message--
>>>Hi,
>>>
>>>In SQL Agent Jobs -- Step option, after
>>selecting 'Operating System Command
>>>(CmdExec)' , In the command window you can type
>>>
>>>e:\sqlbackups\delete.bat
>>>
>>>(This will call the batch file delete.bat based on
>>the
>>schedule interval)
>>>
>>>Thanks
>>>Hari
>>>MCDBA
>>>
>>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in
message
>>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>>> Hi,
>>>
>>> I am trying to run a batch file using the SQL
>>Server
>>Agent
>>> (I have scheduled a job). I have chosen the step
>>type
>>to
>>> be 'Operating System Command (CmdExec)'. But I am
>>not
>>sure
>>> how to code the actual command.
>>>
>>> The batch file is located at:
>>e:\sqlbackups\delete.bat.
>>>
>>> How do specify the Agent to call this batch file?
>>>
>>> Thanks,
>>>
>>> DeeJay
>>>
>>>
>>>
>>>.
>>>
>>.
>>.
>>.
>>.
>>.
>.
>|||I made the change and the script did not return all of the
expected lines. The scripts is doing a 'for' loop so that
could be the reason for not returning all of the lines.
I tried to enter the proxy account, but I am getting
errors:
'Error executing extended stored procedure: Specified User
can not login'.
I am connected to SQL Server with 'sa' and I tried the
local administrator account (will it be a problem if the
local administrator account has been renamed?) and I also
tried with my own domain ID (sysadmin on sql server) and
same results. I did not think I would need change the
account since 'only sysadmins' can run cmdshell jobs and I
have been trying to run the jobs/commands with sysadmin
rights.
Here is the actual script which works fine manually on the
server:
@.echo off
setlocal
:: *** Root path of the directory where the files are to
be deleted:
set
Root=E:\sqlbackups\archtlog\CopyArchdTlogBackups\kdirect
:: *** Number of files to keep:
set Keep=590
if not exist "%Root%" goto :err_Root
for /f "skip=%Keep% tokens=*" %%a in ('dir /b /a:-d /o:-
d "%Root%" 2^>NUL') do (
echo Deleting %%a ...
:: *** Remove the "echo" in the next line to 'arm' the
script:
del "%Root%\%%a"
)
goto leave
:err_Root
echo The directory "%Root%" does not exist.
:leave
This is really bugging me!
DeeJay
>--Original Message--
>Make a little change to the batch file and add folloiwng
>line at different places:
>@.echo In the batch file at line <#>
>when you run the batch file in QA it should display these
>messages in results window.
>In Enterprise Manager, if you open properties of SQL
>Server Agent, click on Job System, you will see option to
>specify proxy account, use a local admin for it, and then
>restart sql services.
>hope this helps.
>>--Original Message--
>>Hi,
>>I forgot that SQL Server 2000 does not have this proxy
>>account on the local server. I did find a domain
>>account 'SQLServerAcctCmdExec' and I added this to the
>>local administrators account and it still did not work.
>>DeeJay
>>--Original Message--
>>I tested running the job with me as the owner and I am
a
>>local administrator on this server. I have also tried
>>using 'sa' and the service startup and nothing is
>working.
>>I have tried running the xp_cmdshell procedure in QA
and
>>it also does not work...I just get the output
as 'NULL'.
>>I wonder if it is ONLY using the proxy account. That
>>account may not have the required permissions.
>>I will check that.
>>DeeJay
>>--Original Message--
>>For real time error info, try to execute xp_cmdshell
>>from
>>query analyzer.
>>I wonder if it is a permission issue, if the job owner
>>is
>>a sysadmin then then sql server will use service
>startup
>>account to execute xp_cmdshell, otherwise it will use
a
>>proxy account. Does sql startup account has
permissions
>>to
>>delete those files ?
>>hth.
>>--Original Message--
>>That's the weird part...I do not get any errors.
>>Actually
>>according to the agent the job completes
successfully,
>>but
>>the files are not deleted.
>>I tried your suggestion and it did not work. But this
>>time
>>I do get an error:
>>The process could not be created for step 1 of job
>>0xC38683087ECAA14AB6614A1A74F27555 (reason:
Overlapped
>>I/O
>>operation is in progress). The step failed.
>>This is really confusing. I do not want to run the
>>manually every other day.
>>Thanks,
>>DeeJay
>>--Original Message--
>>Do you get any error message, what happens when you
>>try
>>to
>>run the job ?
>>How long the batch file takes to run ? We had an
>issue
>>where sql agent timed out if the batch file took
more
>>than
>>30 minutes to run. It happened only once and we ran
>>the
>>file manually from command prompt. You can also try
>to
>>run
>>it as a tsql command using Exec
>>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
>>hth.
>>>--Original Message--
>>>Hi
>>>
>>>Thanks, but that's exactly how I have been trying
to
>>run
>>>it, but it does not work.
>>>
>>>I am running the job with an administrative account
>>that
>>>has the required permissions.
>>>
>>>I have tested the script by running is manually on
>>the
>>>server and it works fine.
>>>
>>>I wonder what gives.
>>>
>>>DeeJay
>>>--Original Message--
>>>Hi,
>>>
>>>In SQL Agent Jobs -- Step option, after
>>>selecting 'Operating System Command
>>>(CmdExec)' , In the command window you can type
>>>
>>>e:\sqlbackups\delete.bat
>>>
>>>(This will call the batch file delete.bat based on
>>the
>>>schedule interval)
>>>
>>>Thanks
>>>Hari
>>>MCDBA
>>>
>>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in
>message
>>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
>>> Hi,
>>>
>>> I am trying to run a batch file using the SQL
>>Server
>>>Agent
>>> (I have scheduled a job). I have chosen the step
>>type
>>to
>>> be 'Operating System Command (CmdExec)'. But I
am
>>not
>>>sure
>>> how to code the actual command.
>>>
>>> The batch file is located at:
>>e:\sqlbackups\delete.bat.
>>>
>>> How do specify the Agent to call this batch file?
>>>
>>> Thanks,
>>>
>>> DeeJay
>>>
>>>
>>>
>>>.
>>>
>>>.
>>>
>>.
>>.
>>.
>>.
>>.
>.
>|||Hi Deejay,
2 things,
if you have set up SQL Agent to use proxy account, proxy account will only
be used if the owner of the SQLAgentJob is NOT a member of the local
administrators group.
Secondly if the SQLProxyaccount is a member of the local administrator but
Builtin\Admin has been removed as a part of the a security policy then you
need to add SQLProxy account as a login and grant this account the necessary
rights to execute xp_cmdshell.
I hope this helps your situation.
--
Olu Adedeji
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:295d01c3fca7$4b3ddfb0$a501280a@.phx.gbl...
> I made the change and the script did not return all of the
> expected lines. The scripts is doing a 'for' loop so that
> could be the reason for not returning all of the lines.
> I tried to enter the proxy account, but I am getting
> errors:
> 'Error executing extended stored procedure: Specified User
> can not login'.
> I am connected to SQL Server with 'sa' and I tried the
> local administrator account (will it be a problem if the
> local administrator account has been renamed?) and I also
> tried with my own domain ID (sysadmin on sql server) and
> same results. I did not think I would need change the
> account since 'only sysadmins' can run cmdshell jobs and I
> have been trying to run the jobs/commands with sysadmin
> rights.
> Here is the actual script which works fine manually on the
> server:
> @.echo off
> setlocal
> :: *** Root path of the directory where the files are to
> be deleted:
> set
> Root=E:\sqlbackups\archtlog\CopyArchdTlogBackups\kdirect
> :: *** Number of files to keep:
> set Keep=590
>
> if not exist "%Root%" goto :err_Root
> for /f "skip=%Keep% tokens=*" %%a in ('dir /b /a:-d /o:-
> d "%Root%" 2^>NUL') do (
> echo Deleting %%a ...
> :: *** Remove the "echo" in the next line to 'arm' the
> script:
> del "%Root%\%%a"
> )
> goto leave
>
> :err_Root
> echo The directory "%Root%" does not exist.
>
> :leave
>
> This is really bugging me!
> DeeJay
> >--Original Message--
> >Make a little change to the batch file and add folloiwng
> >line at different places:
> >
> >@.echo In the batch file at line <#>
> >
> >when you run the batch file in QA it should display these
> >messages in results window.
> >
> >In Enterprise Manager, if you open properties of SQL
> >Server Agent, click on Job System, you will see option to
> >specify proxy account, use a local admin for it, and then
> >restart sql services.
> >
> >hope this helps.
> >
> >>--Original Message--
> >>Hi,
> >>
> >>I forgot that SQL Server 2000 does not have this proxy
> >>account on the local server. I did find a domain
> >>account 'SQLServerAcctCmdExec' and I added this to the
> >>local administrators account and it still did not work.
> >>
> >>DeeJay
> >>--Original Message--
> >>I tested running the job with me as the owner and I am
> a
> >>local administrator on this server. I have also tried
> >>using 'sa' and the service startup and nothing is
> >working.
> >>
> >>I have tried running the xp_cmdshell procedure in QA
> and
> >>it also does not work...I just get the output
> as 'NULL'.
> >>
> >>I wonder if it is ONLY using the proxy account. That
> >>account may not have the required permissions.
> >>
> >>I will check that.
> >>
> >>DeeJay
> >>--Original Message--
> >>For real time error info, try to execute xp_cmdshell
> >>from
> >>query analyzer.
> >>
> >>I wonder if it is a permission issue, if the job owner
> >>is
> >>a sysadmin then then sql server will use service
> >startup
> >>account to execute xp_cmdshell, otherwise it will use
> a
> >>proxy account. Does sql startup account has
> permissions
> >>to
> >>delete those files ?
> >>
> >>hth.
> >>
> >>--Original Message--
> >>That's the weird part...I do not get any errors.
> >>Actually
> >>according to the agent the job completes
> successfully,
> >>but
> >>the files are not deleted.
> >>
> >>I tried your suggestion and it did not work. But this
> >>time
> >>I do get an error:
> >>
> >>The process could not be created for step 1 of job
> >>0xC38683087ECAA14AB6614A1A74F27555 (reason:
> Overlapped
> >>I/O
> >>operation is in progress). The step failed.
> >>
> >>This is really confusing. I do not want to run the
> >>manually every other day.
> >>
> >>Thanks,
> >>DeeJay
> >>
> >>--Original Message--
> >>Do you get any error message, what happens when you
> >>try
> >>to
> >>run the job ?
> >>
> >>How long the batch file takes to run ? We had an
> >issue
> >>where sql agent timed out if the batch file took
> more
> >>than
> >>30 minutes to run. It happened only once and we ran
> >>the
> >>file manually from command prompt. You can also try
> >to
> >>run
> >>it as a tsql command using Exec
> >>master.dbo.xp_cmdshell 'e:\sqlbackups\delete.bat'
> >>
> >>hth.
> >>
> >>>--Original Message--
> >>>Hi
> >>>
> >>>Thanks, but that's exactly how I have been trying
> to
> >>run
> >>>it, but it does not work.
> >>>
> >>>I am running the job with an administrative account
> >>that
> >>>has the required permissions.
> >>>
> >>>I have tested the script by running is manually on
> >>the
> >>>server and it works fine.
> >>>
> >>>I wonder what gives.
> >>>
> >>>DeeJay
> >>>--Original Message--
> >>>Hi,
> >>>
> >>>In SQL Agent Jobs -- Step option, after
> >>>selecting 'Operating System Command
> >>>(CmdExec)' , In the command window you can type
> >>>
> >>>e:\sqlbackups\delete.bat
> >>>
> >>>(This will call the batch file delete.bat based on
> >>the
> >>>schedule interval)
> >>>
> >>>Thanks
> >>>Hari
> >>>MCDBA
> >>>
> >>>"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in
> >message
> >>>news:14f3201c3fa33$599d4120$a001280a@.phx.gbl...
> >>> Hi,
> >>>
> >>> I am trying to run a batch file using the SQL
> >>Server
> >>>Agent
> >>> (I have scheduled a job). I have chosen the step
> >>type
> >>to
> >>> be 'Operating System Command (CmdExec)'. But I
> am
> >>not
> >>>sure
> >>> how to code the actual command.
> >>>
> >>> The batch file is located at:
> >>e:\sqlbackups\delete.bat.
> >>>
> >>> How do specify the Agent to call this batch file?
> >>>
> >>> Thanks,
> >>>
> >>> DeeJay
> >>>
> >>>
> >>>
> >>>.
> >>>
> >>>.
> >>>
> >>.
> >>
> >>.
> >>
> >>.
> >>
> >>.
> >>
> >>.
> >>
> >.
> >

Wednesday, March 7, 2012

run backup (maintenance plan) from Batch (.bat) file

What is the method to execute backups from batch (.bat) files on the server running SQL Server. I have tried the sqlmaint command - doesn't seem to execute, looked into the xp_sqlmaint with no luck. I'm sure the problem lies in my lack of DOS batch programming skills. If anyone has an example of a batch file that executes a backup would you mind sharing. thanksHave you tried using OSQL from within a batch file?|||just stumbled onto that option this morning. I'm not much of a SQL guru, tring to set up some backups of DB contained in SQL from an COTS package. Do you know how this would all fit together? It appears I would create a file with (possiblely) the SQLMAINT (statement and parms) contained within. Then execute it from within the OSQL statement. Does this sound like I'm on the right track? Do you use the OSQL statement in any .BAT files? I would love to see an example of a (.BAT & sqlmaint) file that I could mimic the context of.|||personally I do not use maintenance plans. I script out all of my maintenance using BACKUP and DBCC t-sql statements. And yu can probably do this with osql in a batch file.

Why may I ask are you taking this approach? Do you need to schedule these to run at a specific time? If so, why not use a sql server agent job?|||I want to have it executed by the server backup software right before the backup system: tivoli, TSM, (not sure of the specific tool) runs. I also want to include some file ZIPs and versioning (file rolls - moves - to specific folders) to mimic the backup/DR process used for other products on the server (a comprehebnsive backup/recovery porocess used for our COTS tools)|||you can use jobs in the sql server agent to do all of that. I would go to SQL Server books Online-->Contents-->Administering SQL Server--> Automating Administrative Tasks-->Implimenting Jobs and do some reading.

you may also want to read xp_cmdshell for the file copies|||thanks I will...I just can't believe that there isn't a fairly easy way to do it extrnally so that I can leverage my existing BAT files and scheduling software (autosys)

Run all .sql files in a folder

I have created scripts to create approximately 200 tables. I have all of
these .sql files saved in a folder on a server. Is there a way to execute o
r
run all of the files at once in this folder instead of running them one at a
time?
ThanksYou could write a batch file - use a 'for' loop and call osql passing the
file path and other appropriate parameters.
"bbasile" wrote:

> I have created scripts to create approximately 200 tables. I have all of
> these .sql files saved in a folder on a server. Is there a way to execute
or
> run all of the files at once in this folder instead of running them one at
a
> time?
> Thanks|||Sounds good. Are there any examples out there I could take a look at?
"KH" wrote:
> You could write a batch file - use a 'for' loop and call osql passing the
> file path and other appropriate parameters.
>
> "bbasile" wrote:
>|||that's exactly what I was going to suggest.
another way would be to use the OA methods and FileSystemObjects to load
each of the files and then execute them.
> You could write a batch file - use a 'for' loop and call osql passing the
> file path and other appropriate parameters.
>
> "bbasile" wrote:
>
new

Run all .sql files (scripts) in project (SQL Server 2005 SP2)

Hello,

I've run as many keyword combinations searching for this as I can
think of, but cannot find a simple answer.

The situation: I have a database that is mid-conversion/redevelopment.
I frequently rebuild my dev copy from the production version, which
requires a bunch of DDL script, and then adding in all the stored
procedures necessary to the new version only. Each sp may have changed
since the last time it was run, so I can't exactly keep them all
concatenated in a single file or anything like that.

So the only way I can see to execute each and every one of these saved
script files is to open it up in SSMS and hit F5 for execute. This is
a silly waste of time, it seems to me, and hardly foolproof. Is there
not some simple way to run every script in a project? What purpose
does a project serve, otherwise?

(Worth mentioning that the tool I found here
http://www.codeproject.com/useritem...criptRunner.asp does not
seem to work.)

Thanks in advance.downwitch (downwitch@.gmail.com) writes:

Quote:

Originally Posted by

I've run as many keyword combinations searching for this as I can
think of, but cannot find a simple answer.
>
The situation: I have a database that is mid-conversion/redevelopment.
I frequently rebuild my dev copy from the production version, which
requires a bunch of DDL script, and then adding in all the stored
procedures necessary to the new version only. Each sp may have changed
since the last time it was run, so I can't exactly keep them all
concatenated in a single file or anything like that.
>
So the only way I can see to execute each and every one of these saved
script files is to open it up in SSMS and hit F5 for execute. This is
a silly waste of time, it seems to me, and hardly foolproof. Is there
not some simple way to run every script in a project? What purpose
does a project serve, otherwise?


SQL code should be kept under source control, just likely any other code,
and deployment should be done from the version-control system.

Having said that, there are a couple of options you consider. One is
SQL Compare from Red Gate, although they currently have no direct support
for Source Control. The latest version supports comparing a database to
folder structure on disk, though.

A much more simple-minded way is to get a list of all stored procedures
you need to load. Put that in a text file, and then use a text editor
with good find-replace capabilities to transform the list to a BAT
file that runs SQLCMD to load the files. Just make sure that you run
SQLCMD with the -I option, so that you run with QUOTED_IDENTIFIER ON.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Aug 22, 5:52 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

downwitch (downwi...@.gmail.com) writes:

Quote:

Originally Posted by

I've run as many keyword combinations searching for this as I can
think of, but cannot find a simple answer.


>

Quote:

Originally Posted by

The situation: I have a database that is mid-conversion/redevelopment.
I frequently rebuild my dev copy from the production version, which
requires a bunch of DDL script, and then adding in all the stored
procedures necessary to the new version only. Each sp may have changed
since the last time it was run, so I can't exactly keep them all
concatenated in a single file or anything like that.


>

Quote:

Originally Posted by

So the only way I can see to execute each and every one of these saved
script files is to open it up in SSMS and hit F5 for execute. This is
a silly waste of time, it seems to me, and hardly foolproof. Is there
not some simple way to run every script in a project? What purpose
does a project serve, otherwise?


>
SQLcode should be kept under source control, just likely any other code,
and deployment should be done from the version-control system.
>
Having said that, there are a couple of options you consider. One isSQLComparefrom Red Gate, although they currently have no direct support
for Source Control. The latest version supports comparing a database to
folder structure on disk, though.
>
A much more simple-minded way is to get a list of all stored procedures
you need to load. Put that in a text file, and then use a text editor
with good find-replace capabilities to transform the list to a BAT
file that runs SQLCMD to load the files. Just make sure that you run
SQLCMD with the -I option, so that you run with QUOTED_IDENTIFIER ON.
>
--
Erland Sommarskog,SQLServerMVP, esq...@.sommarskog.se
>
Books Online forSQLServer2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online forSQLServer2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx- Hide quoted text -
>
- Show quoted text -


downwitch - we have a new product that will be released in the next
few days, xSQL Builder that allows you to create a database deployment
package which between other things allows you to specify a folder
where you can have all the scripts you want to run before the database
synchronization takes place and also you can specify a folder where
all your post synchronization scripts are. The application will run
all those scripts on one big transaction and log everything.

Email us at our support address @. xsqlsoftware.com and we will send
you the pre-release build so you can give it a try.

Thanks,
JC
xSQL Software
http://www.xsqlsoftware.com|||On Aug 22, 11:24 am, downwitch <downwi...@.gmail.comwrote:

Quote:

Originally Posted by

Hello,
>
I've run as many keyword combinations searching for this as I can
think of, but cannot find a simple answer.
>
The situation: I have a database that is mid-conversion/redevelopment.
I frequently rebuild my dev copy from the production version, which
requires a bunch of DDL script, and then adding in all the stored
procedures necessary to the new version only. Each sp may have changed
since the last time it was run, so I can't exactly keep them all
concatenated in a single file or anything like that.
>
So the only way I can see to execute each and every one of these saved
script files is to open it up in SSMS and hit F5 for execute. This is
a silly waste of time, it seems to me, and hardly foolproof. Is there
not some simple way to run every script in a project? What purpose
does a project serve, otherwise?
>
(Worth mentioning that the tool I found herehttp://www.codeproject.com/useritems/SSMSScriptRunner.aspdoes not
seem to work.)
>
Thanks in advance.


Hello downwitch,

xSQL Software has just released a free utility, xSQL Script Executor,
that allows you to run multiple T-SQL scripts at once - you can choose
individual scripts or whole folders and run them all. You can choose
to wrap all scripts in one big transaction or not, you can call it
from the command line etc. Check it out at:
http://www.xsqlsoftware.com/Product...torDetails.aspx
Thanks,
JC
xSQL Software
http://www.xsqlsoftware.com