SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 print 100 times venkat
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

venkatakrishnan305
Starting Member

India
1 Posts

Posted - 09/04/2012 :  06:50:30  Show Profile  Reply with Quote
How to print venkat 100 times in sql by using store procedure

please help me..
Thx

venkatakrishnan

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/04/2012 :  07:07:38  Show Profile  Reply with Quote
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;

--2
print 'something'
GO 100
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 09/04/2012 :  08:26:44  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
select 'Venkat' from master..spt_values where type='p' and number between 1 and 100

Sunita, you forgot that this is posted in 2000 forum and GO 100 wont work

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/04/2012 :  08:40:06  Show Profile  Reply with Quote
Thanks Madhivanan!

Everything I say about SQL 2000 are wild guesses - I don't have a SQL 2000 environment.
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17643 Posts

Posted - 09/04/2012 :  10:07:07  Show Profile  Reply with Quote
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
Time is always against us

Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/04/2012 :  11:00:49  Show Profile  Reply with Quote
Lucked out

Young company, born after SQL 2005 but before SQL 2008, so the oldest I have to deal with is SQL 2005.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000