Is it possible to have the two names for the same

  • Is it possible to have the two names for the same field in the same table? We're trying to avoid making a column name change too painful. I was thinking that maybe their was some sort of field alias name we could use so we didn't have to change any SQL.

  • I don't think it is possible. But possibly your could rename the table(orig_table) to a new name, lets call it new_table, then create a view of the new_table, calling it the name of the the original table (orig_table). In the orig_table view you could select all the fields in the new_table, and select the field you want to rename twice. In one of the occurances of the field you plan to rename, set the alias on to the new name.

    I think this might work although there might be some performance considerations. Once all the code has been converted, then rename the table back to its original name, and rename the field, and remove the view.

    Ok, maybe a bad suggestion, but it might work.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • You may be able to create a computed column with the new name that is simply the value of the original column.

    -Dan


    -Dan

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply