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
 Old Forums
 CLOSED - General SQL Server
 Can u answer for this question ??????????
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

vass
Starting Member

12 Posts

Posted - 01/02/2007 :  00:39:39  Show Profile
Hi All,

I want solution for this problem . I have single record in my table but when i select , i want show record's n times WithOut DML operations.



Edited by - vass on 01/02/2007 06:25:34

SwePeso
Patron Saint of Lost Yaks

Sweden
29910 Posts

Posted - 01/02/2007 :  06:42:35  Show Profile  Visit SwePeso's Homepage
SELECT t.* FROM <YourTableNameHere> AS t
CROSS JOIN (SELECT Number FROM master..spt_values WHERE Name IS NULL AND Number BETWEEN 1 AND <YourNtimesValueHere>) x


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 01/02/2007 :  06:44:55  Show Profile  Send madhivanan a Yahoo! Message

1 Where do you want to show data?
2 What do you mean by i want show record's n times WithOut DML operations.?

Madhivanan

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

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 01/02/2007 :  08:36:33  Show Profile
quote:
Originally posted by vass

Hi All,

I want solution for this problem . I have single record in my table but when i select , i want show record's n times WithOut DML operations.






Since a SELECT statement is a DML statement, how would it be possible?



CODO ERGO SUM
Go to Top of Page

vass
Starting Member

12 Posts

Posted - 01/03/2007 :  00:58:51  Show Profile
quote:
Originally posted by Peso

SELECT t.* FROM <YourTableNameHere> AS t
CROSS JOIN (SELECT Number FROM master..spt_values WHERE Name IS NULL AND Number BETWEEN 1 AND <YourNtimesValueHere>) x


Peter Larsson
Helsingborg, Sweden



Thanks peter larsson
From Vass
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 01/03/2007 :  07:57:52  Show Profile  Send madhivanan a Yahoo! Message

But you didnt reply on the questions asked

Madhivanan

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

vass
Starting Member

12 Posts

Posted - 01/04/2007 :  01:14:17  Show Profile
quote:
Originally posted by Peso

SELECT t.* FROM <YourTableNameHere> AS t
CROSS JOIN (SELECT Number FROM master..spt_values WHERE Name IS NULL AND Number BETWEEN 1 AND <YourNtimesValueHere>) x


Peter Larsson
Helsingborg, Sweden



is there any other way to get this result without using the systables
because it affects not only performance and also the limited number only avalibale on the table.
Go to Top of Page

vass
Starting Member

12 Posts

Posted - 01/04/2007 :  01:29:16  Show Profile
quote:
Originally posted by madhivanan


1 Where do you want to show data?
2 What do you mean by i want show record's n times WithOut DML operations.?

Madhivanan

Failing to plan is Planning to fail



Assume table has only one record when select the record from the table i want show that record as many as i want .

create table test (no int ,name varchar(20))

insert test
select 1,'test'

i want show that reocrd five time's(dynamicaly) ...
select no,name from test

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 01/04/2007 :  07:39:59  Show Profile  Send madhivanan a Yahoo! Message
Can I know the reason why you want to replicate the rows?
And where do you want to show the replicated data?

Madhivanan

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

vass
Starting Member

12 Posts

Posted - 01/05/2007 :  07:01:06  Show Profile
quote:
Originally posted by madhivanan

Can I know the reason why you want to replicate the rows?
And where do you want to show the replicated data?

Madhivanan

Failing to plan is Planning to fail



i have an requirement that i want split single data based on the number user's enter the number in the front end ...

Edited by - vass on 01/05/2007 07:02:36
Go to Top of Page

mr_mist
Grunnio

United Kingdom
1870 Posts

Posted - 01/05/2007 :  07:05:24  Show Profile  Visit mr_mist's Homepage
This is post-processing, better suited to the application layer logic.

-------
Moo. :)
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 01/05/2007 :  07:41:18  Show Profile  Send madhivanan a Yahoo! Message
Then Do it in the front end is the correct answer

If you use front ends like VB6, try something like

For i=1 to Trim(textbox.text)
    Print Rs("column")
Next i


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000