I have to invoke a batch file (.bat) when an ad-hoc report is executed. I've currently written a .Net code for invoking (using System.Diagnostics.Process) the batch file. The rdl file calls the method.
When I run the report from Report Designer the batch file is getting executed. But if I deploy it in the Reporting Server and run the report through Web Interface the batch file is not getting executed.
Looks like some security issue. Can someone provide a solution for this?
Hi,I'm trying to write a trigger that on the insert/update of a column, Iwant a directory to be created. If insert then create or if updaterename existing dir. Has anyone done thins before? Any pointers wouldbe appreciated.Thanks.
I need to take a variable from a tabel in SQL Server pass to a Batch file and execute the batch file. Right now I can exec the batch file with XP_CMDSHELL but how can I pass the variable to the batch file and loop through all the variables.
Hi, Instead of runing a report through the schedule that I have created, I am invoking the SQL Agent Job that has been created for the schedule of the report, using the system stored procedure sp_startjob. Is this a recommended approach? Are there drawbacks for this approach? Subash
I am using the following batch file to execute a script that creates a db and all its objects in the local sql express:
sqlcmd -S (local)SQLExpress -i C:CreateDB.sql
This works fine, but I'm wondering if there's an easy way to put the script in the batch file, so users don't have to worry about putting the script in the C drive. I tried getting rid of the i parameter and pasting the script from the sql file into the batch file, but it didn't work.
Hi all, I have the "Northwind" database in my Sql Server Management Studio Express.
In my C:ProSSEAppsSamplesForChapter02Chapter02 folder, I have the following 2 files: (1) ListColumnValues (MS-DOS Batch File) sqlcmd -S .sqlexpress -v DBName = "Northwind" CName = "CompanyName" TName = "Shippers" -i c:prosseappschapter02ListListColumnVales.sql -o c:prosseappschapter02ColumnValuesOut.rpt (2) ListColumnValues (Microsoft SQL Server Query File) USE $(Northwind) GO SELECT $(CompanyName) FROM $(Shippers) GO When I ran the following SQLcmd: C:ProSSEAppsSamplesForChapter02Chapter02>ListColumnValues.bat I got the following "ColumnValuesOut.rpt" with error messages:
'Northwind' scripting variable not defined. Msg 102, Level 15, State 1, Server L1P2P3SQLEXPRESS, Line 1 Incorrect syntax near '$'. 'CompanyName' scripting variable not defined. 'Shippers' scripting variable not defined. Msg 102, Level 15, State 1, Server L1P2P3SQLEXPRESS, Line 1 Incorrect syntax near 'CompanyName'.
I copied these T-SQL statements from a book and I do not know how to correct them. Please help and tell me how to correct these errors.
I have a reported that generated over 100,000 leter to the individual clients. Because this is involved with the law firm, the orginal letter from report pdf patch need to be keep. To make matter worst, the pdf file need to break down individual letter for the client, for record keeping and instant access by client via the website. Does report server have the ablility to break the batch report into individual file? Have anyone had similar project? Any suggestion on how to tackle this problem?
I have tried asking the same question in other forums. All i get is links
Please help me. I have the following requirement:
I have the following tables: Theater - TheaterId, TheaterName, Revenues,locationid, stateid State - StateId, StateName Location - LocationId, LocationName, StateId
I want to generate reports that will tell me the revenue generated for each theater in each location in a state. I want to run a batch process which will loop through the 3 tables and will passing the location and state id as parameters one by one. I want each report to be generated as a pdf and stored in a location. How do I do this?
I want to design a DTS task which will: a)copy a certain given files from one directory to another b)import the files into the tables c)upon successful import delete the files from the original directory.
I done know much about scripting and need help in figuring out steps a) and c). thanks Zoey
Can someone show me an example of the syntax required to execute multiple BCP commands within the same batch (*.bat) file?
Sorry if this is a bit of a basic question, but not being a programmer by profession, I need to plead ignorance. I've tried a few things, but I just can't seem to figure it out.
I need a small help from u all. I need a Windows batch file script which does the ftp to remote machine and "puts" a file say "data.xls" from a predefined dir say "c:uploads" and puts on the database server "d:dumps".
I have a windows batch file that executes a SQL Server bcp command. Iwould like to obtain a return code if the bcp command fails. However,I cannot seem to find the return code (if any) for bcp. For example,if the bcp command is improperly formatted, or has a bad password, Iwant the batch file to return an error. Right now, my batch filesimply executes and returns success, even when the bcp command fails.Has anyone run into this before?Thanks!
I want to use Report Designer in SQL Server 2005 to generate monthly invoices for customers. I would need to somehow automatically repeat running the same report, but for a different customer ID each time. Kind of like a batch process.
How can I make this happpen?
The data is in SQL Server 2000. I have Visual Studio 2008 if that helps.
I know Crystal Reports can do this, using the Crystal Reports server. But I'm hoping to find a way to do it using MS Reporting Services.
Hey all.. I am wanting my SQL Server installation to restart its services at a time I define in the Scheduled Tasks feature of the server its on I need help with command line commands to:- Stop SQL Server Agent service- Stop and Start SQL Server service- Restart SQL Server Agent service Thanks in advance
Hi all, I am executing a backup batch job scheduled daily. It runs successfully but havent backed up any of the databases. The message is "The name specified is not recognized as an internal or external command, operable program or batch file."
I am trying this for a full day and i gave up..please can anyone help me or suggest me what to do?..The same batch file is executed in all servers and is working fine..
Hi, I would like to ask someone who could help me with one small problem:
I would like to run SQL server task on one of my servers, that will connect to all other servers (including ones that are not SQL servers, ie: Exchange, Test Server etc) one at the time, and that will execute one batch file (update.bat) that is residing on each server under C: drive.
Batch file will copy some things from all of the servers to one server.
Hi,I want to Utilize the schedule feature in window NT to run a batch file which will migrate data from a text file into an Sql server 6.5 table. here is the senario, I want to program window NT using AT,For, Start etc. I do not know how and have not yet succeeded. Please help?
the case: I already wrote a code using bcp in a batch file as follow
if exist c:authors.out bcp pubs..authors in c:authors.out /Sservername /Usa /Ppassword /fp:autors.fmt
so the command line is basically if the file named authors.out exists in drive c: then run the bcp command. here is the problem, how can I run this code in the first place? A I going to use the AT command in window NT to run this code on a specific day and time to check if the author.out file exists. Please help , I am in urgent need for a solution
I'm trying schedule a batch file to run as a job from sql server agent. The batch file copies files from one server directory to a directory on another server. The batch file works properly when executed directly. The job is being executed under the sql service account login. I've given the service account access to both the source and destination directories.
When I try to run the job it fails with an "Access is denied" error on both the source and destination directories (as read from job history).
Ok.. I thought I could do this but I can't get this to work.. I need to create a batch file to run an sql update statement.. This is simple but I can't get it to wortk.. How do I do it?
Hi All, I need to create a batch file to execute some 5-6 sql scripts. I have sql scripts for creating a table and related storedprocs and I need to generate a batch file to run all this scripts.
i get the following error when trying to run this job as user1: 'Unable to start execution of step 1 (reason: Error authenticating proxy serv1user1, system error: Logon failure: unknown user name or bad password.). The step failed.'
and the following error when trying to run the same job as 'sql agent service account': 'Executed as user: serv1user1. The process could not be created for step 1 of job 0x3653ACCFFA46DD47B3703C87DDFD0717 (reason: 2). The step failed.'
>job: job name: job1 server: (local) connection: net1user1 owner: serv1user1 step type: operating system (cmdexec) run as: user1 command:@echo off copy C: est.txt C:folder ECHO Job completed PAUSE
>the sql server agent service is running under 'serv1user1' and works fine for other jobs running ssis packages.
>i have created the following credentials under security/credentials: credential name: serv1user1 identity: serv1user1 password: same as sql server agent service
>i have created a proxy under the sql server agent/operating system (cmdexec): proxy name: user1 credential name: serv1user1 active subsystem: operating system (cmdexec) principals (sql login): serv1user1
Hi All, I would like to embed some stored procedures in a batch file and execute it from the command prompt on windows. I have no idea of how to embed a stored proc in a .bat file. Can you please redirect me to the solution to this?
Is it possible using T-SQL to run a batch file located on different server, ie. PC1 has SQL Server on it, PC2 has the batchfile, I need to run the batchfile stored on PC2 on PC1.
Is it possible to use sql to execute a batch file? I would like toexecute the following "C:BTWartend.exe /f=C:BTWToolboxFormatscarnum.btw /p", 6Thanks,Matt
I just created batch file to restart analysis services and the job for executing this bat file. <<Batch File >> NET STOP "SQL Server Analysis Services (MSSQLSERVER)" NET START "SQL Server Analysis Services (MSSQLSERVER)"
And I did the following step in sql agent: Create the job > Select CmdExec Job > In commend section, I wrote CALL C:/RestartSSAS.bat
When I run this job, it seems everything went right but at the end, the job was filed. However, I don't see any error on this step since the service was stopped and started successfully. The below is the error message:
Executed as user: D20WKZC1SYSTEM. C:WINDOWSsystem32>NET STOP "SQL Server Analysis Services (MSSQLSERVER)" The SQL Server Analysis Services (MSSQLSERVER) service was stopped successfully. C:WINDOWSsystem32>NET START "SQL Server Analysis Services (MSSQLSERVER)"The SQL Server Analysis Services (MSSQLSERVER) service is starting. The SQL Server Analysis Services (MSSQLSERVER) service was started successfully. Process Exit Code 0. The step failed.
I've also tried to create the package using 'Execute Process Task ' and run it. And it's successful but when I schedule it in sql agent then it failes.
Any thoughts? Please advise me and thanks in advance.
Hi, I am pretty new to DBA job, so please help me if you can. I have to schedule a sql job (in sql 7.0) in sql job schdeduler which contains a batch file (.bat) with parameters. Right now I have to run this job manually using command prompt. If anyone can suggest how to automate this job. Thanks alot, Jannat
Hi everyone! I'm new using SQL server (7.0) and I would like to know if it is possible to create a batch file that will automaticly start a job... If so, let me know and give me some piece of information (command, parameters) or a web site, anything that will help me do so... I'll be very grateful. If not, let me know anyways Thanks a lot in advance...