Very easy way to fix ORPHAN users
Run this script against the database restored from other SQL Server database. It will solve the orphan users.
2003-06-12
797 reads
Run this script against the database restored from other SQL Server database. It will solve the orphan users.
2003-06-12
797 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
282 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
121 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
442 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,068 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
951 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
744 reads
This stored Procedure can be used to force restores the database by killing all the process running over this database.
2003-06-05
428 reads
Retrieve SQL Server port number from registry. Useful for SQL Servers running named instances or non-standard TCP port numbers.
2003-06-04
655 reads
In your tenure as a DBA/developer, you've probably been asked to write dozens of stored procedures similar to this:CREATE PROCEDURE ContactInfo@ContactID intASSELECT c.Name, a.Address, p.PhoneFROM Contact cLEFT JOIN ContactAddress aON c.ContactID = a.ContactIDLEFT JOIN ContactPhone pON c.ContactID = p.ContactIDWHERE c.ContactID = @ContactIDBut there is a more efficient way to write such a query.....particularly if you […]
2003-06-03
1,436 reads
I am excited to host T-SQL Tuesday for the first time. I want to...
By Steve Jones
Redgate had some Claude training recently, which I went through as my knowledge has...
By Steve Jones
gnossienne– n. the awareness that someone you’ve known for years still has a private...
Hi guys and gals, I've created a system that automatically allows you to "generate"...
Comments posted to this topic are about the item Demo Tracking Dropped Objects
Comments posted to this topic are about the item Randomly Selecting Columns and Rows...
If I want to return information about all Database Mail profiles on my instance from T-SQL, how can I do this?
See possible answers