The blog of Rahoul Baruah from 3hv Ltd

What's going on?

My name is Rahoul Baruah (aka Baz) and I'm a software developer in Leeds (England).

This is a log of things I've discovered while writing software in Ruby on Rails. In other words, geek stuff.

However, I've decided to put this blog on ice - I would ask you to check out my business blog here (or subscribe here).

02 December, 2005

SQL Server is a pain!

This happened to me, using SQL Server 2000 (SP3).

I have set up a load of views in my database as username.thingies and username.wotsits etc. The idea being that as the views are qualified by the name username then they will not interfere with the non-Rails stuff in the database. On my machine, logging in as username meant that

"select * from thingies"

worked fine. But as soon as I did the same on the dev server it would say “object thingies does not exist”. I needed to do a

"select * from username.thingies"

Which is annoying. I tried getting Rails to prefix the table names but that was a bit dodgy (working on some machines and not others).

However, I found out what the problem is – if you look at username in Server/Security, on the dev server, username was set up as a system administrator. Untick that option and everything is OK. Why it is like this I do not know …

No comments:

eXTReMe Tracker