Popular Posts

SQLblog.com - The SQL Server blog spot on the web

Friday, February 23, 2018

sp_helpindex2

SQLblog.com - The SQL Server blog spot on the web
sp_helpindex2
--my extension of sp_helpindex: sp_helpindex2 USE master GO IF EXISTS ( SELECT * FROM sys . procedures WHERE object_id = OBJECT_ID ( 'sp_helpindex2' ) ) DROP procedure [dbo] . sp_helpindex2 GO CREATE PROCEDURE [dbo] . [sp_helpindex2] @objname nvarchar ( 776 ) AS DECLARE @objid int , @dbname sysname -- Check to see that the object names are local to the current database. select @dbname = parsename ( @objname , 3 ) if @dbname is null select @dbname = db_name () else if @dbname <> db_name () begin...(read more)

No comments: