INSERT INTO a temp table, and have an IDENTITY field created, without first declaring the temp table?

Oh ye of little faith:

SELECT *, IDENTITY( int ) AS idcol
  INTO #newtable
  FROM oldtable

http://msdn.microsoft.com/en-us/library/aa933208(SQL.80).aspx

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)