Passing Status Back From Command Line Application To SQL Job
Jun 4, 2007
Hi,
I have created a job in SQL Server 2005 in which one of the step executes a .NET console application which is created in .NET to update some status to database before the next step. i need some help in sending some status back to sql job when i come accross any problem in the console application for ex when there is a exception i need to send some status to the job, so the job gets failed permanently. i tried few other methods of updating some temporary status database with this error information and have another intermediate step in the job to check for the status... it worked but i dont like doing it. please let me know if there is any other method to do this.
Thanks in advance
Hariharan
View 5 Replies
ADVERTISEMENT
Mar 27, 2006
Hi all,Is it possible to pass command line arguments to a package when running it from within VS? I want to set the value of a variable via the commandline, and found that you can to this in DtExec with the "/set Package.Variables[...].Value;..." syntax. According to the docs, you should be able to pass the same argument via the 'CmdLineArguments' property in the 'Properties' dialog of an SSIS project in VS (CmdLineArguments. Run the package with the specified command-line arguments. For information about command-line arguments, see dtexec Utility), but unfortunately, this doesn't seem to work (even though the exact same argument does work when entered in DtExec)
Any help would be greatly appreciated :-)
Steven
View 2 Replies
View Related
Mar 8, 2008
Hi,
I'm looking into the idea of building an enhanced version of dtexec.exe that builds in some extra logging features. My utility will execute packages using the Package.Execute() method.
Thing is, I'd still want to support all of the command-line options that dtexec supports. For example, my utility should accept "/set package.variables[myvariable].Value;myvalue" and pass it through to the executing package but I can't find a way of doing it using Package.Execute().
Am I missing something or is this just not possible?
Thanks
Jamie
[Microsoft follow-up]
View 7 Replies
View Related
Jun 11, 2011
How to launch Oracle SQL Developer through "Run" window in windows as we can launch SQL Server Management studio through "Run" command line using command line "sqlwb -S localhost -d MyDB -U sa -P
View 4 Replies
View Related
May 14, 2015
New to Database Mirroring and I have a question about the Principal database server. I have a Database Mirroring setup configured for High-safety with automatic fail over mode using a witness.
When a fail over occurs because of a lost of communication between the principal and mirror, the mirror server takes on the roll of Principal. When communication is returned to the Principal server, at some point does the database that was the previous Principal database automatically go back to being the Principal server?
View 2 Replies
View Related
Aug 19, 2002
Hi,
I have granted db_owner to a user id. This userid was able to take a database offline, but when trying to bring the database up online, I got an error message 5011, user doens't have permission. Does anyone has any idea why? I read in books on line saying that db_owner fixed roles has permssion to set this database property. Thanks.
View 2 Replies
View Related
Apr 24, 2007
I would like some help creating a view that will display the latest status for each application. The lastest status should be based on CreateDt.
For example:
Table Structure:
============
Application: ApplicationID, Name, Address, City, State, Zip, etc..
ApplicationAction: ApplicationActionID, ApplicationID, Status (Ex:new, reviewed, approved, closed), CreateDt
View should display:
==============
ApplicantID, ApplicantActionID, Status, CreateDt
Example:
==========
ApplicantID=4, Name=Bob Smith, etc....
ApplicantActionID=1, ApplicantID=4, Status=New, CreatDt=1/3/20071:00
ApplicantActionID=2, ApplicantID=4, Status=Reviewed, CreatDt=1/3/2007 2:00
ApplicantActionID=3, ApplicantID=4, Status=Approved, CreatDt=1/4/2007 1:00
.... etc....
View should return:
Applicant=4, ApplicantActionID=3, Status=Approved, CreatDt=1/4/2007 1:00
etc....
View 4 Replies
View Related
Oct 12, 2006
I have a Merge-Pull subscription setup on a laptop running SQL 2000 synchronizing with a SQL 2005 database. For the most part everything works fine. However, when I take the laptop off the network for more than 10 minutes and then reconnect back to the network, I see the following status message for the synchronization agent:
The process could not connect to Distributor 'OurServerInstanceName'. Specified SQL server not found. NOTE: The step was retried the requested number of times (10) without succeeding.
It seems that the agent never picks up and starts again once this occurs.
Is there a "best practice" for handling this situation? For example, is there some way to tell the agent to auto-start once a network connection has been re-established or do I need to have some other process monitor the status and restart it when it detects that it has stopped with this error?
Any other ideas?
View 1 Replies
View Related
Oct 10, 2000
I am trying to pass a datename in to a database backup. The date is to be retrieved from the 'monthname' column which is stored in the 'tblbill' table. I have included my ridiculous bit of code below (which funnily enough does not work!!) just so that you can see what I am trying to do. Can anyone help?
DECLARE @name varchar(10)
backup database Bill to Disk ='c:@name.dat' with init
@name =select distinct monthname from tblbill where monthname is not null
cheers,
Dennis
View 2 Replies
View Related
Dec 19, 2007
Hi,
I'm not sure if this question should be in this thread but anyway...
I have a form (Mricosoft Access front end) in which the user enter a Pending Date in one of the fields. The date is populated into my backend (SQL Server) withouht problems.
Whenever the issue which had the pending date in the field is resolved I'd like to delete this date from this field and also from the back end. At the moment I'm not being able to pass the "value" Null to my back end (probably because it's a datetime type). I've searched the net throughout and I couldn't find a way around it. Only found solution to when the data is not date but numbers/letters, etc... Any ideas on how can I sort this out?
Many thanks
Emanuel
View 3 Replies
View Related
Aug 10, 2006
After several hours of trying, I trow the towel in the ring and come here to ask a question.
Source system uses a timestamp column in the transaction tables. which is equal to a non-nullable binary(8) datatype (sql 2000 bol).
What I want to do is get the timestamp at the start of the transfer and at the end of the transfer of data. and store these in a controltable
I try to do this in 2 sql execute tasks:
sqltask 1: "select @@DBTS AS SourceTimestamp" and map the resultset to a variable. Here come's the first problem what variable type to take ?
DBNULL works (meaning it doesn't give errors) (BTW: is there a way to put a variable as a watch when debugging sql tasks ?)
INT64 and UINT64 don't work error message that types for column and parameter are different
STRING works
Then I want to store this variable back in a table of a different data source
sqltask2: "insert into controltable values(getdate(), ?)" and make an input parameter that takes the previous timestamp ...
if I took DBNULL as a type for the variable there doesn't seem to be a single parameter type that works ???
if i take STRING as a type for the variable I have to modify the sql to do the explicit conversion from string to binary so I change CAST(? as binary). It doesn't return any error but the value stored in the table is 0x00000000000 and not the actual timestamp.
Any help on this one ? Why are the INT64/Bigint not working here, you can perfectly do a convert(bigint, timestampfield) in sql ?
How came the SQL datatypes, and the variable datatypes, parameter datatypes are so badly alligned to each other (and all seem to use different names) ?
tx for any help
Dirk
View 6 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
Mar 4, 2015
I was running a stored procedure it was suspended for about 11 hours so I decided to kill it now its in Killed/Rollback stage for 12 hours and when check the status of roll back it says "Estimated rollback completion: 0%. Estimated time remaining: 0 seconds." its using up CPUTIME 380000 and DiskIO 970000. How to do I stop this co.mpletely
View 4 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 20, 2005
I'm using an Access2K front end on a SQL Server2K backend.I use Scope_Identity() in a lot of stored procedures to pass thenewwly inserted record's unique ID to the next select statement in thesame stored procedure.What I'm wondering is how I can pass the Scope_Identity back to thecalling application.I'm hoping someone can show me the SP code and the aceess code neededto accomplish the following:I insert a new record in a table with a stored procedure. The SPpasses the uniqueID (Scope_Identity) back to MS Access, then MS Accessuses the uniqueID when calling another function...thanks
View 1 Replies
View Related
Sep 4, 2015
During our DR drill we found that the same code which used to run perfectly fine on our Primary Data Centre is running very slow on Disaster Recovery DB Server and there are Lot's of open transaction with sleeping status and waittype as 'AWAITING COMMAND'.CPU, Memory and disk utilization are good. The ping reply between the app server and the DB server is well within the limit's even blocking is not their, also nothing is reported in the error logs. We are using SQL server 2014 STD 64 BIT on Windows Server 2012.
View 6 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