Click here to Skip to main content
15,913,722 members
Home / Discussions / Database
   

Database

 
QuestionSending Column Name From SP to C# App Pin
AmbiguousName28-Dec-11 1:04
AmbiguousName28-Dec-11 1:04 
AnswerRe: Sending Column Name From SP to C# App Pin
hypermellow28-Dec-11 2:03
professionalhypermellow28-Dec-11 2:03 
AnswerRe: Sending Column Name From SP to C# App Pin
AmbiguousName28-Dec-11 2:18
AmbiguousName28-Dec-11 2:18 
AnswerRe: Sending Column Name From SP to C# App Pin
Karthik Harve28-Dec-11 18:44
professionalKarthik Harve28-Dec-11 18:44 
AnswerAS Pin
Luc Pattyn28-Dec-11 23:41
sitebuilderLuc Pattyn28-Dec-11 23:41 
GeneralRe: AS PinPopular
SilimSayo29-Dec-11 4:44
SilimSayo29-Dec-11 4:44 
Questionhow to loop over results of a select statement ? Pin
yousefshokati27-Dec-11 19:40
yousefshokati27-Dec-11 19:40 
AnswerRe: how to loop over results of a select statement ? Pin
gvprabu27-Dec-11 21:25
gvprabu27-Dec-11 21:25 
Hi,

Check the following Script,

It will be use full for ur Query..........

SQL
SET NOCOUNT ON
-- Declaration
DECLARE @Employee TABLE(ID INT , EmpName  VARCHAR(40))
DECLARE @I INT, @Count INT, @Temp VARCHAR(50)

SET @I = 1
-- Data
INSERT INTO @Employee(ID,EmpName)
SELECT 123,'Prabu'
UNION ALL SELECT 234, 'Raja'
UNION ALL SELECT 236, 'Kartik'
UNION ALL SELECT 1234, 'Venkat'

-- TSQL Script
SELECT @Count=COUNT(*) FROM @Employee
PRINT '~~~~~~~~~~~~~~~~~'
PRINT 'Employee Details'
PRINT '~~~~~~~~~~~~~~~~~'
WHILE @I <= @Count
BEGIN
	WITH Emp AS 
	(
		SELECT row_number() OVER ( ORDER BY ID ) 'RowNum', ID, EmpName
		FROM  @Employee
	)
	SELECT  @Temp =CAST(ID AS VARCHAR) +' - '+EmpName 
	FROM Emp
	WHERE RowNum =@I
	PRINT @Temp
	SET	@I=@I+1
END
PRINT '~~~~~~~~~~~~~~~~~'
SET NOCOUNT OFF

AnswerRe: how to loop over results of a select statement ? Pin
jschell29-Dec-11 14:39
jschell29-Dec-11 14:39 
Questionhow to loop over results of a select statement ? Pin
yousefshokati27-Dec-11 19:39
yousefshokati27-Dec-11 19:39 
AnswerRe: how to loop over results of a select statement ? Pin
Shameel27-Dec-11 19:42
professionalShameel27-Dec-11 19:42 
AnswerRe: how to loop over results of a select statement ? Pin
PIEBALDconsult28-Dec-11 2:33
mvePIEBALDconsult28-Dec-11 2:33 
QuestionMicrosoft SQL Server 2008 R2 (between) Pin
Framework .l.27-Dec-11 16:59
Framework .l.27-Dec-11 16:59 
AnswerRe: Microsoft SQL Server 2008 R2 (between) Pin
R. Giskard Reventlov27-Dec-11 17:17
R. Giskard Reventlov27-Dec-11 17:17 
QuestionRe: Microsoft SQL Server 2008 R2 (between) Pin
Framework .l.27-Dec-11 17:21
Framework .l.27-Dec-11 17:21 
AnswerRe: Microsoft SQL Server 2008 R2 (between) Pin
thatraja27-Dec-11 17:46
professionalthatraja27-Dec-11 17:46 
AnswerRe: Microsoft SQL Server 2008 R2 (between) Pin
Shameel27-Dec-11 17:59
professionalShameel27-Dec-11 17:59 
QuestionFailed to open malformed assembly 'mscorlib' with HRESULT 0x80070008. Pin
yousefshokati26-Dec-11 19:41
yousefshokati26-Dec-11 19:41 
AnswerRe: Failed to open malformed assembly 'mscorlib' with HRESULT 0x80070008. Pin
Luc Pattyn26-Dec-11 23:52
sitebuilderLuc Pattyn26-Dec-11 23:52 
QuestionHelp in finding the differences in values across sub groups. Pin
aakar25-Dec-11 9:17
aakar25-Dec-11 9:17 
AnswerRe: Help in finding the differences in values across sub groups. Pin
SilimSayo29-Dec-11 10:36
SilimSayo29-Dec-11 10:36 
AnswerRe: Help in finding the differences in values across sub groups. Pin
datakeyword8-Feb-12 15:57
datakeyword8-Feb-12 15:57 
AnswerRe: Help in finding the differences in values across sub groups. Pin
datakeyword8-Feb-12 18:57
datakeyword8-Feb-12 18:57 
QuestionUsing where condition in Linked server with ms access in sql server. Pin
yesu prakash23-Dec-11 19:55
yesu prakash23-Dec-11 19:55 
AnswerRe: Using where condition in Linked server with ms access in sql server. Pin
coded00725-Dec-11 19:23
professionalcoded00725-Dec-11 19:23 

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.