Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mrajakrishnan
Starting Member
3 Posts |
Posted - 2009-11-04 : 13:33:44
|
| Hi,I have a requirment like if i give a count value it should repeat the result that number of time.eg) If there is a variable @test='Raja'and if i give count as 5I need the result likeRajaRajaRajaRajaRajaThis i can do likewhile{i<6)beginselect @testi=i+1endBut without loop is it possible to get the result using simple SQL statment? |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-11-04 : 13:39:13
|
| [code]SELECT 'Raja'FROM master..spt_valuesWHERE type='p'AND number <= 5[/code] |
 |
|
|
|
|
|