Number serial Generation
This script generates seril numbers (0, 1, 2, 3.4,,,)In this example I use 0 - 9999
2003-06-19
154 reads
This script generates seril numbers (0, 1, 2, 3.4,,,)In this example I use 0 - 9999
2003-06-19
154 reads
This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and […]
2003-06-19
648 reads
This function takes a decimal representation of a height value and returns a properly formatted string value. For example, a height of 5 feet 9 inches, which would be passed in as the decimal 5.90, would be returned as 5'9". Similarly, a height of 4 […]
2003-06-18
1,619 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,719 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,782 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
212 reads
Run this script against the database restored from other SQL Server database. It will solve the orphan users.
2003-06-12
781 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
258 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
104 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
415 reads
By Steve Jones
ochisia – n. the fear that the role you once occupied in someone’s life...
This is a quick blog post, mainly so I have the code available if...
Praise whatever deity you believe in, because it’s finally here, a tenant switcher for...
I've read lots of the horror stories about nested views in databases where they're...
Hello! How do I grant a user to read-write to a single database and...
When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?
See possible answers