SET NOCOUNT ON IF (OBJECT_ID('TB' ) IS NOT NULL ) DROP TABLE TB
GO CREATE TABLE TB(ID INT IDENTITY (,),NAME VARCHAR())
GO INSERT INTO TB(NAME) SELECT 'KK'+CONVERT(VARCHAR(),isnull(@@IDENTITY,)+)
GO --GO 后面为执行的次数 SET NOCOUNT OFF SELECT * FROM TB
2022-12-20 08:02:26
SET NOCOUNT ON IF (OBJECT_ID('TB' ) IS NOT NULL ) DROP TABLE TB
GO CREATE TABLE TB(ID INT IDENTITY (,),NAME VARCHAR())
GO INSERT INTO TB(NAME) SELECT 'KK'+CONVERT(VARCHAR(),isnull(@@IDENTITY,)+)
GO --GO 后面为执行的次数 SET NOCOUNT OFF SELECT * FROM TB