use ApressFinancial
go
INSERT INTO CustomerDetails.CustomerProducts
(
CustomerId,
FinancialProductId,
AmountToCollect,
Frequency,
LastCollected,
LastCollection
)
VALUES(1,1,100,0,'8/24/2005','8/26/2005')运行后显示的错误是:不能将值 NULL 插入列 'CustomerFinancialProductId',表 'ApressFinancial.CustomerDetails.CustomerProducts';列不允许有空值。INSERT 失败。
语句已终止。但是那个 CustomerFinancialProductId 的值我在 VALUES 中已经设为 1 错误在哪里呢? 期望您的回复,非常感谢!!
go
INSERT INTO CustomerDetails.CustomerProducts
(
CustomerId,
FinancialProductId,
AmountToCollect,
Frequency,
LastCollected,
LastCollection
)
VALUES(1,1,100,0,'8/24/2005','8/26/2005')运行后显示的错误是:不能将值 NULL 插入列 'CustomerFinancialProductId',表 'ApressFinancial.CustomerDetails.CustomerProducts';列不允许有空值。INSERT 失败。
语句已终止。但是那个 CustomerFinancialProductId 的值我在 VALUES 中已经设为 1 错误在哪里呢? 期望您的回复,非常感谢!!
你指定的是列:FinancialProductId,而不是:CustomerFinancialProductId
go
INSERT INTO CustomerDetails.CustomerProducts
(
CustomerFinancialProductId,
CustomerId,
FinancialProductId,
AmountToCollect,
Frequency,
LastCollected,
LastCollection
)
VALUES(1,1,1,100,0, '8/24/2005 ', '8/26/2005 ')
CustomerDetails.CustomerProducts 是表名吗?
其他问题~例~
create table tt(id int,groups nvarchar(10),InActive int)insert into tt (id,groups,InActive) values(1,1,1)
insert tt select 1,'1',1
CustomerDetails 是架构名,CustomerProducts 是表名