Archives: June 2011
Cleaner T-SQL with Table Value Constructors
Table Value Constructors were introduced in SQL Server 2008 and enables you to (not only) insert more records with one INSERT statement.
“Standard” option to insert more records is following:
INSERT INTO Continents (Name) VALUES ('Asia') INSERT INTO Continents (Name) VALUES ('Africa')
With Table Value Constructors… Read more
3 comments, 297 reads
Posted in SQL Treeo on 29 June 2011
Instead Of Trigger and OUTPUT clause headache
It is known that you cannot get inserted identity values using OUTPUT clause when inserting to view which has instead of trigger on it. I would like to offer another workaround I was used recently.
I am talking about fact that you will not succeed with this:
-- inserting records…1 comments, 293 reads
Posted in SQL Treeo on 28 June 2011
Scripting dependencies of User-defined Table Types
I was using user-defined tables types (UDTT) quite intensively despite of their current disadvantages especially their forced READONLY behavior when used as stored procedures parameter. Another disadvantage which I didn’t realize impact for is that UDTT cannot be altered. I hit maintenance nightmare when they became spread across… Read more
3 comments, 636 reads
Posted in SQL Treeo on 23 June 2011
Red Gate’s SQL Source Control and better SQL objects organization
Red Gate’s SQL Source Control (RGSSC) is very decent solution source control solution for database development. I am personally using it and despite it is still young product it is very helpful for me and rest of team members. I am not going to review this tool but I am… Read more
2 comments, 1,030 reads
Posted in SQL Treeo on 23 June 2011
Stored procedures vs. Do-It-At-Application-Layer-At-All-Costs
Many years back when ASP 2.0 (not ASP.NET) was used as primary server language for web application on Microsoft platform, it was common that business logic was implemented using stored procedures on database side. Nowadays, this approach is used less and less especially because of.NET capabilities to act as full-featured… Read more
0 comments, 190 reads
Posted in SQL Treeo on 10 June 2011
Static or “global” variables in T-SQL using CLR UDT
I faced problem that I had many lookup tables like ProductType, ClientType etc. and wanted to refer to their values in code to base some logic on them. This is quite common.
I am talking about something like following:
SELECT @ClientType = ClientType, -- other columns FROM Client WHERE Id…
0 comments, 345 reads
Posted in SQL Treeo on 5 June 2011
What is SSMS Addin
SSMS is abbreviation of SQL Server Management Studio, according to Microsoft description it is “an integrated environment for accessing, configuring, managing, administering, and developing all components of SQL Server. SQL Server Management Studio combines a broad group of graphical tools with a number of rich script editors to provide access… Read more
0 comments, 232 reads
Posted in SQL Treeo on 3 June 2011



Subscribe to this blog