Home » TSQL (Page 4)

Category Archives: TSQL

DMV-1 : Who All Are connected ? …. sys.dm_exec_connections

The sys.dm_exec_connections DMV (Dynamic Management View) is represented by Books Online (BOL) as follows : http://msdn.microsoft.com/en-us/library/ms181509.aspx Returns information about the connections established to this instance of SQL Server and the details of each connection. sys.dm_exec_connections is the most common DMV used to get connection details. We will get details info regarding every connection like protocol … Continue reading

Refresh Intellisense in SSMS(SQL Server Management Studio) 2008 & above

Intellisense is a new feature that comes with SSMS(SQL Server Management Studio) 2008 onwards. Intellisense makes coding quite easy. But Sometimes I find that intellisense becomes stale and you start getting the wavy red lines when writing code. Even though object exists in database but Intellisense is not able to recognize it. Refreshing the cache … Continue reading

Microsoft SQL Server License Helpline

Microsoft SQL Server license has lots of flavors in terms of user based \ CAL or processor based license, license based on versions or license based on environment (physical or virtual). Although, Microsoft release license guidelines for each & every SQL server version. But there are more complex scenarios for licensing then we think. Best … Continue reading

How to find/modify SQLServer Agent logfile location?

1. To get the location of SQLServer Agent log file, the log file is called SQLAGENT.out DECLARE @AGENT_ERRORLOG NVARCHAR(255) EXECUTE MASTER.DBO.XP_INSTANCE_REGREAD N’HKEY_LOCAL_MACHINE’, N’SOFTWAREMICROSOFTMSSQLSERVERSQLSERVERAGENT’, N’ERRORLOGFILE’, @AGENT_ERRORLOG OUTPUT, N’NO_OUTPUT’ SELECT @@SERVERNAME SERVERNAME, @AGENT_ERRORLOG AGENTERRORLOGLOCATION This command will work for both default & named instance. 2. To modify location and name of SQLServer Agent log file USE [MSDB] … Continue reading

How to Insert datetime with different Timezones

In SQL Server 2008, Microsoft has introduced a number of new date and time data types. One of these is the datetimeoffset data type. This data type includes an offset from UTC time as well as the datetime value and ensures that the datetime can be retrieved in UTC or a particular timezone based on … Continue reading

%d bloggers like this: