TRY_CONVERT CONVERSION FUNCTION IN SQL SERVER 2012
TRY_CONVERT is one of the new built-in conversion function introduced as a Part of Sql Server 2012. TRY_CONVERT function is similar to the CONVERT function, but if CONVERT function fails to convert...
View ArticlePARSE CONVERSION FUNCTION IN SQL SERVER 2012
PARSE is one of the new built-in conversion function introduced as a Part of Sql Server 2012. PARSE function converts the string expression to the requested data type. It tries it’s best to translate...
View ArticleTRY_PARSE CONVERSION FUNCTION IN SQL SERVER 2012
TRY_PARSE is one of the new built-in conversion function introduced as a Part of Sql Server 2012. TRY_PARSE function is Similar to PARSE function, but if PARSE function fails to convert the value...
View ArticleFORMAT STRING FUNCTION IN SQL SERVER 2012
FORMAT is one of the new built-in String Function introduced as a Part of Sql Server 2012. It returns the value formatted in the specified format using the optional culture parameter value. It is not...
View ArticleDATETIMEFROMPARTS FUNCTION IN SQL SERVER 2012
DATETIMEFROMPARTS is one of the new built-in Date and Time Function introduced as a Part of Sql Server 2012. Returns a DATETIME value for the specified date and time. It is a Sql Server native function...
View ArticleDifferences Between RAISERROR and THROW in Sql Server
Both RAISERROR and THROW statements are used to raise an error in Sql Server. The journey of RAISERROR started from Sql Server 2005, where as the journey of THROW statement has just began with Sql...
View ArticleNew Features in Sql Server 2012
Following are the some of the new features of the Sql Server 2012 which I have blogged. Click on the feature name to know it in detail with extensive examples.: 1. New Built in Functions introduced in...
View ArticleHow to get Date Part only from DateTime in Sql Server
Many times we come across a scenario where we need to get Date Part only from DateTime in Sql Server. There are multiple ways of doing this, here I am listing out few of them: 1) Below approach works...
View ArticleHow to get Quarter’s Start and End Date for a given date in Sql Server
We can use a query like below to get Quarter’s Start and End Date for a given date. DECLARE @AnyDate DATETIME SET @AnyDate = GETDATE() SELECT @AnyDate AS 'Input Date', DATEADD(q, DATEDIFF(q, 0,...
View ArticleHow to get all HEAP Tables or Tables without Clustered Index in Sql Server?
A Table that doesn’t have a Clustered Index is referred to as a HEAP Table. We can write a query like below to get all the HEAP Tables or tables that doesn’t have Clustered Index: SELECT T.Name 'HEAP...
View ArticleHow to get all the Tables with or without Primary Key Constraint in Sql Server?
We can write a query like below to get all the Tables with no Primary key constraint: SELECT T.name 'Table without Primary Key' FROM SYS.Tables T WHERE OBJECTPROPERTY(object_id,'TableHasPrimaryKey') =...
View ArticleHow to find all the tables with no indexes at all in Sql Server?
We can write a query like below to get all the Tables in the Database that don’t have any indexes: SELECT Name 'Tables without any Indexes' FROM SYS.tables WHERE...
View ArticleHow to get all the Tables with or without Non-Clustered Indexes in Sql Server?
We can write a query like below to get all the Tables without any Non-Clustered indexes: --List all the Tables with NO Non-Clustered Indexes SELECT Name 'Tables without any Non-Clustered Indexes' FROM...
View ArticleSEQUENCE Limitations and restrictions – Sql Server 2012
This article basically focuses on the Sequence Limitations and Restrictions with extensive list of example. To know Sequence basics and Sequence Cache Management and internals you may like to visit the...
View ArticleSequence Cache management and Internals – Sql Server 2012
This article basically focuses on the Sequence Cache Management and it’s internals. To know Sequence basics and it’s limitations you may like to visit the articles: Sequence Introduction with Extensive...
View ArticleJoining Two Tables without any Common Column between them – Sql Server
A friend of mine was needed a script where he wanted a One-to-One record mapping between two tables records which don’t have any common column between them for joining. That is he wanted to match the...
View ArticleHow to get all the records which contain double byte data or all the records...
In NVARchar DataType column we can store both Single byte and Double byte data. Many a times we want to know how many records have Single byte or Double byte data. Let us understand this with an...
View ArticleHow to get All the Tables which are Modified in last few days in Sql Server?
We can write a query like below to get the all the Tables which are modified using an ALTER statement in last 10 days. A Table is also considered as modified when an Index on the table is Created or...
View ArticleHow to Check if a String Contains a Substring in it in Sql Server
We can use the CHARINDEX() function to check whether a String contains a Substring in it. Name of this function is little confusing as name sounds something to do with character, but it basically...
View ArticlePRINT/SELECT Statement messages within WHILE LOOP or BATCH of statement is...
Are you facing the problem where the PRINT/SELECT statements messages are not being displayed like the one’s explained in the below two scenario’s? Let us go through these scenario’s and also see how...
View Article