Click here to Skip to main content
15,887,350 members
Home / Discussions / Database
   

Database

 
GeneralRe: Datatype for NULL Pin
N a v a n e e t h17-Oct-07 2:50
N a v a n e e t h17-Oct-07 2:50 
GeneralRe: Datatype for NULL Pin
Mike Dimmick17-Oct-07 6:33
Mike Dimmick17-Oct-07 6:33 
GeneralRe: Datatype for NULL Pin
N a v a n e e t h17-Oct-07 18:26
N a v a n e e t h17-Oct-07 18:26 
AnswerRe: Datatype for NULL Pin
Pete O'Hanlon17-Oct-07 2:26
mvePete O'Hanlon17-Oct-07 2:26 
GeneralRe: Datatype for NULL Pin
N a v a n e e t h17-Oct-07 2:39
N a v a n e e t h17-Oct-07 2:39 
GeneralRe: Datatype for NULL Pin
Pete O'Hanlon17-Oct-07 2:56
mvePete O'Hanlon17-Oct-07 2:56 
QuestionMDX + Trasnsactional Level Pin
GChannon17-Oct-07 2:00
GChannon17-Oct-07 2:00 
QuestionForce DTS Failure Pin
Bjohnson3317-Oct-07 0:33
Bjohnson3317-Oct-07 0:33 
Hi all

I'm trying to write a DTS that as it's first step checks a log table as to whether the process has already run for that date, and if it has, exit.

I thought I'd be able to have an 'Execute SQL Task' with something like the following:
DECLARE @ContributionDate DATETIME
DECLARE @NoOfRecords INT

SET @ContributionDate = GetDate()

CREATE TABLE #Results(NoOfRecords INT)
INSERT INTO #Results EXEC db.dbo.vsDissemination_HasRun @ContributionDate, 'C'
SET @NoOfRecords = (SELECT TOP 1 NoOfRecords FROM #Results)
DROP TABLE #Results

IF @NoOfRecords > 0
BEGIN
RAISERROR('Dissemination has occurred',1,1)
END
ELSE
SELECT 1

Which when the error was raised would go down the On Failure branch, but it always goes to the On Success branch.

Running the script in Query Analyzer does either return a numeric value or an error.

Firstly, is this the best way to do this check?

If it is, why doesn't it work - if not, how should I be doing this?

Thanks
Ben
AnswerRe: Force DTS Failure Pin
andyharman17-Oct-07 1:53
professionalandyharman17-Oct-07 1:53 
GeneralRe: Force DTS Failure Pin
Bjohnson3317-Oct-07 2:57
Bjohnson3317-Oct-07 2:57 
QuestionCreate Function Pin
Sarfaraj Ahmed16-Oct-07 23:34
Sarfaraj Ahmed16-Oct-07 23:34 
AnswerRe: Create Function Pin
Hesham Amin17-Oct-07 0:34
Hesham Amin17-Oct-07 0:34 
GeneralRe: Create Function Pin
Sarfaraj Ahmed17-Oct-07 1:54
Sarfaraj Ahmed17-Oct-07 1:54 
GeneralRe: Create Function Pin
Sarfaraj Ahmed17-Oct-07 2:14
Sarfaraj Ahmed17-Oct-07 2:14 
Questiondatatype mismatch Pin
sean0016-Oct-07 19:00
sean0016-Oct-07 19:00 
AnswerRe: datatype mismatch Pin
Giorgi Dalakishvili16-Oct-07 20:47
mentorGiorgi Dalakishvili16-Oct-07 20:47 
GeneralRe: datatype mismatch Pin
sean0017-Oct-07 5:40
sean0017-Oct-07 5:40 
GeneralRe: datatype mismatch Pin
Giorgi Dalakishvili17-Oct-07 6:00
mentorGiorgi Dalakishvili17-Oct-07 6:00 
AnswerRe: datatype mismatch Pin
pmarfleet16-Oct-07 20:51
pmarfleet16-Oct-07 20:51 
Questionneed advice - oracle client Pin
udikantz16-Oct-07 13:21
udikantz16-Oct-07 13:21 
AnswerRe: need advice - oracle client Pin
AETaylor18-Oct-07 21:42
AETaylor18-Oct-07 21:42 
QuestionADO.NET update/select question Pin
Tom Wright16-Oct-07 10:57
Tom Wright16-Oct-07 10:57 
AnswerRe: ADO.NET update/select question Pin
pmarfleet16-Oct-07 11:01
pmarfleet16-Oct-07 11:01 
AnswerRe: ADO.NET update/select question Pin
Christian Graus16-Oct-07 11:29
protectorChristian Graus16-Oct-07 11:29 
Jokeadd hour in business date/hour Pin
Nilton Jr16-Oct-07 8:02
Nilton Jr16-Oct-07 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.