Page Anatomy – Part 1

I am going start a series of articles describing how information is stored and organized in a Microsoft SQL Server database. Today, I am going to talk about the File Header Page. Every database is defined by at least two file types. The first file type is one primary (*.mdf) data file with zero or more optional secondary (*.ndf) data files. The second file type are log (*.ldf) files. We will be looking at the primary data file during these talks. All of the information is a gleamed from SQL…

New York City – SQL Saturday #235

I want to thank the selection committee for having the opportunity to present at SQL Saturday #235 in New York City. There is an all-star line up of speakers this day. It should be a good time to network with other professionals in the field and learn some new things about the product. I will definitely be listing to Lovin Spoonful’s “Summer In The City” on the drive down. I learnt from last year to wear shorts since it is hot in the city! Below are the details of the…

Conversion Functions – TRY_PARSE()

I am going to bring closure to my series of very short articles on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined…

Conversion Functions – TRY_CAST()

I am going to make headway on my series of articles (tidbits) on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined with…

Conversion Functions – TRY_CONVERT()

I am going to carry on with my series of articles (tidbits) on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined with…

Conversion Functions – PARSE()

I am going to continue the series of articles (tidbits) on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined with a certain…

Conversion Functions – CAST()

I am going press on with my series of articles (tidbits) on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined with a…

Conversion Functions – CONVERT()

I am going to start a series of articles (tidbits) on type conversion functions available in the Transaction SQL (T-SQL) language. One analogy of a data type conversion is apply the correct action to change the physical form of water (H2O). You can convert water to ice by cooling it. You can convert water to vapor by heating it. However, the chemical composition of water is still the same! Information is stored in a database as rows in a table. Each field in a table is defined with a certain…

Error Handling – Part 4

I am going to continue my articles on controlling the execution flow of statements in a Transaction SQL (T-SQL) program. Every program has to be deterministic on what step to execute next. Otherwise, the computer would be clueless on what to do next. The only exception to this rule is error handling. A runtime error may cause the program to branch to a error handler and exit the program. Today, I want to talk about how to return a custom error message from the business logic layer to the application…

Error Handling – Part 3

I am going to continue my articles on controlling the execution flow of statements in a Transaction SQL (T-SQL) program. Every program has to be deterministic on what step to execute next. Otherwise, the computer would be clueless on what to do next. The only exception to this rule is error handling. A runtime error may cause the program to branch to a error handler and exit the program. Today, I want to talk about creating, altering and deleting custom error messages. Therefore, the sys.sp_addmessage, sys.sp_altermessage and sys.sp_dropmessage are key…