Rails and SQL Server – “There is no text for object”

Posted by Brian in Howto, Rails, tips (February 23rd, 2010)

I recently moved a Rails application to a new SQL Server 2005 server on a recent project and everything seemed to go smoothly, but when I tried to fire up a connection to the database from my Rails application, I was greeted with

ActiveRecord::StatementInvalid: DBI::DatabaseError: 42000 (15197) [FreeTDS][SQL Server]There is no text for object 'people'.: EXEC sp_helptext people

The “people” table here is actually a view that gets used all over the place in multiple applications. The DBA had moved the databases from an older SQL Server 2000 database previously.

The solution was to ensure that the application’s user account had the “view definition” permission on the view in question as well as the “select” permission. On the view, in the SQL Server Management Studio, right click and choose “Properties”. Then choose Permissions select your user account, and then select the “View definition” permission. Checking the box under the “Grant” column was enough for me to make it work.

Interestingly enough, the production server (which was upgraded months ago from SQL Server 2000 to 2005), does not have the permission set, but still works fine.

Hopefully someone else finds this useful.

2 Responses to ' Rails and SQL Server – “There is no text for object” '

Subscribe to comments with RSS or TrackBack to ' Rails and SQL Server – “There is no text for object” '.

  1. Klaus said,
    on April 9th, 2010 at 2:16 am

    Thanks Brian,

    it solved my problem to ( using a SQL Server 2005 )

  2. Nathan Dove said,
    on May 5th, 2010 at 2:10 pm

    Thanks for the post – this fix resolves the problem for SQL Server 2008 as well! I would have otherwise had a difficult time solving the problem because I don’t have administrative access to the SQL server.

Leave a reply

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: