I am working on a report in SSRS, I can input the parameter value and obtain results. What I want though, for example is to list all servers if I enter 'all' or to list the specific server that I enter.
Is this a TSQL change? Or a change in SSRS parameter settings? Anyone have suggestions on how to accomplish this?
Here is what I tried:
DECLARE @p_ServerName varchar(10) = 'all'
DECLARE @p_Env nvarchar(10)
DECLARE @p_EnvCat nvarchar(10)
SELECT BlockSize, BootVolume, Compressed, SystemName = @p_ServerName, Label, Caption, PageFilePresent,
[dbo].[CCS_DIGITAL_STORAGE_CONVERTER]('B', 'GB', Capacity) AS Capacity,
[dbo].[CCS_DIGITAL_STORAGE_CONVERTER]('B', 'GB', FreeSpace) AS [Free Space],
[dbo].[CCS_DIGITAL_STORAGE_CONVERTER]('B', 'GB', Capacity - FreeSpace) AS [Used Space],
100 * FreeSpace / Capacity AS [Free Space %],
[CLE_ENV_SHORT], [CLE_ENV_CAT_SHORT]
FROM CCS_Win32_Volume, [dbo].[CCS_V_SERVER_INSTANCE_DETAILS]
WHERE (@p_ServerName = SystemName) OR (@p_ServerName = 'all')
AND [CLE_ENV_SHORT] = @p_Env
AND [CLE_ENV_CAT_SHORT] = @p_EnvCat
with the paramter hardcoded with all, i should be seeing all results right? Yet I get no results returned.