Results 1 to 4 of 4

Thread: to remove column SQL Server 6.5

  1. #1
    natalia Guest

    to remove column SQL Server 6.5


    Guys,
    how can I remove column from a table?
    Thank you.

  2. #2
    Sundar Guest

    to remove column SQL Server 6.5 (reply)

    You have to rebuild the table. Easiest thing would be to use 'General SQL script' option and create the table script. Amend it so the unwanted column is no longer included.


    ------------
    natalia at 4/4/01 9:41:50 AM


    Guys,
    how can I remove column from a table?
    Thank you.

  3. #3
    ram Guest

    to remove column SQL Server 6.5 (reply)


    yes but u need to do a select into to first transfer data from other columns of table to create a new table and drop table or u can bcp out data and create new table with out column and bcp in data but u have to use format file when bcping data lookup bol for more info
    hth
    ram

    ------------
    natalia at 4/4/01 9:41:50 AM


    Guys,
    how can I remove column from a table?
    Thank you.

  4. #4
    al Guest

    to remove column SQL Server 6.5 (reply)


    Use "select into" to another table selecting columns you only need. Then drop original table and use sp_rename for the new table.

    Select col1, col2....coln into new_table from original_table
    drop table original_table
    sp_rename new_table, original_table

    that's it.


    ------------
    natalia at 4/4/01 9:41:50 AM


    Guys,
    how can I remove column from a table?
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •