Kill All User Sessions
This script kills all the user sessions except its own.This T-SQL block can be converted into a stored procedure by adding following lines in the begining of the script - Create Proc Kill_Sessions As
2003-06-18
2,786 reads
This script kills all the user sessions except its own.This T-SQL block can be converted into a stored procedure by adding following lines in the begining of the script - Create Proc Kill_Sessions As
2003-06-18
2,786 reads
Ever wanted to look at some ini setting from a stored procedure? I tried several forums and found that none of them has a script to read ini files from stored procedures.So here is my script, works in SQL2000. For SQL7, replace table variables with temporary tables.
2003-06-17
1,901 reads
This is a port of the SPLIT function from Perl (or VBScript). It works the same way: pass a string anda separator, up to 4 characters long (you can change this),and the function returns a table with the elements.This version trims leading and trailling spaces of the elements, just for convenience.Example:SELECT strvalFROM master.dbo.SPLIT('a and b', […]
2003-06-13
244 reads
Run this script against the database restored from other SQL Server database. It will solve the orphan users.
2003-06-12
799 reads
This procedure allows you to search through all objects in all databases on your server for words/phrases in your object code. Very handy for cases in which, for example, a column name on a table has been changed and you need to search your entire server for any sprocs/views/etc. that might reference it.Syntax: [EXEC] sp_FindCodeStr […]
2003-06-10
286 reads
- a simple and handy script that finds what differences might exists between the fields in your database that have the same name.I was wondering why my execution plans where different for tables with the same field names and the same indexes,statistics etc... because the syetem was converting my fields in the WHERE statement. - […]
2003-06-08
123 reads
This script will search a specified string in the current database and return all the tables with their columns containing that string. SET @search_str variable with the string to be searched (max. length allowed = 1000 chrs)
2003-06-07
447 reads
You don't have to try and decipher what instance you are running. The extended stored procedure xp_instance_regread does all the functionality of xp_regread and automatically knows which instance in the registry it should look at.
2003-06-06
1,071 reads
This a script which creates stored procedures that can be executed adhoc or set as sql agent jobs to check the recovery status and generate full, differential or transaction log backupf for each database if the database recovery status is set to full. We have terabytes of data and set all production databases […]
2003-06-06
957 reads
2 steps:step 1 => create a table in master database called BlockCheckstep 2 => create the stored procedure in master called BLOCK_CHECK @database_name varchar(20)What SP does:- it gets the spid that is blocked + info about it (like what it does at the moment it is blocked)- it gets the spid that acts as a […]
2003-06-05
751 reads
By Steve Jones
My life has some crazy travel stretches for sure. Between speaking, office visits, customer...
In Part 1, we saw how ‘Vamana’ represents vectors as nodes, connects them with...
I’m excited to announce the release of a new open-source project that fully automates...
Comments posted to this topic are about the item Server-Level Table sizes
Comments posted to this topic are about the item Optional Parameter Plan Optimization in...
There is a table tmp_tab:
CREATE TABLE tmp_tab ( id int, val int );
INSERT INTO tmp_tab VALUES (1, 1), (2, NULL), (3, 3), (4, 4), (5, 5);You want to order the rows ids by the following expression:
ISNULL(val, id) + 1Which of the following queries produces the expected ordering and why? (Select all correct) See possible answers