Thought I'd post something folks can play with... could easily be turned into a proc... can be easily modified for an Insert/Values instead of an Insert/Select. With a little forethought, someone could change it to build "CRUD" for a table. All could be modified to ignore auto-fill columns like TimeStamp data-types and IDENTITY columns.
As a side bar, I'm wondering why someone would take the time to build a code generator like the OP and miss the golden opportunity to format the code that's being output instead of genning the same old garbage that the Microsoft template puts out.
... and no bloody Global Temp table or cursor...
[font="Courier New"]
--===== Change to an existing database to test this code in
    USE NorthWind
GO
--===== Build an Insert/Select for the given table
DECLARE @TableName SYSNAME
    SET @TableName = 'dbo.Employees' --<<<< PUT TABLE NAME HERE
DECLARE @Insert VARCHAR(8000)
DECLARE @Select VARCHAR(8000)
DECLARE @MaxNameLength INT
--===== Presets
    SET NOCOUNT ON
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
 SELECT @MaxNameLength = MAX(LEN(sc.Name))
   FROM dbo.SYSCOLUMNS sc,
        dbo.SYSOBJECTS so
  WHERE sc.ID = so.ID
    AND so.ID = OBJECT_ID(@TableName)
--===== Makes the INSERT portion of the code
 SELECT @Insert = ISNULL(@Insert+','+CHAR(10),'') + SPACE(8)+sc.Name
   FROM dbo.SYSCOLUMNS sc,
        dbo.SYSOBJECTS so
  WHERE sc.ID = so.ID
    AND so.ID = OBJECT_ID(@TableName)
  ORDER BY sc.ColID
--===== Makes the SELECT portion of the code
 SELECT @Select = ISNULL(@Select+','+CHAR(10),'') 
                + SPACE(8) + sc.Name + SPACE(@MaxNameLength-LEN(sc.Name)) 
                + ' = xxxx.' + sc.Name
   FROM dbo.SYSCOLUMNS sc,
        dbo.SYSOBJECTS so
  WHERE sc.ID = so.ID
    AND so.ID = OBJECT_ID(@TableName)
  ORDER BY sc.ColID
--===== Display the INSERT/SELECT (Copy from Text Results Window)
 SELECT ' INSERT INTO '+@TableName+CHAR(10)+SPACE(8)+'('+CHAR(10)+@Insert+CHAR(10)+SPACE(8)+')'
 UNION ALL
 SELECT ' SELECT' + CHAR(10) + @Select
 UNION ALL
 SELECT '   FROM sometablename xxxx'
 UNION ALL
 SELECT '  WHERE someconditions'
[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.