Click here to Skip to main content
15,914,444 members
Home / Discussions / Database
   

Database

 
QuestionHow to Find the Full Text Catalog Creation Time Pin
Vasanth Thangasamy30-Nov-06 1:30
Vasanth Thangasamy30-Nov-06 1:30 
QuestionSQL Server 2005 Basics Pin
crazy_mads30-Nov-06 0:22
crazy_mads30-Nov-06 0:22 
AnswerRe: SQL Server 2005 Basics Pin
Frank Kerrigan30-Nov-06 0:53
Frank Kerrigan30-Nov-06 0:53 
AnswerRe: SQL Server 2005 Basics Pin
Pete O'Hanlon30-Nov-06 1:01
mvePete O'Hanlon30-Nov-06 1:01 
QuestionSQL query Pin
walalawll29-Nov-06 21:27
walalawll29-Nov-06 21:27 
AnswerRe: SQL query Pin
Pete O'Hanlon29-Nov-06 22:36
mvePete O'Hanlon29-Nov-06 22:36 
GeneralRe: SQL query Pin
walalawll29-Nov-06 22:41
walalawll29-Nov-06 22:41 
AnswerRe: SQL query Pin
Eric Dahlvang30-Nov-06 6:58
Eric Dahlvang30-Nov-06 6:58 
You could do something like this:
CREATE FUNCTION GetNames (@cClass varchar(2))  
RETURNS  varchar(1000) AS  
BEGIN 

DECLARE @cClassNames  varchar(1000)
DECLARE @cClassName varchar(50)

SELECT @cClassNames = ''

DECLARE  namecursor CURSOR FOR 
SELECT DISTINCT Name 
FROM classtable
WHERE Class = @cClass

OPEN namecursor
FETCH NEXT FROM namecursor INTO @cClassName 
WHILE @@FETCH_STATUS = 0
BEGIN
	select @cClassNames = @cClassNames +  @cClassName +'/' 
	FETCH NEXT FROM namecursor INTO @cClassName  
END

CLOSE namecursor
DEALLOCATE namecursor
RETURN(@cClassNames)
END


Call it like this:
select class, dbo.GetNames(class) as [Full List] from (select distinct class from classtable) as tbl


--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: SQL query Pin
Pete O'Hanlon30-Nov-06 9:05
mvePete O'Hanlon30-Nov-06 9:05 
GeneralRe: SQL query Pin
walalawll30-Nov-06 13:44
walalawll30-Nov-06 13:44 
Questiondatabase access design Pin
alashara29-Nov-06 21:19
alashara29-Nov-06 21:19 
AnswerRe: database access design Pin
Colin Angus Mackay29-Nov-06 22:10
Colin Angus Mackay29-Nov-06 22:10 
Questioni want to know the existing view of the base table(urgent help me) Pin
kumar2129-Nov-06 19:49
kumar2129-Nov-06 19:49 
AnswerRe: i want to know the existing view of the base table(urgent help me) Pin
Colin Angus Mackay29-Nov-06 22:15
Colin Angus Mackay29-Nov-06 22:15 
QuestionHow can use NOT IN query Pin
swguy2329-Nov-06 19:35
swguy2329-Nov-06 19:35 
AnswerRe: How can use NOT IN query Pin
Colin Angus Mackay29-Nov-06 22:16
Colin Angus Mackay29-Nov-06 22:16 
QuestionWhat is FillFactor? How it it will help to increase the Performance? Pin
Vasanth Thangasamy29-Nov-06 19:12
Vasanth Thangasamy29-Nov-06 19:12 
AnswerRe: What is FillFactor? How it it will help to increase the Performance? Pin
Rob Graham30-Nov-06 14:45
Rob Graham30-Nov-06 14:45 
QuestionCan we pass parameters into trigerrs? Pin
lavanya_satheesh29-Nov-06 17:37
lavanya_satheesh29-Nov-06 17:37 
AnswerRe: Can we pass parameters into trigerrs? Pin
Pete O'Hanlon29-Nov-06 22:49
mvePete O'Hanlon29-Nov-06 22:49 
GeneralRe: Can we pass parameters into trigerrs? Pin
lavanya_satheesh30-Nov-06 20:46
lavanya_satheesh30-Nov-06 20:46 
QuestionSQL Reporting Server 2000 Pin
satishrg29-Nov-06 8:31
satishrg29-Nov-06 8:31 
QuestionThe Vanishing Data Trick Pin
Karma3125129-Nov-06 7:04
Karma3125129-Nov-06 7:04 
JokeRe: The Vanishing Data Trick Pin
ChandraRam29-Nov-06 22:47
ChandraRam29-Nov-06 22:47 
AnswerRe: The Vanishing Data Trick Pin
Pete O'Hanlon30-Nov-06 1:24
mvePete O'Hanlon30-Nov-06 1: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.