Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Saturday, November 15, 2008

Store Procedure Example (Select Statement with Passed Query as Parameter)



Store Procedure Example (Select Statement with Passed Query as Parameter)
In this Example I Show how to Write Store Procedure for Search Engine. in @query parameter you need to pass full Filter Section. Below Shown Simple example.
CREATE PROCEDURE IDBadge_RptEmployeePointSummaryReport
@query varchar(200)
AS
declare @filter nvarchar(1000)
select @filter = '
select count(ep.uid) as tot,p.point_type_name
from
employee_point as ep,
point_type_master as p
where p.point_type_code = ep.point_type_code
and  0=0 ' + @query
+' group by point_type_name'
exec (@filter)
GO
                                              
This Store Procedure return Datatable So in Programming Side you Need to handle that Datatable.


PLEASE WRITE YOUR VIEW ON SP IN BELOW COMMENT BOX.



                 First page SP         Second Page SP         Third Page SP           Fourth Page SP

0 comments:

Post a Comment