SQL server Simplest data loading script

Posted By Sagar Patil

T-SQL script to add a server load . I have used this script to test backup timings, replication latency. One run of following procedure incerased log fie to 8GB and datafile to 6GB

use subscriber_A
go

if exists (select * from sysobjects where name = ‘Load_Data’)
drop table Load_Data
go
create table Load_Data (
x int not null,
y char(896) not null default (”),
z char(120) not null default(”)
)
go
insert Load_Data (x)
select r
from
(
select row_number() over (order by (select 1)) r
from master..spt_values a, master..spt_values b
) p
where r <= 4000000
go
create clustered index ix_x on Load_Data (x, y)
with fillfactor=51
go

Leave a Reply

You must be logged in to post a comment.

Top of Page

Top menu