Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
aleedy
Starting Member
2 Posts |
Posted - 2002-03-12 : 17:49:17
|
| in a dts package, i am importing data into a temp table. I am then using a sql task to compare the temp table with another table to check for dups. If dups exists (@@ROWCOUNT > 1) I want the task to fail. How can I do this? I have tried RAISERROR, but that does not work. |
|
|
rrb
SQLTeam Poet Laureate
1479 Posts |
Posted - 2002-03-12 : 20:43:02
|
| tried 1/0?--I hope that when I die someone will say of me "That guy sure owed me a lot of money" |
 |
|
|
aleedy
Starting Member
2 Posts |
Posted - 2002-03-13 : 08:42:47
|
| 1/0 doesn't work either. |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-03-13 : 09:53:50
|
| Right click on the execute sql task, select workflow properties, select the options tab, and check "fail package on step failure". |
 |
|
|
JamesH
Posting Yak Master
149 Posts |
Posted - 2002-03-13 : 11:12:26
|
| Here's some code that I use to check for system dates that if they're not the current day then the step is forced to fail. You should be able to use the DTSStepExecResult_ (Success/Fail) and do the same.'**********************************************************************' Visual Basic ActiveX Script'************************************************************************ function Main() Dim f, fs Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile("\\SAPSRV\files\outbound\newinfo\shipments.txt") If FormatDateTime(f.DateLastModified, vbShortDate) = FormatDateTime(Date, vbShortDate) Then main = DTSTaskExecResult_Success else main = DTSStepExecResult_Failure End If ' MsgBox f.DateLastModifiedSet f = NothingSet fs = Nothing End functionHope this helps,JamesH. |
 |
|
|
|
|
|