SQL Server Database Objects

This is a list of all the articles posted on this blog about SQL Server database objects.

Last Modified Date – Stored Procedure

Usually, several stored procedures will be provided to DBAs to deploy in the Production environment. Some of the existing stored procedures need to be replaced or sometimes the stored procedures are new to the environment. If the deployment process is not automated, it can cause some confusion in DBAs if the existing stored procedure is…

SQL Server – List-out Procedures, Functions, Triggers

In order to know which procedures, functions, and triggers exist in the database, the following queries can help you to find this out.: The below set of statements can be used to retrieve stored procedures and the number of parameters in it: Use [Test1] Go SELECT SPECIFIC_NAME, COUNT(PARAMETER_NAME) FROM INFORMATION_SCHEMA.PARAMETERS GROUP BY SPECIFIC_NAME The below…

Get Table Row Count And Used Size

The following query will help you in checking the total number of rows and the size of the table(s).  SELECTs.Name AS SchemaName,t.Name AS TableName,p.rows AS RowCounts,CAST(ROUND((SUM(a.used_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Used_MB,CAST(ROUND((SUM(a.total_pages) – SUM(a.used_pages)) / 128.00, 2) AS NUMERIC(36, 2)) AS Unused_MB,CAST(ROUND((SUM(a.total_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Total_MBFROM sys.tables tINNER JOIN sys.indexes…

Find a specific column from the database objects

There are many ways to find out a specific column from the database objects like Tables and stored procedures. 1) Red Gate’s SQL Search:This tool will be integrated into SQL Server Management Studio once installed. This will help in searching across multiple object types and multiple databases. 2) Using a query:The following query will find the…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s