本文介绍了如何在商店程序中添加自动增量SLNO ..请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 ALTER PROCEDURE [dbo] .SP_CREATEDEVMASTER ( @ SLNO bigint , @SERIAL_NO nvarchar ( 30 ), @ DEVICE_NO nvarchar ( 6 ), @ MODELCODE int , @ WARRANTY nvarchar ( 3 ), @ STCODE int , @ REMARKS nvarchar ( 100 ), @ PROCESSOR nvarchar ( 10 ), @ RAM nvarchar ( 10 ), @HARDDISK nvarchar ( 10 ), @DEVCODE int , @ FLG_TYPE 位, @ PRICE money ) AS SET NOCOUNT OFF ; INSERT INTO [TBL_DEVMASTER]([SLNO],[SERIAL_NO],[DEVICE_NO], [MODELCODE],[WARRANTY],[STCODE],[REMARKS],[PROCESSOR],[RAM],[HARDDISK],[DEVCODE],[FLG_TYPE],[PRICE]) VALUES ( @ SLNO , @ SERIAL_NO , @DEVICE_NO , @ MODELCODE , @ WARRANTY , @STCODE , @ REMARKS , @ PROCESSOR , @RAM , @HARDDISK , @ DEVCODE , @ FLG_TYPE , @ PRICE ); SELECT SLNO,SERIAL_NO,DEVICE_NO,MODELCODE,WARRANTY,STCODE,REMARKS,PROCESSOR,RAM,HARDDISK,DEVCODE,FLG_TYPE,PRICE FROM TBL_DEVMASTER WHERE (SLNO = @ SLNO ) 解决方案 无需明确地在该SQL列中插入值。 SQL服务器会为你做这件事 http://msdn.microsoft.com/en-us/library/aa933196(v = sql.80).aspx [ ^ ] https://www.google.co.in/search?q=identity+column+in+sql+server&rlz=1C1CHMO_en-gbIN491IN491&oq= identity + colum& aqs = chrome.1.57j0l3.5782j0& sourceid = chrome& ie = UTF-8 [ ^ ] ALTER PROCEDURE [dbo].SP_CREATEDEVMASTER(@SLNO bigint,@SERIAL_NO nvarchar(30),@DEVICE_NO nvarchar(6),@MODELCODE int,@WARRANTY nvarchar(3),@STCODE int,@REMARKS nvarchar(100),@PROCESSOR nvarchar(10),@RAM nvarchar(10),@HARDDISK nvarchar(10),@DEVCODE int,@FLG_TYPE bit,@PRICE money)ASSET NOCOUNT OFF;INSERT INTO [TBL_DEVMASTER] ([SLNO], [SERIAL_NO], [DEVICE_NO], [MODELCODE], [WARRANTY], [STCODE], [REMARKS], [PROCESSOR], [RAM], [HARDDISK], [DEVCODE], [FLG_TYPE], [PRICE]) VALUES (@SLNO, @SERIAL_NO, @DEVICE_NO, @MODELCODE, @WARRANTY, @STCODE, @REMARKS, @PROCESSOR, @RAM, @HARDDISK, @DEVCODE, @FLG_TYPE, @PRICE);SELECT SLNO, SERIAL_NO, DEVICE_NO, MODELCODE, WARRANTY, STCODE, REMARKS, PROCESSOR, RAM, HARDDISK, DEVCODE, FLG_TYPE, PRICE FROM TBL_DEVMASTER WHERE (SLNO = @SLNO) 解决方案 No need to insert value in that SQL column explicitely. SQL server will do it for youhttp://msdn.microsoft.com/en-us/library/aa933196(v=sql.80).aspx[^]https://www.google.co.in/search?q=identity+column+in+sql+server&rlz=1C1CHMO_en-gbIN491IN491&oq=identity+colum&aqs=chrome.1.57j0l3.5782j0&sourceid=chrome&ie=UTF-8[^] 这篇关于如何在商店程序中添加自动增量SLNO ..请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-27 23:48