Translate

Monday 20 February 2017

retrieve the view definition from a SQL Server using query

select definition
from sys.objects     o
join sys.sql_modules m on m.object_id = o.object_id
where o.object_id = object_id( 'dbo.vw_demo')
  and o.type      = 'V'

Wednesday 15 February 2017

Serial no in sql query

select  ROW_NUMBER() OVER (ORDER BY customer_id) AS 'SL No',   * from MstCustomer