INSERTING HUGE DATA in a Table to check PerformanceIssues.

CREATE TABLE TblNumbers
(ID int identity(1,1) primary key,Num INT)
go
;WITH N
AS
(
    select 0 as Num
 union all
 select 0
 union all
 select 0
 union all
 select 0
 union all
 select 0
 union all
    select 0
 union all
 select 0
 union all
 select 0
 union all
 select 0
 union all
 select 0--10
)
,Numbers AS
(
SELECT ROW_NUMBER()OVER(ORDER BY (SELECT 1))AS Rn
FROM N N1,--10rows
N N2,-->10*10=100
N N3,-->10*10*10=1000
N N4,---->10*10*10*10=10000
N N5,------>10*10*10*10*10=100000
N N6,--10*10*10*10*10*10=1000000
N N7,--10*10*10*10*10*10*10=10000 000
N N8,
N N9
)
INSERT INTO TblNumbers
(Num)
SELECT Rn
FROM Numbers
SELECT * FROM TblNumbers

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server