From: Michael D. <mik...@us...> - 2004-09-19 16:13:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7928/Dialect Modified Files: MsSql2000Dialect.cs Added Files: MsSql7Dialect.cs Log Message: Added a Dialect for Ms Sql 7 --- NEW FILE: MsSql7Dialect.cs --- using System; namespace NHibernate.Dialect { /// <summary> /// An SQL dialect compatible with Microsoft SQL Server 7. /// </summary> /// <remarks> /// There have been no test run with this because the NHibernate team does not /// have a machine with Sql 7 installed on it. But there have been users using /// Ms Sql 7 with NHibernate. As issues with Ms Sql 7 and NHibernate become known /// this Dialect will be updated. /// </remarks> public class MsSql7Dialect : MsSql2000Dialect { /// <summary> /// Uses @@identity to get the Id value. /// </summary> /// <remarks> /// There is a well known problem with @@identity and triggers that insert into /// rows into other tables that also use an identity column. The only way I know /// of to get around this problem is to upgrade your databse server to Ms Sql 2000. /// </remarks> public override string IdentitySelectString { get { return "select @@identity"; } } } } Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MsSql2000Dialect.cs 28 Aug 2004 15:32:33 -0000 1.18 --- MsSql2000Dialect.cs 19 Sep 2004 16:13:01 -0000 1.19 *************** *** 89,93 **** public override SqlString AddIdentitySelectToInsert(SqlString insertSql) { ! return insertSql.Append( "; SELECT SCOPE_IDENTITY()" ); } --- 89,93 ---- public override SqlString AddIdentitySelectToInsert(SqlString insertSql) { ! return insertSql.Append( "; " + IdentitySelectString ); } *************** *** 96,102 **** get { return true; } } public override string IdentitySelectString { ! get { return "select @@identity"; } } public override string IdentityColumnString --- 96,103 ---- get { return true; } } + public override string IdentitySelectString { ! get { return "select SCOPE_IDENTITY()"; } } public override string IdentityColumnString |