[dba-SQLServer] Alter column

Francisco Tapia fhtapia at gmail.com
Wed Jan 31 11:46:42 CST 2007


Yes, except that renaming columns, is generally not the way to do the
renaming, if you do it via Enterprise Manager OR, Studio Manager, what
the script does, is it creates a NEW table w, the columns in the order
(and renamed columns) you want, it then uses the sp_rename to rename
the actual table.  This is to keep the systable names organized.  As a
general rule you do not want to rename sprocs, I've just continued
using that rule for most objects in sql server.

On 1/31/07, JWColby <jwcolby at colbyconsulting.com> wrote:
> Bueno.  So SQL per se does not but a SP can.
>
> Done!
>
> Thanks.
>
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
> -----Original Message-----
> From: dba-sqlserver-bounces at databaseadvisors.com
> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Martin Reid
> Sent: Wednesday, January 31, 2007 8:51 AM
> To: dba-sqlserver at databaseadvisors.com
> Subject: Re: [dba-SQLServer] Alter column
>
> EXEC sp_rename 'MyTable.OldColumnName', 'NewColumnName', 'COLUMN'
>
> for reference
>
> http://doc.ddart.net/mssql/sql70/sp_ra-rz_11.htm
>
> Martin WP Reid
> Training and Assessment Unit
> Riddle Hall
> Belfast
>
> tel: 02890 974477
>
>
> ________________________________
>
> From: dba-sqlserver-bounces at databaseadvisors.com on behalf of JWColby
> Sent: Wed 31/01/2007 13:44
> To: dba-sqlserver at databaseadvisors.com
> Subject: [dba-SQLServer] Alter column
>
>
>
> Can the alter column SQL syntax change a column name?
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com <http://www.databaseadvisors.com/>
>
>
>
>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


-- 
-Francisco
http://sqlthis.blogspot.com | Tsql and More...



More information about the dba-SQLServer mailing list