SQL SERVER – Get Answer in Float When Dividing of Two Integer

Many times we have requirements of some calculations amongst different fields in Tables. One of the software developers here was trying to calculate some fields having integer values and divide it which gave incorrect results in integer where accurate results including decimals was expected. Something as follows, Example, USE [AdventureWorks]…
Read More

SQL SERVER – Guidelines and Coding Standards Complete List Download

Coding standards and guidelines are very important for any developer on the path to a successful career. A coding standard is a set of guidelines, rules and regulations on how to write code. Coding standards should be flexible enough or should take care of the situation where they should not prevent best practices for coding. They are basically the guidelines that one should follow for better understanding.

Read More

SQL SERVER – Guidelines and Coding Standards Part – 2

To express apostrophe within a string, nest single quotes (two single quotes). Example: SET @sExample = 'SQL''s Authority' When working with branch conditions or complicated expressions, use parenthesis to increase readability. IF ((SELECT 1 FROM TableName WHERE 1=2) ISNULL) To mark a single line as comment use (–) before the statement.…
Read More

SQL SERVER – Guidelines and Coding Standards Part – 1

Use “Pascal” notation for SQL server Objects Like Tables, Views, Stored Procedures. Also tables and views should have ending “s”. Example: UserDetails Emails If you have big subset of table group than it makes sense to give prefix for this table group. Prefix should be separated by _. Example: Page_…
Read More

SQL SERVER – 2008 – Interview Questions and Answers – Part 8

Click here to get free chapters (PDF) in the mailbox SQL SERVER – 2008 – Interview Questions and Answers Complete List Download What is Data Compression? In SQL SERVE 2008 Data Compression comes in two flavors: Row Compression Page Compression Row Compression Row compression changes the format of physical storage…
Read More

SQL SERVER – 2008 – Interview Questions and Answers – Part 7

Click here to get free chapters (PDF) in the mailbox SQL SERVER – 2008 – Interview Questions and Answers Complete List Download How can we rewrite sub-queries into simple select statements or with joins? Yes we can write using Common Table Expression (CTE). A Common Table Expression (CTE) is an…
Read More