# Activerecord and mssql server

**URL:** <https://www.ruby-forum.com/t/activerecord-and-mssql-server/58149>\
**Category:** Rails\
**Created:** [April 18, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/activerecord-and-mssql-server/58149 "2006-04-18T23:47:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e8c25b/32.png) [@bloc](https://www.ruby-forum.com/u/bloc)\
**Post date:** [April 18, 2006, 11:47pm UTC](https://www.ruby-forum.com/t/activerecord-and-mssql-server/58149/1 "2006-04-18T23:47:09Z")

</div>

I’m trying to use activerecord outside of rails with a  
legacy mssql database. Reading from the db works, but  
when I try to save a new object (i.e. insert) I get  
the following error.

DatabaseError: Execute  
(ActiveRecord::StatementInvalid)  
OLE error code:80004005 in Microsoft OLE DB  
Provider for SQL Server  
Cannot create new connection because in manual  
or distributed transaction  
mode.  
HRESULT error code:0x80020009  
Exception occurred.: SELECT @@IDENTITY AS Ident:

Anyone have any ideas on this? mssql server is not my forte.

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[Yahoo Mail - Organized Email](https://mail.yahoo.com)**
>
> It's time to get stuff done with Yahoo Mail. Just add your Gmail, Outlook, AOL or Yahoo Mail to get going. We automatically organize all the things life throws at you, like receipts and attachments, so you can find what you need fast. Plus, we've got...
