Click here to Skip to main content
15,896,912 members
Home / Discussions / Database
   

Database

 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Herman<T>.Instance17-Oct-07 3:03
Herman<T>.Instance17-Oct-07 3:03 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Colin Angus Mackay17-Oct-07 3:11
Colin Angus Mackay17-Oct-07 3:11 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Colin Angus Mackay17-Oct-07 3:38
Colin Angus Mackay17-Oct-07 3:38 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Herman<T>.Instance17-Oct-07 3:46
Herman<T>.Instance17-Oct-07 3:46 
QuestionHelp with a SELECT statement required pls. Pin
Steven J Jowett17-Oct-07 2:27
Steven J Jowett17-Oct-07 2:27 
AnswerRe: Help with a SELECT statement required pls. Pin
Colin Angus Mackay17-Oct-07 2:43
Colin Angus Mackay17-Oct-07 2:43 
GeneralRe: Help with a SELECT statement required pls. Pin
Michael Potter17-Oct-07 10:15
Michael Potter17-Oct-07 10:15 
GeneralRe: Help with a SELECT statement required pls. Pin
Colin Angus Mackay17-Oct-07 10:17
Colin Angus Mackay17-Oct-07 10:17 
GeneralRe: Help with a SELECT statement required pls. Pin
Michael Potter17-Oct-07 11:40
Michael Potter17-Oct-07 11:40 
GeneralRe: Help with a SELECT statement required pls. Pin
Steven J Jowett17-Oct-07 22:41
Steven J Jowett17-Oct-07 22:41 
QuestionDatatype for NULL Pin
N a v a n e e t h17-Oct-07 2:03
N a v a n e e t h17-Oct-07 2:03 
AnswerRe: Datatype for NULL Pin
Mike Dimmick17-Oct-07 2:22
Mike Dimmick17-Oct-07 2:22 
GeneralRe: Datatype for NULL Pin
N a v a n e e t h17-Oct-07 2:41
N a v a n e e t h17-Oct-07 2:41 
GeneralRe: Datatype for NULL Pin
Colin Angus Mackay17-Oct-07 2:45
Colin Angus Mackay17-Oct-07 2:45 
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 

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.