Click here to Skip to main content
15,896,606 members
Home / Discussions / Database
   

Database

 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran30-Oct-09 2:20
chakran30-Oct-09 2:20 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Niladri_Biswas30-Oct-09 3:36
Niladri_Biswas30-Oct-09 3:36 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran30-Oct-09 4:06
chakran30-Oct-09 4:06 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
Niladri_Biswas30-Oct-09 5:11
Niladri_Biswas30-Oct-09 5:11 
GeneralRe: how to get week number and startday of the week in sql server 2008 Pin
chakran1-Nov-09 21:05
chakran1-Nov-09 21:05 
AnswerRe: how to get week number and startday of the week in sql server 2008 [modified] Pin
Niladri_Biswas29-Oct-09 22:30
Niladri_Biswas29-Oct-09 22:30 
Questiondatabase Pin
sydneylandscaper28-Oct-09 21:56
sydneylandscaper28-Oct-09 21:56 
AnswerRe: database Pin
WoutL28-Oct-09 22:48
WoutL28-Oct-09 22:48 
AnswerRe: database Pin
dan!sh 29-Oct-09 0:23
professional dan!sh 29-Oct-09 0:23 
AnswerRe: database Pin
Mycroft Holmes29-Oct-09 0:25
professionalMycroft Holmes29-Oct-09 0:25 
AnswerRe: database Pin
dxlee29-Oct-09 4:16
dxlee29-Oct-09 4:16 
AnswerRe: database Pin
dreamaway82029-Oct-09 5:46
dreamaway82029-Oct-09 5:46 
AnswerRe: database Pin
Eddy Vluggen29-Oct-09 9:29
professionalEddy Vluggen29-Oct-09 9:29 
QuestionThe Saga Continues Pin
Roger Wright28-Oct-09 21:45
professionalRoger Wright28-Oct-09 21:45 
QuestionHow to seperate records Pin
kKamel28-Oct-09 20:35
kKamel28-Oct-09 20:35 
AnswerRe: How to seperate records Pin
Mycroft Holmes29-Oct-09 0:14
professionalMycroft Holmes29-Oct-09 0:14 
GeneralRe: How to seperate records Pin
kKamel29-Oct-09 0:44
kKamel29-Oct-09 0:44 
GeneralRe: How to seperate records Pin
Mycroft Holmes29-Oct-09 2:01
professionalMycroft Holmes29-Oct-09 2:01 
QuestionRe: How to seperate records Pin
Eddy Vluggen29-Oct-09 12:03
professionalEddy Vluggen29-Oct-09 12:03 
Questionhow to add int Value Pin
getaccessyr28-Oct-09 4:04
getaccessyr28-Oct-09 4:04 
Create PROCEDURE [dbo].[WidgetServer_GetAllShopList_FR]
(
@CatalogID nvarchar(max),
@PageSize INT,
@PageIndex INT,
@NoOfPages INT OUTPUT
)
AS

DECLARE @StartRowIndex INT
DECLARE @Delimiter CHAR
DECLARE @iIndex SMALLINT
DECLARE @iCatalogId INT
DECLARE @iNoofPages INT
-- DECLARE @CatalogID nvarchar(max)
--DECLARE @PageSize INT
--DECLARE @PageIndex INT
--DECLARE @NoOfPages INT
-- SET @CatalogID='1,2,3';
-- SET @PageIndex = 1;
-- Set @PageSize = 5;

SET NOCOUNT ON;

SET @StartRowIndex= ((@PageIndex * @PageSize) + 1);



BEGIN
SET @Delimiter = ','

WHILE @CatalogID <> ''
BEGIN
SET @iIndex = CHARINDEX(@Delimiter, @CatalogID)

IF @iIndex > 0
BEGIN
SET @iCatalogId = LEFT(@CatalogID, @iIndex-1)
SET @CatalogID = RIGHT(@CatalogID, LEN(@CatalogID) - @iIndex)
END
ELSE
BEGIN
SET @iCatalogId = @CatalogID
SET @CatalogID = ''
END
BEGIN
SET @iNoofPages = (SELECT ISNULL((SELECT ((COUNT(*) / @Pagesize) + CASE WHEN (COUNT(*) % @Pagesize) > 0 THEN 1 ELSE 0 END)
FROM dbo.Shops INNER JOIN Folder ON Folder.ShopID = Shops.ShopID
INNER JOIN [Catalog] ON Catalog.CatalogID = Folder.CatalogID
WHERE Catalog.CatalogID = (@iCatalogId) AND dbo.Shops.[Status] = 1),0));



END


SELECT Distinct Shops.ShopName_FR as ShopName, Shops.ShopID,Catalog.CatalogID, Catalog.CatalogName_FR as CatalogName, Folder.FolderName_FR as Folder
FROM Catalog INNER JOIN
Folder ON Catalog.CatalogID = Folder.CatalogID INNER JOIN
Shops ON Folder.ShopID = Shops.ShopID Where Catalog.CatalogID = (@iCatalogId)





END





END


In this while looping first we will get NoofPages=4 and then 2
I need to add those to values and get in NoofPages

Can any one tell me how?

Yamuna
GeneralRe: how to add int Value Pin
Mycroft Holmes28-Oct-09 14:42
professionalMycroft Holmes28-Oct-09 14:42 
GeneralRe: how to add int Value Pin
getaccessyr28-Oct-09 22:10
getaccessyr28-Oct-09 22:10 
GeneralRe: how to add int Value Pin
Mycroft Holmes29-Oct-09 0:11
professionalMycroft Holmes29-Oct-09 0:11 
QuestionMSSQL SERVER Pin
MsmVc28-Oct-09 1:23
MsmVc28-Oct-09 1:23 
AnswerRe: MSSQL SERVER Pin
dan!sh 28-Oct-09 2:24
professional dan!sh 28-Oct-09 2:24 

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.