subsonic / SubSonic-3.0

SubSonic 3.0 for the .NET 3.5 Framework
http://subsonic.github.io/
558 stars 210 forks source link

SQL Server generator: SCOPE_IDENTITY is returned twice #166

Open VladV opened 14 years ago

VladV commented 14 years ago

"SELECT SCOPE_IDENTITY() as new_id" is added twice to an INSERT query: from SubSonicRepository.cs and Sql2005Generator.cs

VladV commented 14 years ago

Additionally, it might be better to use OUTPUT clause instead of SELECT statement (see http://msdn.microsoft.com/en-us/library/ms177564%28SQL.90%29.aspx). This way, it would also be easier to support non-integer IDs like server-generated GUIDs.