Quando você restaura um banco ou 'atacha' ao seu servidor de outro servidor, pode ocorrer de o usuário que existe no banco não sincronizar com o login do SQL server anteriormente criado com DBO desse banco, então esse script faz exatamente isso, pega o SID do SQL e dá um UPDATE no SID do usuário […]
2005-09-06 (first published: 2005-08-30)
363 reads
This might not be the fastes script, in the world but it takes care of the McDonalds, O'Brian's, MacPherson's and the Jens-Michael's of the world.
2005-09-05 (first published: 2005-08-31)
294 reads
Many users during the process of insert or update get the following warning issued by SQL ServerWarning: The table 'TABLE NAME' has been created but its maximum row size (XXXX) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length […]
2005-09-02 (first published: 2005-08-25)
332 reads
An easy script that gives you the information of all non-system databases, its size and all the configuration options that you can get individually with DATABASEPROPERTYEX function.
2005-09-01 (first published: 2005-08-25)
1,112 reads
There are many ways to format dates, and rather that reinvent the wheel each time I've found it helpful to have a user defined function always available. As a function it of courses processes on each row, and to enable the most flexibility the formatting style is passed simply as a parameter. Year month and […]
2005-08-31 (first published: 2005-08-25)
469 reads
This script helps you synchronizing ALL orphaned database users to syslogins of the new database server. To run it, pass the target database name in on the first line.
2005-08-29 (first published: 2005-08-27)
694 reads
I made this Query because we fix databases localy on a workstation (we have no sql server) but when backup up the server they need to be deleted localy that could sometimes take a while.U can run this Query from the QA or ad it as a Job it's possible to run it from an […]
2005-08-26 (first published: 2005-08-19)
514 reads
This procedure will COPY an Enterprise Manager SINGLE DIAGRAM object between databases on a given SQL Server.This procedure takes in a source DB name, a Dest DB name, and the Diagram name.(Exec diagram_copy 'SOURCE_DB', 'DEST_DB', 'DIAGRAM NAME')This procedure DOES NOT have to be placed in either of the databases, you may run it from a […]
2005-08-25 (first published: 2005-08-22)
192 reads
This scripts creates a view which will returns all the indexes and columns covered in the index for all the tables in a database.It returns only the user created indexes. Removes the statistics created on table (where indid > 0).
2005-08-24 (first published: 2005-08-23)
202 reads
This script will remove all the spids from a particular and allow you restore a database to a different location. The path of dump can be local or remote. It is very useful for quickly restoring a copy of production for testing purposes.
2005-08-22 (first published: 2005-08-16)
969 reads