I am running the following:
master..xp_cmdshell 'dtsrun /S ricmssql02 /U admindw /P letmein /N "scott - debug"'
but also send parameters. I am seeing the following to do that:
/A global_parameter_name:typeid=value
And also that the whole thing can be repeated to send multiple.
My questions are; What is the delimiter for multiple? What a...
Hey all, I'm pulling my hair out on this one.
I've checked all my permissions, on both the database server (SQL Server 2000) and the file system to ensure that what I am trying to do should be possible. Here's the situation:
I have a Java EE web application running on a Tomcat server on my company's intranet. Long story short, this app...
Hi, I have this SQL Job (in SQL Server 2005) that creates a backup every six(6) hours, the backup's filename is based on the timestamp so that it will create a unique filename(dbname_yyyymmddhhmmss.bak), Now my question is, How would I know using xp_cmdshell if the file is three day old and based on my script I want to delete backup(.bak...
Hello all,
I have created a small command that will let me launch Internet Explorer. However, I wish to close the small command prompt that shows up when I launch IE. How can I do this? This is my current code:
"%ProgramFiles%\Internet
Explorer\iexplore.exe"
http://localhost/test.html
PAUSE
I am guessing if I take out the Pause. It w...
I am trying to read in a text file from an SQL query (SQL Server 2005) but am not having any luck at all. I've tried various things with EXEC and xp_cmdshell, but all aren't working. This is the general way I've tried to approach this:
CREATE TABLE temp (data varchar(2000));
INSERT temp EXEC master.dbo.xp_cmdshell 'type file.txt';
I ...
I am seeing an error message when trying to execute xp_cmdshell from within a stored procedure.
xp_cmdshell is enabled on the instance. And the execute permission was granted to my user, but I am still seeing the exception.
The EXECUTE permission was denied on the object ‘xp_cmdshell’, database ‘mssqlsystemresource’, schema ‘sys’
Part...
declare @servername varchar(2000)
set @EmriServerit=(select @@servername)
declare @dbname varchar(2000)
set @dbname ='Test1'
declare @Dir varchar(2000)
set @Dir='F:\dataclient.sql'
exec master.dbo.xp_cmdshell 'osql -E -S ' + @servername+ ' -d ' +
@dbname +' -i ' + @Dir
It gives me and error:
"incorrect sysntax near +"
If i don'...
I'm trying to get to calculate the Ackermann function. A description of what I'm trying to achieve is at http://rosettacode.org/wiki/Ackermann_function.
Using the test script, Test 0 4 gives me 5 which is correct. However Test 1 4 gives 5 not 6, and Test 2 4 gives 5 instead of 11.
Where am I going wrong?
::echo off
set depth=0
:ack
i...
I am trying to check the state of services when SQL Server is started. I am using xp_cmdshell and 'sc query SQLServerAgent | FIND "STATE"' for example to load the output to a global temp table. It works when SQL Server has already started but does not work when the proc is set to autoexec, via sp_procoption.
...
I am looping through all my databases and aggregating the results into an aggregates database.
In my loop I call
master.dbo.xp_cmdshell osql C:\whatever.SQL
As the loop progresses, the cmdshell takes longer and longer to execute. If I stop the loop and run a single aggregate for one database it executes quickly.
Is there anything...