Script to Reset Ident Column in Database

This is a very handy little script to generate a script to reset the ident column of all your database tables. This can be handy after filling and truncating tables. This script uses a schema “ps”. Replace it with .dbo if needed.

Lees meer…

Categorieën:SQL Server Tags:, ,

Script to count nr of rows in all tables

This script can be used as a view to count the number of rows in all SQL tables in your database. This can be very usefull.

Lees meer…

Categorieën:SQL Server Tags:

Calculate Weeks Between Two Dates using DateDiff

In SQL Server, there’s a buildin function to calculate the number of weeks between two dates. This function is called “DateDiff”. The problem with this function is that Sql Server thinks the week starts on sunday. Maybe this it true in some situations but at  my current project,  the week should start on monday. This article gives you more info how to fix the issue with the datediff and weeks.

Lees meer…

Categorieën:T-SQL Tags:, ,

Gratis E-Book: Introducing Microsoft SQL Server 2012

Gratis e-book van Microsoft te download op deze website:

Friends, the final and complete version of Introducing Microsoft SQL Server 2012, by Ross Mistry (@RossMistry) and Stacia Misner (@StaciaMisner), is now ready as a free download! You can download the PDF version of this title here (288 pages; 10.8 MB).

We will update this post soon with links to EPUB and MOBI files. We expect these files to be available by March 23. UPDATE: The EPUB is here, and the MOBI is here.

If you prefer a hard copy of the book, you can order it here for $14.99.

Introducing Microsoft SQL Server 2012 includes 10 chapters:

PART I   DATABASE ADMINISTRATION (by Ross Mistry)

1.   SQL Server 2012 Editions and Engine Enhancements

2.   High-Availability and Disaster-Recovery Enhancements

3.   Performance and Scalability

4.   Security Enhancements

5.   Programmability and Beyond-Relational Enhancements

PART II   BUSINESS INTELLIGENCE DEVELOPMENT (by Stacia Misner)

6.   Integration Services

7.   Data Quality Services

8.   Master Data Services

9.   Analysis Services and PowerPivot

10.   Reporting Services

We are releasing this title to help you learn about the new features and capabilities in SQL Server 2012, which Microsoft released to manufacturing (RTM) on March 6, 2012. You can expect general availability of the product to begin on April 1, 2012.

Please help us share the news about this ebook. And enjoy!

Categorieën:SQL Server Tags:

Datawarehouse and Datamart – Empty Strings or NULL Values?

I was wondering what’s the best method to store empty fields from source systems in a datawarehouse. For example;a customer record without a first name stored in the database. When loading this record in my datawarehouse, should I set this field to NULL (to save space) or should I load the original value, maybe an empty string?
Lees meer…

Categorieën:BI en Datawarehousing, T-SQL Tags: