Rank: Newbie Groups: Member
Joined: 9/27/2007 Posts: 1 Points: 0 Location: UK
|
When run in the "new query" box, the code given returns no results, and no errors but when simply wrapped in an SP (called 'x' ) and run using:
exec x
all is fine! How come? What are the limitations of the "new query" box and the submit button?
TIA
James.
Here is the code (familiar from Query Analyser) -- DECLARE @RC int DECLARE @accessibleClinicCodes varchar(7000) DECLARE @startDate datetime DECLARE @endDate datetime DECLARE @healthBoardCode varchar(50) DECLARE @clinicCode varchar(50) DECLARE @clinicLocationId uniqueidentifier DECLARE @gpPracticeId uniqueidentifier DECLARE @advisorId uniqueidentifier SELECT @accessibleClinicCodes = 'J101' SELECT @startDate = NULL SELECT @endDate = NULL SELECT @healthBoardCode = NULL SELECT @clinicCode = NULL SELECT @clinicLocationId = NULL SELECT @gpPracticeId = NULL SELECT @advisorId = NULL EXEC @RC = [Smoking].[dbo].[extract_MinimumDatasetFilteredOptimised] @accessibleClinicCodes, @startDate, @endDate, @healthBoardCode, @clinicCode, @clinicLocationId, @gpPracticeId, @advisorId DECLARE @PrnLine nvarchar(4000) PRINT 'Stored Procedure: Smoking.dbo.extract_MinimumDatasetFilteredOptimised' SELECT @PrnLine = ' Return Code = ' + CONVERT(nvarchar, @RC) PRINT @PrnLine --
|
Rank: Administration Groups: Administration
Joined: 9/11/2006 Posts: 605 Points: 649 Location: Enghien Les Bains, France
|
I just run your T-SQL code, replacing line Code:EXEC @RC = [Smoking].[dbo].[extract_MinimumDatasetFilteredOptimised] @accessibleClinicCodes, @startDate, @endDate, @healthBoardCode, @clinicCode, @clinicLocationId, @gpPracticeId, @advisorId
by as i do not have your extract_MinimumDatasetFilteredOptimised sp. It worked fine. I got nothing in the Results tab and i got Quote:Stored Procedure: Smoking.dbo.extract_MinimumDatasetFilteredOptimised Return Code = 1 in the Messages tab which seems to be a normal behavior...
|