Quantcast
Channel: Scripts – SqlHints.com
Browsing all 28 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Cannot truncate table ‘xyz’ because it is being referenced by a FOREIGN KEY...

In this article we will discuss on when we get the error like below in Sql Server and how to resolve it. Msg 4712, Level 16, State 1, Line 1 Cannot truncate table ‘Customer’ because it is being...

View Article


Image may be NSFW.
Clik here to view.

Truncate all/all except few/specified Tables of a Database in Sql Server

This article presents how we can generate a script to truncate all tables/all tables except few specified tables/specified tables of a Database in Sql Server. One of major the problem with table...

View Article


Image may be NSFW.
Clik here to view.

How to check if a VIEW exists in Sql Server

Many a times we come across a scenario where we need to execute some code based on whether a View exists or not. There are different ways of identifying the View existence in Sql Server, this article...

View Article

Image may be NSFW.
Clik here to view.

How to get Hourly data in Sql Server

This article demonstrate how to get hourly data in Sql Server in different formats as shown in the below image. Here Sales table data is presented in two different hourly aggregated sales data formats....

View Article

Image may be NSFW.
Clik here to view.

How to get Daily data in Sql Server

This article demonstrate how to get daily data in Sql Server in different formats as shown in the below image. Here Sales table data is presented in two different daily aggregated sales data formats....

View Article


Image may be NSFW.
Clik here to view.

How to get Yearly data in Sql Server

This article demonstrate how to get yearly data in Sql Server in different formats as shown in the below image. Here Sales table data is presented in two different yearly aggregated sales data formats....

View Article

Image may be NSFW.
Clik here to view.

How to get all the Tables with or without an Identity column in Sql Server?

This article provides the script to find all the Tables with or without an Identity column Tables with Identity column We can write a query like below to get all the Tables with Identity column: SELECT...

View Article

Image may be NSFW.
Clik here to view.

How to Split comma or any other character delimited string into a Table in...

Many a time we come across a scenario where we pass a comma or any other character delimited string to stored procedure and in stored procedure we want to fetch data from other tables based this...

View Article

Browsing all 28 articles
Browse latest View live