Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Nikhil Gaur
(70)
Shameer
(34)
Nadheera V
(30)
Last 7 Days
Nikhil Gaur
(621)
Anil Kumar ...
(582)
Abhisek Panda
(445)
more...
Resources
»
Articles
»
Databases
»
Modifying the Column Information using T_SQL Commands
Posted Date: 09 Jun 2004
Resource Type:
Articles
Category:
Databases
Author:
K Hari Prasad
Member Level:
Gold
Rating:
Points
: 7
--To add a new column
ALTER TABLE Activity add test VARCHAR(10) NULL
--To Rename a Column
EXEC sp_rename 'TableName.[OldColumnName]', 'NewColumnName', 'COLUMN'
-- To change the datatype and NULL/NOTNULL for a particular column
ALTER TABLE TableName ALTER COLUMN ColumnName NewDataType NULL/NOTNULL
ALTER TABLE TableName ALTER COLUMN ColumnName VARCHAR(30) NULL
--To drop a column
ALTER TABLE TableName DROP COLUMN ColumnName
--To rename a table
EXEC sp_rename 'OldTableName','NewTableName'
Eg: EXEC sp_rename 'customers', 'custs'
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
How to change the owner of the Objects(table,view etc) in a SQL Server Database?
Previous Resource:
Time Conversion GMT to Current Time and Back
Return to Discussion Resource Index
Post New Resource
Category:
Databases
Post resources and
earn money
!
Related Resources
How to change the owner of the Objects(table,view etc) in a SQL Server Database?
How to read data from a different Server in SQL Server?
Benefits of using Stored Procedures
Accessing Registry from SQLServer
How to replace cursors with a trick:)?
How to return value from stored procedure
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use