Hi all, I'm trying to get rails up on mssql for a friend, does anyone have experience? We're working on a Windows XP box with MSSQL 2000 (no service pak), and both rails (1.1) and MSSQL are on the same box. I'm running into a bug (I think) where activerecord is using this syntax: SELECT TOP 1 * FROM users WHERE (users.user = 'jbgnuumnbu') However, users.user is not a valid syntax in MSSQL. Why doesn't AR handle this? Arn't other people using this without problems? Found the error running rake migrate. -- Matthew B. :: email@example.com Resume & Portfolio @ http://madhatted.com
on 2006-04-07 18:57
on 2006-04-07 20:39
Looks correct to me. users is the table, and user is the column. tablename.columnname is always acceptable because of possible ambiguity. @user = User.find_by_username('jbgnuumnbu') would return exactly what you see there.
on 2006-04-08 00:26
Brian H. wrote: > Looks correct to me. > users is the table, and user is the column. tablename.columnname is > always > acceptable because of possible ambiguity. Well it may work in find_by, yeah. The error was from the validates_as_unique, so I've gone and changed it to not use the table name. I'm not sure if the rest of rails uses it as well. Another frustrating point has arisen though. The rake tests uses a DBI string for the "host" argument of the mssql db dump/import tool (called scrtxfr or something). The host argument _actually_ needs to be just the host. If I change the host in database.yml, I make rails no longer connect to mssql via AR. Is anyone out there using mssql? -- Matthew B. :: firstname.lastname@example.org Resume & Portfolio @ http://madhatted.com