• Fair point HextallFanForLife.

    You can try the following if you want the Schema name to be included too.

    DECLARE @mStrColumns VARCHAR(8000) , @mStrTable VARCHAR(100)

    SET @mStrTable ='TABLE_NAME'

    --

    SELECT @mStrColumns = COALESCE(@mStrColumns + ', ', '') + '[' + CAST(SC.[NAME] AS VARCHAR(100) ) +']' ,@mStrTable = schema_Name(schema_id) + '.'TABLE_NAME'

    FROM [SYSCOLUMNS] SC

    JOIN SYS.OBJECTS SO ON SC.ID = SO.object_ID

    WHERE SC.STATUS <> COALESCE (NULL ,SC.STATUS+1) AND SO.NAME = @mStrTable

    --

    SELECT 'SELECT ' + @mStrColumns + ' FROM ' + @mStrTable RESULTS

    Please replace the "'TABLE_NAME" in the script with your Table Name.

    Hope this helps 🙂

    Mehernosh.