0
我正在追蹤一個nHibernate問題。它只是告訴我。我有show_sql
設置爲true。所以我想我會在SQL Server Management Studio中手動嘗試nHibernate中的sql。我添加了DECLARE語句。現在我得到這個錯誤:在最後一行執行時'@ p0'附近的語法錯誤'。我究竟做錯了什麼?將nHibernate sql轉換爲手動sql
DECLARE @p0 VARCHAR(50);
DECLARE @p1 INT;
DECLARE @p2 DATETIME;
DECLARE @p3 INT;
DECLARE @p4 VARCHAR(10);
DECLARE @p5 VARCHAR(50);
DECLARE @p6 VARCHAR(80);
DECLARE @p7 DECIMAL(11,2);
DECLARE @p8 DATETIME;
DECLARE @p9 VARCHAR(80);
DECLARE @p10 INT;
DECLARE @p11 VARCHAR(50);
INSERT INTO MMDAML.dbo.tblMyProjectTable
(Name, Size, UploadDate, RefId, RefType, Type, Alias, Amount, Date, Number, Stage, Caption) VALUES
(@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11);
select SCOPE_IDENTITY();
@p0 = 'Project317.png' [Type: String (4000)], @p1 = 77756 [Type: Int32 (0)], @p2 = 4/14/2017 10:51:54 AM [Type: DateTime (0)], @p3 = 317 [Type: Int32 (0)], @p4 = 'Project' [Type: String (4000)], @p5 = 'Invoice' [Type: String (4000)], @p6 = 'Contract.png' [Type: String (4000)], @p7 = 4455 [Type: Decimal (0)], @p8 = 4/14/2017 10:51:23 AM [Type: DateTime (0)], @p9 = '987987' [Type: String (4000)], @p10 = 0 [Type: Int32 (0)], @p11 = NULL [Type: String (4000)]
這讓我最那裏的方式。我還必須刪除[Type:*]並將日期參數值放在引號中,並將SET移到INSERT之前。 –
你是對的:) – LONG