Click here to Skip to main content
15,899,754 members
Home / Discussions / Database
   

Database

 
AnswerRe: String search problem in SQL Server Pin
The Man from U.N.C.L.E.1-Dec-09 2:28
The Man from U.N.C.L.E.1-Dec-09 2:28 
GeneralRe: String search problem in SQL Server Pin
hvgyufg28fh38tyr78hf1-Dec-09 2:30
hvgyufg28fh38tyr78hf1-Dec-09 2:30 
Questionselect statement to display name 1000 times Pin
arun_pk30-Nov-09 23:16
arun_pk30-Nov-09 23:16 
AnswerRe: select statement to display name 1000 times [modified] Pin
Niladri_Biswas30-Nov-09 23:27
Niladri_Biswas30-Nov-09 23:27 
GeneralRe: select statement to display name 1000 times Pin
arun_pk30-Nov-09 23:31
arun_pk30-Nov-09 23:31 
GeneralRe: select statement to display name 1000 times Pin
Niladri_Biswas30-Nov-09 23:35
Niladri_Biswas30-Nov-09 23:35 
GeneralRe: select statement to display name 1000 times Pin
arun_pk30-Nov-09 23:42
arun_pk30-Nov-09 23:42 
GeneralRe: select statement to display name 1000 times Pin
Niladri_Biswas30-Nov-09 23:52
Niladri_Biswas30-Nov-09 23:52 
A) With recursive cte approach

declare @t table(name varchar(50))
;with cte as
( select 1 as rn,'abcd' as data
union all
select rn+1, 'abcd' as data from cte where rn<1000)

insert into @t
select data from cte option (maxrecursion 0)

select * from @t


B) Xquery approach

declare @t table(name varchar(50))
DECLARE @x XML
SELECT @x =   REPLICATE ('<x>abcd</x>', 1000)
insert into @t
SELECT i.value('.', 'VARCHAR(MAX)') ReplacedStrings
		FROM @x.nodes('//x') x(i)
		
select * from @t

Smile | :)

Niladri Biswas

GeneralRe: select statement to display name 1000 times Pin
arun_pk1-Dec-09 0:20
arun_pk1-Dec-09 0:20 
AnswerRe: select statement to display name 1000 times Pin
Blue_Boy30-Nov-09 23:38
Blue_Boy30-Nov-09 23:38 
GeneralRe: select statement to display name 1000 times Pin
arun_pk30-Nov-09 23:42
arun_pk30-Nov-09 23:42 
AnswerRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 0:09
Ashfield1-Dec-09 0:09 
GeneralRe: select statement to display name 1000 times Pin
arun_pk1-Dec-09 0:22
arun_pk1-Dec-09 0:22 
GeneralRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 0:25
Ashfield1-Dec-09 0:25 
GeneralRe: select statement to display name 1000 times Pin
Shameel1-Dec-09 7:05
professionalShameel1-Dec-09 7:05 
GeneralRe: select statement to display name 1000 times Pin
Mycroft Holmes1-Dec-09 17:04
professionalMycroft Holmes1-Dec-09 17:04 
GeneralRe: select statement to display name 1000 times Pin
Ashfield1-Dec-09 21:37
Ashfield1-Dec-09 21:37 
GeneralRe: select statement to display name 1000 times Pin
Mycroft Holmes1-Dec-09 21:55
professionalMycroft Holmes1-Dec-09 21:55 
QuestionHow to Group By all columns but have Rollup only on few columns Pin
guydebell30-Nov-09 23:10
guydebell30-Nov-09 23:10 
AnswerRe: How to Group By all columns but have Rollup only on few columns [modified] Pin
Niladri_Biswas30-Nov-09 23:33
Niladri_Biswas30-Nov-09 23:33 
GeneralRe: How to Group By all columns but have Rollup only on few columns Pin
guydebell1-Dec-09 1:05
guydebell1-Dec-09 1:05 
QuestionHow to connect/disconnect users in sql server. Pin
Ashish Kumar Vyas30-Nov-09 20:13
Ashish Kumar Vyas30-Nov-09 20:13 
AnswerRe: How to connect/disconnect users in sql server. Pin
Ashfield30-Nov-09 20:57
Ashfield30-Nov-09 20:57 
Questioninserting multiple rows Pin
arun_pk30-Nov-09 18:07
arun_pk30-Nov-09 18:07 
AnswerRe: inserting multiple rows Pin
_Damian S_30-Nov-09 18:18
professional_Damian S_30-Nov-09 18:18 

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.