IT Solutions
Search This Blog
Thursday, January 23, 2014
How to rename a column name or table name in sql
1. You can rename column name as below:
sp_Rename 'tblusers.Name' , 'UserName', 'column'
2. Using below sql statement you can change object name ( table name, stored procedure name..etc)
sp_Rename 'tblusers', 'tblGlobalUsers'
Friday, January 17, 2014
how to delete top n records using sql delete statement?
DELETE top (n) FROM Table1
Note : This statement will work in sql server 2005 and above but for below version use following sql statement
DELETE tbl FROM (Select Top n * FROM Table1 ) tbl
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)