How Does Xp_cmdshell Decide Success Vs. Failure?
Jun 29, 2006
Hi all,
I have a stored proc that uses xp_cmdshell to boot off a batch file on the NT side of the box (box OS is Windows 2000 Advanced Server).
Here is the pertinent code:/*----- Kick off the NT bat job to suck over the data through the web service pipe*/
SELECT @NTCommand = 'D:TradeAnalysisWondaDataStoreJobsPullFromWONDA _InstitutionalRankings.bat ' + CONVERT(varchar(10), @ReqDate, 101)
EXECUTE @e_error = master.dbo.xp_cmdshell @NTCommand
SELECT @m_error = CASE WHEN ISNULL(@e_error, 0) <> 0 THEN (@e_error + 50000) ELSE @@Error END
IF @m_error <> 0 GOTO ErrorHandlerThe trouble is that the batch file is failing (soft error, caught internally to the batch file, which then kills itself, screaming loudly all the way).
The batch file is using the following "voice" in which to scream in pain as it dies (a.k.a., using this code to terminate itself, which kills the cmd shell and returns 13 as an error code)REM WonDBService.exe says we failed
Date /T
Time /T
EXIT /B 13
Meanwhile, back at the ranch (errr...back in stored procedure), what is being returned is a ZERO (in the first code block, @e_error is being set to ZERO when the xp_cmdshell returns from the bat file.
So, now that I have ruled out the obvious *LOL* how can I get my xp_cmdshell to realize it has failed miserably at the one, tiny, simple, not-too-much-to-ask, job that it is designed to do?
View 2 Replies
ADVERTISEMENT
Mar 18, 2008
I have a number of stored procedures that run one after the other. How do you code to get the success or failure so that some logic can be applied accordingly? I've heard of the TRY CATCH structure, but I new and have yet to use it. How many different ways can success or failure be handled in code?
View 4 Replies
View Related
Sep 12, 2006
Hello,
When I run my package, a task will fail, however, the package will claim that it was successful. Why is this, and how can I trigger a failed package when one task fails?
Thanks in advance.
View 4 Replies
View Related
Jun 1, 2015
When I execute Parent SP, it should  Return 1 when Child SP is executed Successfully and Zero when Child SP fail .below are sample SPÂ
CREATE PROCEDURE EXEC_CHILD_PROC
AS
BEGIN
SELECT 99/0
END
[code]...
I tried several way , but did not get correct syntax to modify Parent SP give 1 or 0 on child SP execution
View 6 Replies
View Related
Feb 14, 2008
Please excuse my ignorance as I'm a complete noob when it comes to vb.net.
I have 2 script tasks, each connected to an upstream task via Success and Failure constraints. Each script assigns a value to a variable, depending on whether the task succeeds or fails.
My code thus far is:
Code Snippet
Public Sub Main()
Dts.Variables("strEmailBody").Value = _
"Business Model Reporintg Control Complete - Status = Success"
Dts.TaskResult = Dts.Results.Success
End Sub
What i want to do is use a single script task depending on the success or failure of the package, setting the variable value accordingly.
If there are no errors Then
"Success"
Else
"Failure"
I've tried
Code SnippetIF CBool(Dts.Results.Success) Then...
But whislt it compiled, didn't evaluate correctly during runtime.
Can anyone suggest where I'm going wrong? Again I'm totally new to .net and I'm surprised I've gotten this far!
Thanks in advance.
Leigh
View 5 Replies
View Related
Feb 23, 2008
ummm. sorry, I've read and seen the tutorials but somehow and missing this.
I have a foreach container. Inside a dataflow task, with an XML source, a data conversion (cause of urrr UNICODE) and and an ole DB data source.
By design (and for this simple example), I get a volation if I attempt to load loads with out deleting entries from my table. No biggie, I would just like this simple package to rename my file to extension .good or .bad depending on success of each loop.
Where and what do I need for this?
Thank you for any help or information!
View 3 Replies
View Related
May 2, 2007
More of a general SOAP service call question.
Does anybody have any experience/advice on how to ensure that SOAP service call success/failures are returned to the calling app?
Consider a client that calls a SOAP service during which the client goes down and is unable to receive the SOAP response, the work having been done by the service. Similarly, the SOAP service may perform the task but a failure in the return makes the client think the process failed.
What would be the best way to ensure that the client is notified to avoid the call having to be made again?
Are there middleware tools that can be used to provide a form of message queuing for SOAP service calls?
Thanks
View 1 Replies
View Related
Feb 19, 2015
I have a SSIS pkg that gets data from SQL and do data conversion and Insert into OLE db AS400 destination, There is a flag column in SQL table , that has to be updated to true, once the records are inserted in AS400 how do i do that in SSIS
SQL oledb ---------> dataConversion ---------------> AS400 OLE db Destination
|
update SQL table Flag column<---------------------------------|
View 9 Replies
View Related
Mar 11, 2008
I have an SSIS package that executes a stored procedure. In that stored procedure is a try/catch block. If the try isn't successful, it goes to the catch block which does a rollback. So when I execute the SSIS package, it tells me that the stored procedure was ran successfully because there essentianlly were no errors and everything ran fine, but in reality, everytime it goes into the catch block and does a rollback, I want the SSIS package to fail as well. How would I send back a failure to the SSIS package from the stored procedure?
View 13 Replies
View Related
Jun 10, 2015
I have configured smtp email in MS sql server and configure email to schedular job when schedular jobs become failed. Can i configure email so that email will be sent from scheduler job on both success of job and Failure of job?
View 3 Replies
View Related
Sep 4, 2007
Hi,
We are using SSIS to load some 100k records from flat file to Oracle Destination. We are using Oracle 10g client.
But during the execution after some 5hrs or 6hr with 900k records upload we are getting the message Package execution completed. In the Execution results there is no message related to success or failure and the tasks in the Data Flow where yellow in color. What might be the problem? Any information regarding this case will be helpful for us.
Regards,
Roopa.
View 3 Replies
View Related
Mar 6, 2008
I have a SSIS job, one of the last steps it performs is to execute a SQL 2000 DTS package. This has to be done as a SQL 2000 DTS package as it is performing rebuilds of SQL 2000 Analysis Services dimensions and cubes. We've found that when the DTS fails the SSIS job is happily completing showing as a success, we would prefer to know it went wrong.
As far as I'm aware SSIS merely starts the DTS off and doesn't care about it's result. I've taken a look in to turning on the logging for the execute DTS package and thought that the ExecuteDTS80PackageTaskTaskResult would give me the answer I need...but is merely written to the log not available as an event-handler. It also looks like it is not safe to put a SQL task in as the next item to go look at the SQL 2000 system tables to look at the log for the DTS package as the SSIS documentation warns that the DTS package can continue to run after the execute DTS package task has ended.
Ideally I want any error raised within the DTS package to cascade up to be an error in the SSIS job, I can then handle it appropriately. I cannot find a way to do this. Is there a way?
If not, can anyone suggest how in the remainder of the SSIS tasks I can be sure that the DTS has completed before I start any other tasks that will check for the SQL 2000 log of its execution?
View 5 Replies
View Related
Apr 14, 2008
For example: we have 2 set {1,4,8}, {1,2,3,4,5,8,9,0}
Is there any other fast way to decide {1,4,8} is in cluded in {1,2,3,4,5,8,9,0} ?
beside loop, or insert them into two table then check not exists?
View 8 Replies
View Related
May 31, 2007
Hello,
I have a situation here...
where we are inserting data of candidate...which includes fields...
1. First Name, Middle Name, Last Name ... (varchar(50))
2. Passport ID--- (no duplicates allowed but may be null )
3. Telephone number... ( may be null but no duplicates allowed )
4. Date of Birth --- ( mandatory )
5. Email id .......(no duplicates allowed but may be null )
The problem is that we already have about 1 lakh enteries in the database..
and it is expected to grow with time...
We need to define indexers such that it doesnot take time for searching or while inserting a new datafield into the database.
I hope that i am clear.
since, i suspect that that as it grows it will become more and more slow...!
This is database to store "resumes of different candidates".
So have decided...that
1. name 2. Passport no. 3. Email id: 4. Contact number
be the fields to prevent duplicacy of candidate data...
This involves checking for candidates existence every time anybody tries to make a new entry into database.
Please help to decide over the indexers...
Any good suggestions are welcomed...
Thanks for the reply...
With regards,
Girish R. Pawar
View 1 Replies
View Related
Dec 11, 2007
Hi-
I have a scenario where I need to decide between SSIS and Replication. Customer has 50 GB Database in Oracle. And they want around 150 tables from Oracle database to be copied into SQL Server 2005 database. And this has to be done every night at 10.00 pm to synchronize the data.
I want to know whether the following options are possible to do and which one will give me the best performance.
Option : 1
Use SSIS to get the data (150 tables) from Oracle and import into SQL Server
Option : 2
Use Replication to get the data from Oracle and import into SQL Server. Is that possible to Replicate the 150 tables alone (not the entire Database) from Oracle to SQL?
Option : 3
Use Replication to copy the entire 50 GB Database from Oracle and store into SQL Server.
On these three options which one will give me the best performance?
Thanks in advance.
View 4 Replies
View Related
Jun 22, 2006
I'm trying to join a table and based on the value of a given column I would join using the column in question, however if the column is NULL then I want to make the join without the column in the join. so I think I want to do something like this:
Case E.a
when NULL
then LEFT JOIN EPD ON EPD.b = D.b
AND EPD.SD = (SELECT MAX(E1.SD) FROM E1
WHERE E1.b = EPD.b AND E1.a = EPD.a AND E1.SD <= T.WD)
Else
LEFT JOIN EPD
ON EPD.a = D.a
and EPD.b = E.b
AND EPD.SD = (SELECT MAX(E1.SD) FROM E1
WHERE E1.a = EPD.a AND E1.b = EPD.b AND
E1.SD <= T.WD)
end
however T-Sql does not seem to like my Case statement mixed into my From/join clauses.
Thanks,
Mark E. Johnson
View 6 Replies
View Related
Apr 1, 2008
I have a report and in it there is a dataset that of course contains a query.
I want the query conditions to be changed automatically (the 'WHERE' clause) according to the environment it runs on, so if I put the same report on different customer computers, it will act differently according to the relevant 'WHERE' clause conditions.
Is it possible to use a parameter or "solution configurations" (or something else) in order to decide the conditions in the 'WHERE' clause?
Help will be really appreciated.
Thanks in advance.
View 1 Replies
View Related
Aug 14, 2007
I need to show my boss that 2005 will on average be faster than 2000.
Are there any performance benchmark results available to show this?
Also I need similar benchmarks to show 64 bit will be faster than 32 bit SQL 2005.
Ian
View 6 Replies
View Related
Oct 19, 2007
I´m wondering how to solve the following scenario with SSIS
I have a CITY table and a STATE table, I have to load a file with the information regarding to the CITY:
the state table is like this:
StateCode(PK) stateLegalCode stateName
============= ============== =========
1 01 Florida
the city table is like this:
citycode(PK) cityLegalCode cityname StateCode(FK)
============ ============= ======== =============
1 1001 Quakertown 1
the file has the following information
cityLegalCode cityName
============= ========
01-1001 Quakertown
...
how can I load the file into CITY table:
1-) with the file's cityLegalCode I have to split the string and if the two initial digits are 01 the registry must have 1 in the StateCode(FK).
how can I do something like that using SSIS???
thanks
View 3 Replies
View Related
Jun 26, 2007
I have a parameter for each field that lets me know if a field can be sorted or not.
What I want to be able to do is turn on or off interactive sorting for that column based on that parameters value.
In the dialog you have a check box that says enable interactive sorting. When that is clicked it appears that you get the two arrows no matter what you put in the expression.
I have tried
=IIF(allowSorting,Fields!myColumn.Value,"")
and
=IIF(allowSorting,Fields!myColumn.Value,Nothing)
but both result in the arrows still being there, just the sort doesn't work.
Is it possible to put an expression on the sort arrows appearing at all?
View 3 Replies
View Related
May 8, 2015
The user wants to be able, using excel, to apply a filter to all measures in every measure group. I though that I can create a dimension with a single level with two members, let´s say "on" and "off" and depending on the selected member and using an IIF statement decide which formula applies to the calculated measures.
I have serious doubts about the performance and for this technique because I am thinking as a .Net developer and not as a cube developer. Maybe it is better to resolve it scoping the measures but I cannot figure it out.
View 3 Replies
View Related
Jul 15, 2015
I have received some reports and I have been asked to decide whether these reports can be developed as an operational report or Analytical Reports.
Basically I wanted to understand what points needs to be considered while deciding whether I should go for Analytical reporting (Cubes) or Operation Reporting.
View 2 Replies
View Related
Jul 15, 2004
oK if anyone remembers the problems with my Update/termination Trigger I found it works best if I do it as a Stored procedure instead of a trigger. Thanks again for your help guys. I really appreciate it
View 3 Replies
View Related
Apr 9, 2002
Hi:
I create a DTS package in 'Copy SQL Objects Task' to transfer 3 stored procedures from my local SQL msdb to remote testing msdb database.
Execution is 'successful' but the destination server msdb does not have the 3 stored procedures.
Any hint on this 'vanished' copy objects?
thanks
-D
View 2 Replies
View Related
Feb 13, 2004
Just a thought.
If an issue is resolved please note that the problem has been resolved. Because there are "many ways to skin a cat" it would be helpful to anyone else with a similar problem (or someone trying to learn) what the solution was.
View 7 Replies
View Related
Oct 11, 2006
Hi expert,
I use a SQL Job that makes use of the BACKUP command. How can I check this job success or not?
Thanks
View 5 Replies
View Related
Jun 19, 2007
Hey all
Which system variable do I use if I would like to transfer success message into an SQL table? I'm running a task to import data into an SQL table. And I'm using the System::ErrorDescription variable (Execute SQL task) to insert error messages into a table but I would really appreciate it if someone could tell me what system variable would insert 'success' message into an SQL table. Tried a lot of searching on the net but couldn't find anything.
Many thanks,
Rupa
View 1 Replies
View Related
Oct 19, 2007
Has anyone here been involved in a successful commercial Data Warehouse project?
If so, what was your role? How big was the project? Did you do it all or was their one guy data modelling, one for ETL, one for Client-side, one project managing, etc...? What tools did you use? Was it in SQL2000? 2005? Did you use DTS/SSIS for your ETL or Sprocs? Did you use SSAS? Were you writing lots of MDX to meet client-side needs? Or did you use a completely different toolset for all or some of this?
Did you use the Kimball approach? Or were you in the other camp?
Was your latency nightly or did you have some type of "real-time" capability?
I would prefer to hear from people who've actually been involved in successful projects (or failed projects if you would like to share with us why you think they failed). I'm not too interested in hearing from people that have never done it but have a theory as to how it should work (like me).
Many Thanks,
Coolerbob
(Or is there some other website forum I should be asking this question on? (like mdxteam, olapteam, datawarehouseteam or something)
View 3 Replies
View Related
Jul 17, 2001
Is there a parameter allowing to verify successful execution of a stored procedure?
Something that can be run as the last line in a stored procedure to verify its success...?
Thanks!
View 1 Replies
View Related
Feb 28, 2001
Hi Guys, basically I have a scheduled job in MSSQL7, which on completion e-mails one of the operators.....
How can I get this job to email more than one operator upon completion???
Cheers....
View 1 Replies
View Related
May 11, 2006
Trying to delete records associated with the same contact id from all the tables used for that contact. But I'm getting an error. Strange error because the table does exist and I've been able to do single deletes from that table. So, something tells me I'm not getting something right in my SQL statement. How do I delete records from all 3 tables using the same id (as opposed to doing 3 different SQL calls, one for each)?
-----------------
DELETE names, addresses, phones
FROM names AS n, addresses AS a, phones AS p
WHERE n.id = '12' AND a.id = '12' AND p.id = '12'
Error: Unknown table 'names' in MULTI DELETE
-----------------
(BTW, how do tag my code so it shows up in a code div?)
View 1 Replies
View Related
May 10, 2007
I apologize in advance for what is probably a really dumb question.
I have an SSIS package that is executing a number of data flow tasks simultaneously, and then all are followed by a single script step. I'm trying to get all the constraint arrows to look uniform by having them exit the DFTs on the right side and enter the script step on the left. Unfortunately, BI Dev Studio is putting the exiting arrows on the bottom, which looks awful and is difficult to follow. I can only move them between specific points on the bottom of the step. How do I move those arrows to the right side?
Thanks in advance.
View 8 Replies
View Related
Dec 2, 2015
How to use Xquery to get the success value and the result value from the following XML.
This XML is stored in a SQL Table XML field, i want to be able to get all the success and reslut values for all the records:
Here is my XML
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:ns1="https://data.abc.biz/mysoappathtest/?soap:customcalls:v1"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <SOAP-ENV:Body>
 Â
[Code] ....
I am trying to get the result = 15810 and the Success value = true
View 3 Replies
View Related