|
|
-
|
|
As a DBA we often need to get information on various Queries, One of them is how expensive it is. A query can be judged as expensive on various criteria’s like Long Running, Memory Utilization, CPU utilization etc. I came up with this Stored Procedure which gives you Expensive Queries based on crit......
|
|
-
|
|
Purging your MSDB Job History is sometime very important which helps you read the Jos history in GUI very easily and keeps which only required number of days. You can add this in your Maintenance Plan or using a SSIS Package. I found one of the way a Stored Procedure to do the same. This Procedure a......
|
|
-
|
|
There are number of occasions where we need to get to know the SQL Server service start date time and also from what time the SQL Services are up and running generally termed as Uptime. There are many ways to do it like check for temp DB Creation time, using DMF sys.dm_io_virtual_file_stats etc. Bel......
|
|
-
|
|
Couple of day back i was working on something very important which will run some stored procedures to accomplish the task. Now there can be many transactions or different piece of codes in a Stored Procedure. Now just think that you come across a weird situation where you are not getting your result......
|
|
-
|
|
I was working on database design stuff and came across a situation where in i had to get all the primary keys existing in database for all tables and the primary key columns and column details. It would be very had and insane to go into each table and search for PK and its data. So i came up with th......
|
|
-
|
|
/* SQL Script to Create Roles, Schemas and users to the same */
--Creation of Database Role and Adding User's begin
USE [YOURDATABASENAME]
GO
CREATE ROLE [YOURROLENAME]
GO
--Adding Users Begin
EXEC sp_addrolememberN'YOURROLENAME', N'USERNAME1'
GO
EXEC sp_addrolem......
|
|
-
|
|
Often we come across situation where we need to group data from
multiple rows into single row. E.g.: An Employee works for multiple
projects, so in this case if columns are EMPLOYEE_NAME,
PROJECT_DURATION, PROJECTS_WORKED and think that employee works for 10
projects. Then you would have 1......
|
|
-
|
|
SQL Server Agent Proxies are very helpful in executing some jobs. I had came across a situation where in I was scratching my head so as to how to accomplish a task which I wanted to run as SQL server Agent Job. First let me give some brief description about proxies. SQL Server Agent uses proxies to......
|
|
-
|
|
The SQL server Jobs which are running on a Instance are very Important. As a DBA you need to take care of these Jobs and have all information about the Job. Your will get information on Jobs is SysJobs but again not in the way you want. So just thought of pulling the Job information and below is the......
|
|
-
|
|
As a DBA you always need to monitor various metrics of a Database server. Disk space is one such metric you gotta watch out for. Monitoring Disk space for SQL server 2000 is bit difficult through script. Just happened to write a Script for SQL server 2000 which gives you free disk space in GB for al......
|
|