|
SELECT @ N = MAX (LEN (F0080)) FROM KLDB.DBO.OTH_D_NEWS
--Temporary table, the maximum ID is the maximum length of the relevant stock field
SET @ SQL = 'SELECT TOP' + CONVERT (VARCHAR (10), @ N) + 'ID = IDENTITY (INT, 1,1)
INTO # FROM SYSCOLUMNS A, SYSCOLUMNS B '
EXECUTE SP_EXECUTESQL @SQL
SELECT * FROM #
---------------------------------------
Server: Message 208, Level 16, State 1, Process P_GENERATE_TB8002, Line 20
Object name '#' is invalid.
What should I do? |
|