Posts grid page

Startup Times (Windows Server, SQL Server and DMV Stats)
October 7, 2015

It is often necessary to know when the SQL Server was last restarted and if the DMV's are accumulating since Continue reading

SQL Server Version
October 5, 2015
SET NOCOUNT ON; GO DECLARE @SQL_Version AS numeric(4,1); SELECT @SQL_Version = LEFT(CAST(SERVERPROPERTY('productversion') AS varchar), 4); SELECT CASE @SQL_Version WHEN 9 Continue reading
October 1, 2015

É comum que, durante a optimização de uma query, façamos a limpeza da cache do SQL Server para conseguirmos comprar Continue reading

My new template for Stored Procedure’s Header
September 10, 2015
/* ⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃⁃ [OBJECT NAME]: Object Name [DESCRIPTION]: Description [CODE BY]: Pedro Ferreira [NOTES]: more information: [INPUT PARAMETERS]: Continue reading
TempDB – Adding files and/or moving to another disk
August 11, 2015
USE master; GO /* How many tempdb data files should be created? */ SELECT CASE Continue reading
Find duplicated values on a table
July 18, 2015

With the next t-SQL statement you can find duplicate values in any table, just change the fields into the columns Continue reading

Logical Query Processing
July 14, 2015
This are the steps for query processing in SQL Server! Continue reading
Grant user permissions to create jobs in SQL Server
June 24, 2015
USE msdb; GO CREATE USER 'NewUser' FOR LOGIN 'ExistingLogin'; GO EXEC sp_addrolemember 'SQLAgentUserRole', 'NewUser'; GO Continue reading
Reducing Deadlocking Problems
June 12, 2015

Many different things can contribute to the cause of a deadlock in SQL Server. Below are some suggestions on how Continue reading