Dtsrun Works From Command Line, Not From Stored Proc
Jun 30, 2000
I need to execute a dts package from a stored procedure. I can call up the command prompt, enter the dts command, and it executes perfectly. Here is what I am attempting to do from the stored procecure:
EXEC master..xp_cmdshell 'dtsrun /S MyServer /E /N PackageTest'
On execution, the following error is returned:
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147217887 (80040E21)
Error string: Error opening datafile: Access is denied.
I would appreciate any assistance.
View 1 Replies
ADVERTISEMENT
Jul 17, 2006
I have a dts that works from the command prompt, but hangs in Query Analyzer. Here's the code inside Query Analyzer:exec master..xp_cmdshell 'dtsrun /S BFHSQL4 /N vhl_dts_14144b /E'From the command prompt, it's just:dtsrun /S BFHSQL4 /N vhl_dts_14144b /EAny ideas what's wrong? Thanks for your help!
View 3 Replies
View Related
Nov 28, 2006
I've a S.P. that need to execute in local PC, how can I execute ?
View 1 Replies
View Related
Jun 17, 2015
For reasons beyond the scope of my question, is there a way to run this command within a Stored Procedure from a low privileged user login? I can grant the entity "db_ddladmin" privilege and the proc runs, but I'd rather not give out that level of permission to what is basically a glorified web access login.
View 5 Replies
View Related
Jun 5, 2007
Hello
This is my first post so please be gentle!!
I have a stored proc that returns a value:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
SET NOCOUNT ON
GO
-- =============================================
ALTER PROCEDURE [dbo].[spPK]
-- Add the parameters for the stored procedure here
@varNSC varchar(4),
@varNC varchar(2),
@varIIN varchar(7),
@varIMCDMC varchar(8),
@varOut as int output
AS
Declare
@varPK int
set @varPK = 0
BEGIN
--This checks Method 1
--NSC = @varNSC
--NC = @varNC
--IIN = @varIIN
begin
if exists
(select Item_id
From Item
Where NSC = @varNSC
and NC = @varNC
and IIN = @varIIN)
set @varPK =
(select Item_id
From Item
Where NSC = @varNSC
and NC = @varNC
and IIN = @varIIN)
set @varOut = @varPK
if @varPK <> 0 Return
end
[There are some more methods here]
Return
END
How do I get at the output value?
I have tried using derived column and ole db command but can't seem to grasp how to pass the value to the derived column. I can get oledb command to run using 'exec dbo.spPK ?, ?, ?, ?, ? output' but don't know what to do from here.
View 10 Replies
View Related
Nov 27, 2000
Hi,
I am trying to run dtsrun command as a sheduled job and the user who executes that job is "sa".I am trying to import data from a Non-Secured Network to a Secured Network only port 1433 is opened.
The problem is that dtsrun is a OS based command and that runs in the context of the service which started the sql service and which is a RPC request.
I need to run a certain dts package at a sceduled intervals and i need a work around other than dtsrun..how can i do the same
replies will be greatlt appreciated
Jane
View 1 Replies
View Related
Jun 10, 2002
Hi everyone,
I have created a DTS package in SQL Server 2000 which is running good when I execute it through SQL Enterprise manager.
But when I try to run the package through command line DTSRUN utility on server, I am getting the following error message displayed.
"DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259 (80004005)
Error string: Error opening datafile: There are currently no logon servers available to service the logon request.
Error source: Microsoft Data Transformation Services Flat File Rowset Provider
Help file: DTSFFile.hlp
Help context: 0
".
The same package is getting executed properly when I run it from my client through DTSRUN from the command prompt.
Any idea if it is because of security issues.
thanx in advance.
Mad
View 4 Replies
View Related
Nov 7, 2007
HiWe're using SqlServer 2000.I want to run a DTS using the DTSRUN command.The commmand is inside a ".bat" file which my application is runningfrom an SQL client.No matter how I run it from the client it fails giving me the message:[ConnectionOpen (Connect()).]SQL Server does not exist or access deniedI've tried to run it from the client from the application, from thecommand prompt and it fails.I went into enterprise on the client and tried to run the DTS fromthere. The run failed already on the 1st step which is a call to astored procedure, also giving me the same message. This really stuck meas wierd because in enterprise I'm accessing the server successfully sowhy the above messgae. It identifies the server and I am accessing it.Because it failed on the 1st step which is a call to a stored procedureI tried running the sp from within query analyzer and it succeeded.Has anyone got any idea what the problem is and ghow to solve it.Thanks !David Greenberg
View 1 Replies
View Related
Feb 13, 2008
I am working with a large application and am trying to track down a bug. I believe an error that occurs in the stored procedure isbubbling back up to the application and is causing the application not to run. Don't ask why, but we do not have some of the sourcecode that was used to build the application, so I am not able to trace into the code.
So basically I want to examine the stored procedure. If I run the stored procedure through Query Analyzer, I get the following error message:
Msg 2758, Level 16, State 1, Procedure GetPortalSettings, Line 74RAISERROR could not locate entry for error 60002 in sysmessages.
(1 row(s) affected)
(1 row(s) affected)
I don't know if the error message is sufficient enough to cause the application from not running? Does anyone know? If the RAISERROR occursmdiway through the stored procedure, does the stored procedure terminate execution?
Also, Is there a way to trace into a stored procedure through Query Analyzer?
-------------------------------------------As a side note, below is a small portion of my stored proc where the error is being raised:
SELECT @PortalPermissionValue = isnull(max(PermissionValue),0)FROM Permission, PermissionType, #GroupsWHERE Permission.ResourceId = @PortalIdAND Permission.PartyId = #Groups.PartyIdAND Permission.PermissionTypeId = PermissionType.PermissionTypeId
IF @PortalPermissionValue = 0BEGIN RAISERROR (60002, 16, 1) return -3END
View 3 Replies
View Related
Jul 20, 2005
Can anyone give clues as to why the same copy command works inDOS and not in xp_command shell.I am an admin in both servers andin the database.The results indicate one file is copied but no file is foundat destination.Your input is appreciatedVincentocopy "D:Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEVack1.txt" "\corp156d$Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEV"works just fine butusemasterexec xp_cmdshell 'copy "D:Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEVack1.txt" "\corp156d$Program FilesMicrosoft SQLServerMSSQLBACKUPQMISDEV"'
View 3 Replies
View Related
Oct 29, 2004
Hi all,
I am currently using a series of dts packages to extract and export data. To run the packages, I have a table (TW_DTS) which lists each dts package name, I then use a stored procedure to loop through each and 'dtsrun' it. If a package fails then the error is stored in another table from within the individual dts.
This solution works in principle, however when the stored procedure runs some of the dts packages fail for an unknown reason. Unfortunately the problem is not consistent - it is not always the same package, or even same number of packages that fail. Each package will work when run individually.
I have listed the stored procedure below, any advice may save me from throwing my laptop through the window.
Cheers.
-----------
CREATE PROCEDURE [spTWDTS] AS
DECLARE @unique_idvarchar(50)
DECLARE @dts_namevarchar(50)
DECLARE @start_dttmdatetime
DECLARE @end_dttmdatetime
DECLARE @CMDvarchar(1000)
DECLARE @ERRORvarchar(1000)
DECLARE
dts_cur CURSOR FOR SELECT unique_id, dts_name, start_dttm, end_dttm from TW_DTS where status = 'A'
open dts_cur
FETCH dts_cur INTO @unique_id, @dts_name, @start_dttm, @end_dttm
while @@fetch_status = 0
BEGIN
-- Set as No Error
SET @ERROR = 0
--update the start date
UPDATE TW_DTS set start_dttm = getdate() where unique_id = @unique_id
--run the package
SET @CMD = 'dtsrun /S myserver /U myusername /P mypassword/N '+@dts_name
EXECUTE @ERROR = master..xp_cmdshell @CMD
--update the end date
UPDATE TW_DTS set end_dttm = getdate() where unique_id = @unique_id
--move to next dts package
FETCH dts_cur INTO @unique_id, @dts_name, @start_dttm, @end_dttm
END
CLOSE dts_cur
DEALLOCATE dts_cur
RETURN @ERROR
GO
View 3 Replies
View Related
Jul 20, 2005
Hi,I'm writing a stored procedure to run a dts package and I've successfulygot this working using my sotred proc and the syntax of dtsrun iscorrect.However, I'm trying to pass a variable to the DTSrun command and this iswhere I'm having the problemthe code for the proc is:Declare @partcode nvarchar(255)EXEC master..xp_cmdshell 'DTSRun /S "server" /U "user" /P "password" /N"XMLStockCheck" /A "oPartCode":"8"="' + @partcode + '" /W "0" 'Everytime I run it I get this error:Server: Msg 170, Level 15, State 1, Line 3Line 3: Incorrect syntax near '+'.can someone help me with this please?M3ckon*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 1 Replies
View Related
Jul 23, 2005
Using Query Analyzer, I can right click on an object and select "scriptobject to new window as create" and I get the text of the object'sdefinition (schema). Can I get same result from command line, i.e., fromosql, I can get text output for the definition of the object (something likedefncopy under Sybase)? If so, what is the command or store procedure name?Thanks in advance.
View 2 Replies
View Related
Apr 2, 2008
Is there any command line that I can use to do select from databases (SQL 2005)
View 4 Replies
View Related
Sep 30, 2015
SQL Server 2012 Replication. The command prompt instance of the replication is being run as the same user as the SSMS "version" using the runas option. With SSMS the error is that the client is missing a privilege. There is no error when it runs from the command prompt. All runs well.
We have reinstalled the replication feature.We have gone through several MSDN articles that indicate exactly what privileges (both within the DB and in Windows) that service account should have. None have worked Incidentally, when I create a new publication and indicate that the SQL Server Agent be used , the publication runs.
View 0 Replies
View Related
May 1, 2001
hi I would appreciate if someone demonstrate how to automate ftp in a command line from within a batch file. I do want to move certain files from one server to another via ftp command line in an automatic fashion via running the batch periodically.
thanks
Ali
View 1 Replies
View Related
Jun 13, 2000
hi: I can't seem to run BCP thru the command line.
bcp pubs..authors out c:authors.txt -c -Usa -P
error:
Msg 170, Level 15, State 1, Server Y47SA, Procedure , Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near'.'.
I've been trying to run BCP thru command line all day. I tried OSQL, ISQL. I find this utility very
frustrating. btw - I have installed SP2.
any thoughts would be much appreciated.
TIA
deanna
View 5 Replies
View Related
Sep 25, 2002
Anyone know where I can find some command line tools such as RCMD etc.. Thank you.;)
View 1 Replies
View Related
Sep 22, 2005
I'm trying to insert into a table 2 values one of which is an
exec master..xp_cmdshell @command where I have assigned @command with a value
this statement gives me the result into a 1 col. table fine:
insert into mytable99(col1) exec master..xp_cmdshell @command
now what I want to do is put col2 in there as well!!
ie. insert into mytable99(col1,col2) values (exec master..xp_cmdshell @command, '123')
I get a sytax error ... on the exec ??
Could anyone help re the proper way of doing this ... thanks in advance
View 1 Replies
View Related
Oct 13, 2005
I use a similar command below to insert into a temp table the result of a large command line call to an exectable with many parameters passed in the command of which the result passed back contains many items. I then parse the response string to get my results...
set @command = 'dir'
insert into tsverisign(response) exec master..xp_cmdshell @command
My question is our can I insert two values at the same time to this same table one of which is my "exec master..xp_cmdshell @command"
similar to insert into tables (field_a, feild_b) values ('1','2')
Something like (and I know this does not work):
insert into tsverisign(response,trans_id)
values (exec master..xp_cmdshell @command, '123')
Any help would be greatly appreciated .... PS I'm new to MS SQL 2000 and proper syntax etc. etc. so I need full example so I can try. :rolleyes:
View 1 Replies
View Related
Jun 11, 2007
Hi All,
I was given a task of coming up with the script to recreate an existing database using a command line. I would use this script in case when the server is down and I can't get to Query Analyzer or EM to recreate it. I am not sure where to start. Any ideas are greatly appreciated.
Thanks.
View 5 Replies
View Related
May 21, 2004
What ius the synthax to backup an SQLServer DB from the command line ?
Thanks
View 1 Replies
View Related
Jan 29, 2008
Can someone give me the command to restart SQL?
Thanks
View 1 Replies
View Related
Jul 23, 2005
I want to restore a backup copy of a database from the command line. Canthis be done?Thanks, Tom.
View 2 Replies
View Related
Jul 20, 2005
Hi Sir:Is any possible to run DTS package from Command Line ?Lucas
View 1 Replies
View Related
May 4, 2007
I am trying to create an quiet install for SQL Server Express. The install is being run under a local administrators account. However, when a user, who is only in the local users group, accesses the application using ClickOnce deplolyment, it says SQL Server Express Edition is not installed.
-Dan
View 1 Replies
View Related
Mar 14, 2007
Hello,
How can I set SQL Profiler to capture the logs via command line?
This is what I have:
I already have a SQL Profiler Template (fooTemplate.tdf) which tells what I need SQL to capture.
C:>"C:Program FilesMicrosoft SQL Server90ToolsBinnPROFILER90.EXE" /Sfoo /Dfoo /E /T"c:fooTemplate.tdf" /Oc:mysql.out
What other parameters am I missing?
Thanks!
J
View 3 Replies
View Related
Apr 22, 2008
Hi all,
A quick newbie question...
I am trying to install SQL Server 2005 Standard and upgrade from Express edition. The Edition Change check tells me I must run the setup from the command prompt "and include the SKUUPGRADE=1 parameter", but I don't know how to enter this from the command line.
I've tried "D:setup SKUUPGRADE=1" and "D:setup -SKUUPGRADE=1", as well as "D:setup.exe /SKUUPGRADE=1" without success.
Can anyone give me a clue as to where I'm going wrong?
Thanks in advance.
Slammin!
View 3 Replies
View Related
Mar 29, 2007
Hello everyone!
Bit of a problem executing a DTS command from a command line.
I have the following variables defined in my package:
UserVarchar1
UserVarchar2
UserVarchar3
All have a scope of Package, all of the mstrings
The command I'm attempting to run in 1 line is:
DTEXEC /FILE "C:SSIS PackagesED-CustomersPackage.dtsx"
/SET Package.Variables[User::UserVarchar1].value;"10"
/SET Package.Variables[User::UserVarchar2].value;"30719"
/SET Package.Variables[User::UserVarchar3].value;"BILLTO"
Description: The package path referenced an object that cannot be found: "Package.Variables[User::UserVarchar1].value". This occurs when an attempt is made to resolve a package path to an object that cannot be found.
DTExec: Could not set Package.Variables[User::UserVarchar1].value value to 10.
Any idea why?
Thanks for the help!
View 10 Replies
View Related
Jul 10, 2002
Hey Folks,
I have inherited a project from a co-worker who has had a family tradegy, and I am trying to get up to speed with her project.
We have an SQL server 7 database which is getting backed up every night (by SQL itself) into a .BAK file. I need to know if it is possible to restore this file from the command line (a DOS prompt.) I know (or think I know) how to do it from within SQL Enterprise Manager, however the specific needs of this project require it be done from a command line on the machine.
I really am not an SQL guru...I don't even think I qualify as "knowing what I am doing" at all, so any advice you can offer will be greatly appreciated. This is kind og urgent, so your thoughts are welcome!
Thanks!
Mike
View 1 Replies
View Related
Jun 26, 2000
Does any know of a technique to filter out headers dashes and row count in an output file of an isql result? These switches seem to be available when running as isql/w, but not the command line. The -h-1 argument for no headers had no effect. Thanks in advance. Ron Hurley
View 1 Replies
View Related
May 5, 2000
Does anyone know how to start sqlserver 7.0 from command line for windows 98?
Thanks
View 1 Replies
View Related
Oct 31, 2002
I'm trying to use the rcmd utility and when i try to connect to a server with it i get this error...
system not found or service not active? How do you activate the rcmd service? thanks for your help.
View 7 Replies
View Related