INSERT INTO [Demo].[dbo].[User] ([Name] ,[Pwd]) VALUES ('admin1234556','123456' ) SELECT @@IDENTITY
DECLARE @UserSysNo INT SELECT @UserSysNo=@@IDENTITY
INSERT INTO [Demo].[dbo].[UserLog] ([UserSysNo] ,[Log]) VALUES (@UserSysNo ,'Test123')
DECLARE @SysNo INT DECLARE @Name INT DECLARE @Type INT SELECT @SysNo=SCOPE_IDENTITY()
INSERT INTO [Demo].[dbo].[Log_Category] ([SysNo] ,[Name] ,[Type] ) VALUES (@SysNo ,@Name ,@Type )
GO
问题就是哪里错了?三张表添加关联起来,
INSERT INTO [User] ([Name],[Pwd]) VALUES ('admin1234556','123456' ) DECLARE @UserSysNo INT SELECT @UserSysNo=@@IDENTITY INSERT INTO UserLog ([UserSysNo] ,[Log]) VALUES (@UserSysNo,'Test123') DECLARE @SysNo INT DECLARE @Name INT--没赋值 DECLARE @Type INT--没赋值 SELECT @SysNo=SCOPE_IDENTITY() INSERT INTO Log_Category ([SysNo],[Name],[Type]) VALUES (@SysNo,@Name,@Type)
楼上好的基情, 这么乱还整理。。
什么是基情
1L好人,点赞!