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 |
venkatakrishnan305
Starting Member
1 Post |
Posted - 2012-09-04 : 06:50:30
|
How to print venkat 100 times in sql by using store procedureplease help me..Thxvenkatakrishnan |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-04 : 07:07:38
|
Is something like this what you are looking for? If it can be batched, obviously the second one is shorter and sweeter.--1.declare @n int;set @n = 0;while (@n < 100)begin print 'something'; set @n = @n+1;end;--2print 'something'GO 100 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-09-04 : 08:26:44
|
select 'Venkat' from master..spt_values where type='p' and number between 1 and 100Sunita, you forgot that this is posted in 2000 forum and GO 100 wont workMadhivananFailing to plan is Planning to fail |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-04 : 08:40:06
|
Thanks Madhivanan!Everything I say about SQL 2000 are wild guesses - I don't have a SQL 2000 environment. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-09-04 : 10:07:07
|
quote: Originally posted by sunitabeck Thanks Madhivanan!Everything I say about SQL 2000 are wild guesses - I don't have a SQL 2000 environment.
Lucky you. I have to deal with 200, 2005, 2008 & 2008 R2 KH[spoiler]Time is always against us[/spoiler] |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-04 : 11:00:49
|
Lucked out Young company, born after SQL 2005 but before SQL 2008, so the oldest I have to deal with is SQL 2005. |
|
|
|
|
|