Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to return boolean expression for this type

Author  Topic 

sateesh.sqldba
Starting Member

25 Posts

Posted - 2010-06-29 : 00:44:39
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go





ALTER PROCEDURE [dbo].[DCED_sp_GetReports_MultiVal_TEST]
(@rpt Integer = 0,@Col VARCHAR(100))
AS
BEGIN

DECLARE @RptNbr int
DECLARE @DataBaseCol varchar(50)


IF upper(@Col) like 'COLOPRDROPDOWN%'
BEGIN
SET @RptNbr = cast(substring(@Col,15,len(@Col)-14) as int)
-- SELECT field_id,TypeID FROM dbo.tbl_lk_Report_Columns WHERE ReportNbr = @RptNbr ORDER BY Field_ID
SELECT DisplayName,TypeID FROM dbo.tbl_lk_Report_Columns WHERE ReportNbr = @RptNbr ORDER BY DisplayName


SELECT ' ** Select **' as OperatorName, 'Select' as sqlStatement, @rpt as TypeID
UNION ALL
SELECT OperatorName,sqlStatement,TypeID FROM DCCKBSQLPRD01.Admin.dbo.tbl_lk_Search_Operators
ORDER BY OperatorName

SELECT ShowDistrict,ShowNotes,ShowFilter FROM dbo.tbl_ReportsList WHERE RepNo = @RptNbr

END
IF upper(@Col) like 'DATABASECOLUMN%'
BEGIN
SET @DataBaseCol = cast(substring(@Col,15,len(@Col)-14) as varchar(50))
SELECT field_id FROM dbo.tbl_report WHERE ReportNbr = @Rpt and DisplayName = @DataBaseCol
END


IF upper(@Col) = 'AllRecs'
BEGIN
return select distinct AgencyID as listVal from LiheapWap_Live.dbo.tgAgency --WHERE AgencyID in(1,2,3,5)
WHERE AgencyID between 1 and 44 order by AgencyID

END

i want to display all records with out condition and i have boolean expression 'is true','isnull' like that

sateesh
   

- Advertisement -