Monday, January 6, 2014

what is scope_Identity in sql server

Scope_Identity is the auto generated Id in current context

usage
DECLARE @ID AS BigInt
Set @ID=Scope_Identity()

Friday, January 3, 2014

how to check the permissions on the database in sql server

to check the permissions on the database that a user connected to,

use the following query block,

SELECT * FROM fn_my_permissions(null,'database')

result

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