question

dbuyguy avatar image
dbuyguy asked

How do you pass a parameter in SSRS using a Parallel Data Warehouse as my datasource?

When I build a SSRS report against a PDW, the PARAMETERS will not work UNLESS they are explicit/hard-coded in my base code. Attached below is what I have tried: /* This works and gives results, but is NOT dynamic in nature. */ DECLARE @X nVARCHAR(2) SET @X = '2' SELECT [GovernanceStatusCodes].[Code] ,[GovernanceStatusCodes].[Name] FROM [GovernanceStatusCodes] WHERE [GovernanceStatusCodes].[Code] = @X *************************************************************************** /* This does not work and gives an error message Could not update a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct. [QID3186406]Must declare the scalar variable "@X". */ --DECLARE @X nVARCHAR(2) --SET @X = '2' SELECT [GovernanceStatusCodes].[Code] ,[GovernanceStatusCodes].[Name] FROM [GovernanceStatusCodes] WHERE [GovernanceStatusCodes].[Code] = @X ******************************************************************************* /* The report will execute, but does not bring back the expected results */ DECLARE @X nVARCHAR(2) --SET @X = '2' SELECT [GovernanceStatusCodes].[Code] ,[GovernanceStatusCodes].[Name] FROM [GovernanceStatusCodes] WHERE [GovernanceStatusCodes].[Code] = @X ********************************************************************************* For parameter @X, ALL that I have is a Default Value of '5' ********************************************************************************* What am I doing wrong?
ssrsparameters
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.