Quantcast
Channel: Sql Server – SqlHints.com
Browsing all 130 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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 Article


Image may be NSFW.
Clik here to view.

PARSE 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 Article


Image may be NSFW.
Clik here to view.

TRY_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 Article

Image may be NSFW.
Clik here to view.

FORMAT 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 Article

DATETIMEFROMPARTS 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 Article


Differences 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 Article

New 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 Article

How 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 Article


Image may be NSFW.
Clik here to view.

How 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 Article


Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


SEQUENCE 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 Article

Image may be NSFW.
Clik here to view.

Sequence 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 Article


Image may be NSFW.
Clik here to view.

Joining 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article


How 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 Article

Image may be NSFW.
Clik here to view.

How 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 Article

Image may be NSFW.
Clik here to view.

PRINT/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
Browsing all 130 articles
Browse latest View live


Latest Images