Transact SQL :- Temporary Table & Conditional Creation

Background Transact SQL offers the best programming space of all the top tier relational database. But, there are areas one can stumble over, as well. Temporary Table Simple Let us create a simple temporary table Different Structure Objective Depending on certain conditions, our table structure might need to be different. Column 2 If @type is … Continue reading Transact SQL :- Temporary Table & Conditional Creation

Transact SQL – Create Object with different Structure based on runtime decisions

Background Based on the version of SQL Server being targeted one might need to create a slightly different table structure. Here is the original code that fails. And, slight variations. Implementation Original Code Output Revised ( Add Go Statement ) Premise: We add a go to ensure object is in fact created. Code Revised ( … Continue reading Transact SQL – Create Object with different Structure based on runtime decisions