Tech Tips

219,377pages on
this wiki
Add New Page
Discuss this page0 Share
  1. !perl -w

if ( $#ARGV == 2 )


print "$ARGV[0]\n";

print "$ARGV[1]\n";

print "$ARGV[2]\n";


else { die ( "Usage :: perl qsplit.sql <queryfile> <inputfile> <splitrows> \n" );


my $queryfile = $ARGV[0];

my $inputlist = $ARGV[1];

my $splitcount = $ARGV[2];

my $outputfile = "qout.txt";

open ( QRY, "$queryfile" ) || die "Can Not open $queryfile :$!\n";

open ( INPT, "< $inputlist" ) || die "Can Not open $inputlist :$!\n";

open ( OUT, "> $outputfile" ) || die "Can Not open $outputfile :$!\n";

my $rowcount = 0;

my @query=<QRY>;

print "Query : @query\n";

while ( <INPT> ) { $rowcount++;

if ( $rowcount == 1 ) {

 print OUT "@query" . $_;

} elsif ( ($rowcount % $splitcount ) == 0 ) {

 s/,/ ) UNION @query /g;
  print OUT $_;

} else {

print OUT $_;

} }

print OUT ")";

perl -lane "s/^/UNION select * from table where id in ( /g if $.%1000==0;print $_" my.txt > fmt.txt

perl -lane "s/,$/)/g if (($.%1000)-999)==0;print $_" fmt.txt > fmt.txt

bcp tempdb..plus_change in plus_change.txt -c -b200 -t -S<server> -U user -P password

details of column


COLUMN_NAME,data_type,character_maximum_length from information_schema.columns WHERE TABLE_NAME = 'referral'

Table from coulmn

SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name =

sp_helpsegment logsegment

select * from master..sysprocesses where spid in (select blocked from master..sysprocesses where blocked > 0)

sp_dba_w active – for blocking proces

sp_dba_lock – for locks

price..sp_space total – space usage.

sp_lock - The class column will display the cursor name for locks associated with a cursor for the current user and the cursor id for other users.

select * from syslogshold where spid > 0


sp_showplan 576,null,null,null

dbcc sqltext() you can also use this command to get see whats is happening in a block you can do this by

use master go select * from syslogshold this will find the longest running transaction. go dbcc traceon(3604) go dbcc sqltext (104) go

Incident Summary:

Incident Timeline Summary:

Minutes of the Post Mortem Meeting:

Root Cause:


Was the best resolution chosen?

How can future similar incidents be avoided?

Can RTB improve handling of the incident?

Action Points: 'Attendees:

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random wikia