SQL Server tip : Query a range of characters ?

If you need to query all People from Person table with FirstName start with A, you can easily query like below, What if you want to list all the people from person table with first name start with A and B? You can combined Like operator with OR and query like below, But imagine scenario … Continue reading SQL Server tip : Query a range of characters ?

Advertisements

SQL Server Tip : . Where to use SQURE Bracket around table name?

Have you ever thought, what if your table name 1. Is exactly as of SQL Server keyword 2. Is having space in between like Student Fav Actor If you go ahead and query against table Student Fav Actor like below, most likely you will get error message as below, There may me one more scenario … Continue reading SQL Server Tip : . Where to use SQURE Bracket around table name?

String Concatenation and Scope Resolution Operator in SQL Server 2008 R2

Target Audience: Beginners SQL Server 2008 R2 comes with String Concatenation Operator. String Concatenation operator is denoted by symbol plus ‘+’. Output we will get, String concatenation operator can concatenate string with real time data of any type also. In above query , firstName and lastName column is being concatenated using string concatenation operator of … Continue reading String Concatenation and Scope Resolution Operator in SQL Server 2008 R2