SQL Server –"Denali"– End of Month using EOMONTH()
SQL Server Denali CTP3 introduces a new date/time function EOMONTH(). EOMONTH() returns the last day of the month for the given date. It also accepts an optional argument which is an integer expression...
View ArticleSQL Server –"Denali"– Conversion Function – PARSE() and TRY_PARSE()
PARSE() and TRY_PARSE() are new function introduced in SQL Server Denali. PARSE() returns the result of an expression, translated to specified data type if the translation is possible, otherwise, it...
View ArticleSQL Server –"Denali"– Analytic Functions – LAG() and LEAD()
LAG() function can be used to access data from a previous row in the result set without using a self-join. And it’s counterpart LEAD() can be used to access data from a subsequent row in the same...
View ArticleSQL Server – How to check if you are running 32-bit or 64-bit version
There are two different command you can use to check if you are running 32-bit or 64-bit version of SQL Server. Using @@VERSION: You can user @@VERSION system variable to determine edition and...
View ArticleSQL Server – Finding TCP Port Number SQL Instance is Listening on
By default SQL Server listens on TCP port number 1433, and for named instances TCP port is dynamically configured. There are several options available to get the listening port for SQL Server Instance....
View ArticleSQL Server – How to find Default data and log path for SQL Server 2012
To identify default data and log directories in SQL Server 2012 you can use SERVERPROPERTY() function. In SQL Server 2012 two new parameters are added to SERVERPROPERTY() function namely,...
View ArticleSQL Server – How to Move Table to Another Schema
Starting with SQL Server 2005 all tables are grouped into schemas. While creating a table if the schema name is not specified it is created in the default schema of the user creating it. you can use...
View ArticleSQL Server – Get SQL Server Service Account using T-SQL
SQL Server service account information is stored in Windows Registry database. You can get this information from Services Console or SQL Server Configuration Manager. To get account information from...
View ArticleSQL Server – How to get last access/update time for a table
Modify date and create date for a table can be retrieved from sys.tables catalog view. When any structural changes are made the modify date is updated. It can be queried as follows: USE [SqlAndMe] GO...
View ArticleSQL Server – Different Ways to Check Object Definition
sp_helptext is widely used for checking object definition in SQL Server. sp_helptext can be used to check definition of various database objects like Views, Stored Procedures and User Defined...
View Article
More Pages to Explore .....