SQL – Get Procedure/Function/Trigger Name

Problem:
When I write any procedure for UI functionality, I may require to throw the Procedure Name to UI if any error occurs, This will help people to identify/Isolate the bug if occured
Also I Dont want to hard code the procedure name in the SPs because sometime I/someone may change the SP Name in future.
How can I prevent such a basic mistake as well as use a consistent process?
Continue Reading

How To: Lists Linked Server

The following Stored procedure will returns the list of linked servers defined in the server in which we are executing it.

sp_linkedservers

This procedure will return the following informations about the linked server
Column name
Data type
Description
SRV_NAME
sysname
Name of the linked server.
SRV_PROVIDERNAME
nvarchar(128)
Friendly name of the OLE DB provider managing access to the specified linked server.
SRV_PRODUCT
nvarchar(128)
Product name of the linked server.
SRV_DATASOURCE
nvarchar(4000)
OLE DB data source property corresponding to the specified linked server.
SRV_PROVIDERSTRING
nvarchar(4000)
OLE DB provider string property corresponding to the linked server.
SRV_LOCATION
nvarchar(4000)
OLE DB location property corresponding to the specified linked server.
SRV_CAT
sysname
OLE DB catalog property corresponding to the specified linked server.

Or… you can use following SQL Scripts to lists all linked servers

select * from master..sysservers
Hope this helps!

Powered by WPeMatico

1

How to upgrade a SQL Server 2012 RTM Evaluation Edition server to a Licensed edition

This article provides a step-by-step instruction on how to upgrade a SQL Server 2012 RTM Evaluation Edition server to a BI edition. Similar steps can be used to upgrade to any other licensed editions, Developer/Standard/Enterprise.

Changing the edition from the Evaluation edition to another one does not require building and migrating to a new server with the intended edition. As the Evaluation edition is a 180-day trial edition of Enterprise edition, there can be some issues when changing the edition to a non-Enterprise edition due to incompatible features used. This article assumes that the features used in the sample SQL Server instance with the Evaluation edition are non-Enterprise only features.

Continue Reading