SQL SERVER – Tips from the Development Series – Overriding Identity Fields – Day 9 of 35

In this blog post we are going to discuss about Overriding Identity Fields. For students new to the database world, it helps to begin thinking about ID fields in the context of larger organizations with lots of activity. A customer service department has a constant flow of activity and many representatives are entering data in the system simultaneously. The same is true for large billing departments. These are examples where an identity field helps to ensure the entities you care about get tracked properly. A CustomerID value that is automatically generated with each new record makes sure each new customer gets a unique number – even if you have many reps all entering data at the same time.

Read More

SQL SERVER – Row Constructors – Day 6 of 35

In this blog post we will learn about Row Constructors.

Row Constructors

Most records we insert will come from a connection made to SQL from some external process. For example a web page ADO.NET connection to you company data layer or some data feed from an SSIS package. Still most seed data or special inserts may come from the INSERT INTO DML statement. Before SQL 2008 if you had to insert 20 records you needed 20 separate INSERT INTO statements. Now you can do all 20 inserts in one transaction.

Let’s start off our example by creating a very simple table with the following code.

Read More