0

我试图将数据插入到具有可以为 Null 的属性的表中。但是,我不确定如何使用我的 SQL 语句来完成此操作。

INSERT INTO [dbo].[INVOICE]
           ([INV_ID]
           ,[EMP_ID]
           ,[WAR_ID]
           ,[REP_ID]
           ,[FIN_ID]
           ,[INV_DATE]
           ,[INV_PRICE])
     VALUES
(5655,8,1**,,**3,'7/5/2000',75880),
(9749,1,1**,,**1,'11/26/2002',58881),
(9909,3,1**,187,**3,'12/27/2012',64859);
4

2 回答 2

3
INSERT INTO [dbo].[INVOICE]
           ([INV_ID]
           ,[EMP_ID]
           ,[WAR_ID]
           ,[REP_ID]
           ,[FIN_ID]
           ,[INV_DATE]
           ,[INV_PRICE])
     VALUES (5655,8,1**,NULL,**3,'7/5/2000',75880), (9749,1,1**,NULL,**1,'11/26/2002',58881), (9909,3,1**,187,**3,'12/27/2012',64859);
于 2012-11-16T04:30:57.513 回答
1
INSERT INTO [dbo].[INVOICE]
           ([INV_ID]
           ,[EMP_ID]
           ,[WAR_ID]
           ,[REP_ID]
           ,[FIN_ID]
           ,[INV_DATE]
           ,[INV_PRICE])
     VALUES
(5655,8,1,NULL,3,'7/5/2000',75880),
(9749,1,1,NULL,1,'11/26/2002',58881),
(9909,3,1,NULL,3,'12/27/2012',64859);

你可以用它NULL来表示 null

于 2012-11-16T04:30:31.463 回答