Microsoft
Software
Hardware
Network
Question : Create a 2 column table from sql based on qty...
Hi Experts,
Is it possible to create a script that will do the following...
Row Record
1 1
2 2
3 2
4 3
5 3
6 3
7 4
8 4
9 4
10 4
I would love to get his to 5000 records ...any thoughts??
Answer : Create a 2 column table from sql based on qty...
Sorry I read 5000 as 1000
;with cte(n,i,j) as (
select 1,1,1
union all
select
n+1,
case when j=1 then i+1 else i end,
case when j=1 then i+1 else j-1 end
from cte
where n < 5000
)
select n,i
from cte
option (maxrecursion 5000)
Random Solutions
Auto Send Excel as Email Attachment
Congratulations to new Excel Genius: teylyn
Give public access to our wireless network?
Microsoft PKI Design
Use different HTTP Redirects on multiple virtual directories in IIS 7.5
do you need sysprep with Symantec Ghost Solution Suite 2.5?
Free software to scan, crop 4 areas, save to .tif file with transparent background?
ODBC connect to ORACLE 11G using Redhat Linux 5.4
How to print the contents of a listbox
How to configure Remote SPAN or alternative option on HP Procurve 2626-PWR switch ?