SELECT INTO question

  • I am trying to create a new table using SELECT INTO but it fails because the column names from the two source tables are identical. 

    select sysobjects.name, syscolumns.name into DP_AUDIT

    from sysobjects, syscolumns

    where sysobjects.id = syscolumns.id

    and sysobjects.xtype='U'

    Is there a way to rename the columns to prevent the conflict?  Any help would be appreciated.

  • select sysobjects.name, syscolumns.name as name1 into DP_AUDIT

    from sysobjects, syscolumns

    where sysobjects.id = syscolumns.id

    and sysobjects.xtype='U'

  • Thanks.  I couldn't find that tidbit anywhere in the documentation.

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

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