|
|
-
|
|
In replication, we need to add objects as articles to replicate the data to different server.The important point is here that if we have any reference(foreign keys) associated with the articles(tables choosen to be replicated), then we need to consider the parant table also to add as article, Or the......
|
|
-
|
|
The below procedure will return the size occupied by the indexes in a table. This will be helpful to measure the size before and after the maintenance activities.
Create Proc SQLZealot_FindIndexSize( @OBJECT_NAME VARCHAR(255) )
As
Begin
DECLARE @temp TABLE
(
indexID BIGINT,
......
|
|
-
|
|
I have come across many times in a situation that I need to check the existence of a procedure in multiple databases in a given server.
Hope, this would help you guys too...
Create Proc SQLZealot_FindProcInDBs (@ProcName Varchar(500))
As
BEGIN
Create Table #TempDBNames (ID int identity(1,1)......
|
|
-
|
|
It is often a requirement to understand the size of indexes on a table.
Here is a script shared by one of my friend at my workspace... looks very useful!!!
DECLARE @OBJECT_NAME VARCHAR(255) = 'trn_defect_tracking_history';
DECLARE @temp TABLE
(
indexID BIGINT,
......
|
|
-
|
|
The below script provides a complete possible information on a table.
/*
First Resultset(Table Information)
Table Name
ObjectId
Table Type
Is replicated table or not
Row count of the table
Second Resultset(Column information)
Third Resultset(Index Information)
Name, Id, Seeks, scans, upda......
|
|
-
|
|
Identity saturation is one of a major check we need to have as a DBA for a big projects.The below script would detail the curretn identity and the percentage used for all table objects of a database.
SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + '.' + QUOTENAME(t.name) AS TableName,
c.name AS Co......
|
|
-
|
|
Just thought of sharing an information about how to hide/show tables from your object explorer. The below query has to cut and paste in your query and “CNTRL+SHIFT+M” to input your parameters. One more thing… CNTRL+SHIFT+M work like a programming language giving us an opportunity ......
|
|
-
|
|
Blocking and locking is a main area for performance tuning and to ensure a good health of production system. Here is a script to notify DBAs about the locking occurs in the production system.It uses service brokers to notify the lock information.
As a first step, we need to set a threshold value fo......
|
|
-
|
|
Here is a script for finding out the calculating the work days (excluding the saturdays and sundays). The script can be altered also to accomodate local holidays in a separate table too. Only thing is to substract the count of the table for that period.
Declare @StartDate Date, @EndDate Date
Se......
|
|
-
|
|
<p>
I am certain some of us would have really come across a situation that the spaces
between data becomes annoying and needs to be removed on request. Many of the solutions
have come across multiple blogs and sites with while loop or cursor was really made
to th......
|
|