I have just ran SQL Profiler and it looks like it doesn't like the 0 being set for the ID.
Code:
exec sp_executesql N'INSERT INTO Gallery (Name, Telephone, URL, Email, Id) VALUES (@p0, @p1, @p2, @p3, @p4); select SCOPE_IDENTITY()',N'@p0 nvarchar(17),@p1 nvarchar(4000),@p2 nvarchar(62),@p3 nvarchar(4000),@p4 int',@p0=N'Woodlands Gallery',@p1=NULL,@p2=N'http://www.woodlandsgallery.com/dynamic/artist.asp?ArtistID=41',@p3=NULL,@p4=0
This alternative SQL query will insert the record. It just leaves out any reference to the ID.
Code:
exec sp_executesql N'INSERT INTO Gallery (Name, Telephone, URL, Email) VALUES (@p0, @p1, @p2, @p3); select SCOPE_IDENTITY()',N'@p0 nvarchar(17),@p1 nvarchar(4000),@p2 nvarchar(62),@p3 nvarchar(4000)',@p0=N'Woodlands Gallery',@p1=NULL,@p2=N'http://www.woodlandsgallery.com/dynamic/artist.asp?ArtistID=41',@p3=NULL
How would I replicate this funstionality in the hbm.xml file.
Thanks again for the help,
B