|
|
-
|
|
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......
|
|
-
|
|
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......
|
|
-
|
|
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......
|
|
-
|
|
As a SQL server DBA many times you may get to hear from users that he is not able to access the database, SQL server or any of the objects in SQL server. This may sometimes that the user is passing a wrong credentials or may be is trying to connect to SQL server through some applications but due to ......
|
|
-
|
|
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......
|
|
-
|
|
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......
|
|
-
|
|
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......
|
|
-
|
|
Sometimes we come across situation where in the Entire Space in TempDB will be unallocated space but we are unable to free up space neither we are able to shrink the database or file. This was how I was able to Free Up the unallocated space and it worked for me. So thought of sharing it. USE TempDB......
|
|
-
|
|
/* 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......
|
|
-
|
|
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......
|
|