Click here to Skip to main content
15,889,096 members
Home / Discussions / Database
   

Database

 
AnswerRe: select in star schema Pin
Mycroft Holmes14-Apr-12 22:56
professionalMycroft Holmes14-Apr-12 22:56 
GeneralRe: select in star schema Pin
mrx10014-Apr-12 23:05
mrx10014-Apr-12 23:05 
GeneralRe: select in star schema Pin
Mycroft Holmes15-Apr-12 13:50
professionalMycroft Holmes15-Apr-12 13:50 
AnswerRe: select in star schema Pin
Bernhard Hiller15-Apr-12 22:00
Bernhard Hiller15-Apr-12 22:00 
Questionselect in star schema Pin
mrx10014-Apr-12 22:34
mrx10014-Apr-12 22:34 
QuestionCombobox in datagrid Pin
Member 828136613-Apr-12 6:19
Member 828136613-Apr-12 6:19 
AnswerRe: Combobox in datagrid Pin
Mycroft Holmes13-Apr-12 12:58
professionalMycroft Holmes13-Apr-12 12:58 
QuestionPaging in SQL Pin
Billa212-Apr-12 20:46
Billa212-Apr-12 20:46 
This is my Query i want to implement paging where i will get the page size as a parameter from UI..How do i implement paging in this query..Plz any one Help..


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go



-- =============================================
-- Author: <ragesh nair="">
-- Create date: <11/04/2012>
-- Description: <search>
-- =============================================
--exec iSRPDb_Sp_Search_WO 1,0,'0','T',10,1
--select * from tblProject where ProjectID=13849
--select * from tblProject where ProjectID=22412
--select * from tblProject where ProjectCode='B20904'
--select * from tblSubContractor where SubContractorID=88420
--select top 10* from tblWorkOrderHeader where ProjectID=22412

ALTER PROCEDURE [dbo].[iSRPDb_Sp_Search_WO]
@pBusinessUnitID as int=0,
@pProjectID as int,
@pSubcontractorID as int,
@pWONumber as varchar(10),
@PageSize as int

AS
BEGIN
SET NOCOUNT ON;

DECLARE @BusinessUnitFilter Varchar(255)
DECLARE @NameFilter Varchar(255)
DECLARE @SubConNameFilter Varchar(255)
DECLARE @WONumFilter Varchar(255)
DECLARE @Filter Varchar(2000)
DECLARE @StatusFilter VARCHAR(255)
DECLARE @PageNumber int
DECLARE @RowStart int
DECLARE @RowEnd int
DECLARE @condition varchar(255)
SET @StatusFilter=''


--if @PageNumber > 0
--
-- SET @PageNumber = @PageNumber -1
-- SET @RowStart = @PageSize * @PageNumber + 1;
-- SET @RowEnd = @RowStart + @PageSize - 1 ;

IF @pBusinessUnitID > 0
SET @BusinessUnitFilter = 'TWO. BusinessUnitID=' + Convert(Varchar(10),@pBusinessUnitID)
ELSE
SET @BusinessUnitFilter = ''

IF LTRIM(RTRIM(@pProjectID)) > 0
SET @NameFilter = ' AND TP.ProjectID =' + Convert(Varchar(255),@pProjectID)
ELSE
SET @NameFilter = ''
IF LTRIM(RTRIM(@pSubcontractorID)) > 0
SET @SubConNameFilter = ' AND TS.SubcontractorID =' + Convert(Varchar(255),@pSubcontractorID)
ELSE
SET @SubConNameFilter = ''

If ltrim(rtrim(@pWONumber))<> ''
Set @WONumFilter = 'AND TWO.WONumber LIKE ''%' + @pWONumber + '%'''
Else
Set @WONumFilter = ''

SET @FILTER =@StatusFilter + @BusinessUnitFilter + @NameFilter + @SubConNameFilter + @WONumFilter







exec('select
TWO.WONumber,
TS.Name AS SubcontractorName,
TP.ProjectCode,
TP.Description as ProjectName ,
TP.StartDate,
TP.EndDate,
ROW_NUMBER() OVER(order by TP.Description) as RowNO



from tblWorkOrderHeader TWO inner join
tblWorkOrderDetail TWOD on TWO.WONumber= TWOD.WONumber
inner join tblSubContractor TS on TWO.SubContractorID= TS.SubContractorID
inner join tblProject TP on TWO.ProjectID=TP.ProjectID
where ' + @FILTER)

end

--select * from tblProject where ProjectID=20101
--select * from tblSubContractor where SubContractorID=110244
--where (@subconid = 0 or @subconid = aa.subcontractorid)
AnswerRe: Paging in SQL Pin
cjb11013-Apr-12 0:43
cjb11013-Apr-12 0:43 
GeneralRe: Paging in SQL Pin
Billa213-Apr-12 15:12
Billa213-Apr-12 15:12 
AnswerSQL Server script to find table dependencies Pin
jujiro12-Apr-12 8:36
jujiro12-Apr-12 8:36 
GeneralRe: SQL Server script to find table dependencies Pin
PIEBALDconsult12-Apr-12 8:57
mvePIEBALDconsult12-Apr-12 8:57 
GeneralRe: SQL Server script to find table dependencies Pin
jujiro12-Apr-12 9:06
jujiro12-Apr-12 9:06 
GeneralRe: SQL Server script to find table dependencies Pin
PIEBALDconsult12-Apr-12 9:08
mvePIEBALDconsult12-Apr-12 9:08 
GeneralRe: SQL Server script to find table dependencies Pin
Chris Meech13-Apr-12 2:46
Chris Meech13-Apr-12 2:46 
GeneralRe: SQL Server script to find table dependencies Pin
Eddy Vluggen12-Apr-12 9:03
professionalEddy Vluggen12-Apr-12 9:03 
GeneralRe: SQL Server script to find table dependencies Pin
Mycroft Holmes13-Apr-12 0:46
professionalMycroft Holmes13-Apr-12 0:46 
AnswerRe: SQL Server script to find table dependencies Pin
Eddy Vluggen13-Apr-12 1:30
professionalEddy Vluggen13-Apr-12 1:30 
GeneralRe: SQL Server script to find table dependencies Pin
Mycroft Holmes13-Apr-12 4:25
professionalMycroft Holmes13-Apr-12 4:25 
GeneralRe: SQL Server script to find table dependencies Pin
Mycroft Holmes13-Apr-12 0:49
professionalMycroft Holmes13-Apr-12 0:49 
GeneralRe: SQL Server script to find table dependencies Pin
jujiro13-Apr-12 2:01
jujiro13-Apr-12 2:01 
GeneralRe: SQL Server script to find table dependencies Pin
Mycroft Holmes13-Apr-12 4:22
professionalMycroft Holmes13-Apr-12 4:22 
GeneralRe: SQL Server script to find table dependencies Pin
jujiro13-Apr-12 4:55
jujiro13-Apr-12 4:55 
GeneralRe: SQL Server script to find table dependencies Pin
Mycroft Holmes13-Apr-12 12:54
professionalMycroft Holmes13-Apr-12 12:54 
Questioncan not get union recordset from two Sql Server2K store procedure Pin
Zhenjie Fu11-Apr-12 22:28
Zhenjie Fu11-Apr-12 22:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.