Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Friday, January 3, 2014

how to concat strings in sql

To concat 2 strings or 2 columns as one in sql server

use the following sql query

SELECT 'SQL'+' SERVER' AS RESULT

return value : SQL SERVER

Thursday, October 3, 2013

how to replace the text in a string using sql

To replace particular text in a selected string using sql statement,
write the following query

SELECT REPLACE('SQL-SERVER','-','')

Result
SQLSERVER

Tuesday, September 3, 2013

set count ON in stored procedures in sql server

-while writing a stored procedure, use SET NOCOUNT ON  to stop showing the messages like  'number of rows affected'
-It may reduce the network traffice and the overall performance of a database would increase