Jump to content

Modify (alter) a column not drop or addnew


tariq_ews
 Share

Recommended Posts

Hello everybody i am new and i have a problem that we want to change my table column not add or not remove it just change how can i do it plz helpregards Muhammad Tariq
If you're using MS SQL you can do it with sp_rename. See http://msdn2.microsoft.com/en-us/library/ms188351.aspx for further info on this. Renaming can get complicated if there are indexes, constraints and suchlike that relate to the item being renamed...
Link to comment
Share on other sites

If you have MS SQL Server you can just open up the Enterprise Manager, right-click on the table and go to Design View, and change whatever you want. Most database servers have a GUI you can use (like phpMyAdmin for MySQL). If you need to use a SQL statement to do it, that statement is an ALTER TABLE statement.http://www.google.com/search?client=opera&...-8&oe=utf-8

Link to comment
Share on other sites

If you have MS SQL Server you can just open up the Enterprise Manager, right-click on the table and go to Design View, and change whatever you want. Most database servers have a GUI you can use (like phpMyAdmin for MySQL). If you need to use a SQL statement to do it, that statement is an ALTER TABLE statement.http://www.google.com/search?client=opera&...-8&oe=utf-8
I believe some SQL implementations use ALTER TABLE for this, but not, for example, MS SQL. See the MS SQL info on modifying column properties where it shows that you use ALTER TABLE to set column properties, and sp_rename to rename a column. So your SQL syntax for changing the column name will depend on the SQL engine you're using (MS SQL, MySQL, ...). Which SQL engine are you using?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...