Tips for SQL Query Optimization
Tips for SQL Query Optimization The sql query becomes faster if you use the actual columns names in SELECT statement instead of than ‘*’. For Example: Write the query as SELECT id, first_name, last_name, age, subject FROM student_details;…
Tips for Database ConnectionStrings of Various Provider
Tips for Database ConnectionStrings of Various Provider Microsoft SQL Server // ODBC DSN using System.Data.Odbc; OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = “Dsn=DsnName;” + “Uid=UserName;” +…
Tips for performance tuning of databases
Database statistics The most important resource to any SQL optimizer is the statistics collected for different tables within the catalog. Statistics is the information about indexes and their distribution with respect to each other. Optimizer uses this…
Tips to protect your site from hackers
Keep software up to date It may seem obvious, but ensuring you keep all software up to date is vital in keeping your site secure. This applies to both the server operating system and any software you may be running on your website such as a CMS or forum.…
How to prevent SQL Injection in iOS apps?
SQL Injection Application Security is a primary concern of every mobile application developer whether it is iPhone app, iPad app, Universal app in iOS, Android app, Blackberry app, Windows Phone app or tablet app. And most of the vulnerability attacks…
How to Add Identity Column to Table Based on Order of Another Column
How to Add Identity Column to Table Based on Order of Another Column USE tempdb GO -- Create Table CREATE TABLE TestTable (Col1 INT, Col2 VARCHAR(100)) GO -- Insert Data INSERT INTO TestTable (Col1, Col2) VALUES (33, 'Ranjan'); INSERT INTO TestTable…
How to puzzle SET ANSI_NULLS and resultset in sqlserver
How to puzzle SET ANSI_NULLS and resultset in sqlserver When ANSI_NULLS is OFF, the Equals (=) and Not Equal To (<>) comparison operators do not follow the ISO standard. A SELECT statement that uses WHERE column_name = NULL returns the rows that…
How to update specific column in entire database using SQL
How to update specific column in entire database using SQL The UPDATE statement changes existing data in one or more rows in a table. The following illustrates the syntax of the UPDATE statement: UPDATE table SET column1 = new_value1, column2 =…
How to start Sqlserver from Command prompt
Instance of SQL Server 2012 and here is what we would in the configuration manager. Now, I would go ahead and stop SQL Service by selecting SQL Server (MSSQLServer) > Right Click > Stop. There are multiple ways to start SQL with startup parameter.…
Querying searching Pattern Ranges and Wild Cards in sqlserver
Querying Pattern Ranges The % wildcard character represents any number of characters of any length. Let’s find all first names that end in the letter ‘A’. By using the percentage ‘%’ sign with the letter ‘A’, we achieve this goal using the code…