I'm tracking down an nHibernate problem. Exception thrown: 'NHibernate.Exceptions.GenericADOException' in NHibernate.dll is all it is telling me. I have show_sql set to true. So I thought I would try the sql from nHibernate manually in in SQL Server Management Studio. I added the DECLARE statements. Now I get this error: `Incorrect syntax near '@p0'' when executing on the last line. What am I doing wrong?
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)]