Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6373353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:21:12+00:00 2026-05-25T01:21:12+00:00

I am working on Rails 3 project where I initially used MySQL as RDBMS.

  • 0

I am working on Rails 3 project where I initially used MySQL as RDBMS. But later my client requested that we should use MSSQL. After spending half a day, I am able to connect with the MSSQL server using the article here: http://oldwiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServerFromRailsOnLinux

But after all the effort, when I tried to migrate, I got following error:

Here is error with rake db:migrate

==  CreateUsers: migrating ====================================================
-- create_table(:users)
rake aborted!
An error has occurred, all later migrations canceled:

37000 (2715) [unixODBC][FreeTDS][SQL Server]Column, parameter, or variable #1: Cannot find data type primary_key.

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

When I re-run the same command, I get the error:

rake aborted!
S0001 (2714) [unixODBC][FreeTDS][SQL Server]There is already an object named 'schema_migrations' in the database.
  • which means atleast connection is working!

Following is the error with rake db:schema:load

-- create_table("banners", {:force=>true})
rake aborted!
37000 (2715) [unixODBC][FreeTDS][SQL Server]Column, parameter, or variable #1: Cannot find data type primary_key.

I googled for the error but could not find any help, it seems its not a popular combination.

I am at present looking at this problem in two ways:

  1. try to solve the problem in hand, by making rails output SQL in MSSQL friendly format. And if the first one fails then

  2. as a workaround, convert the raw mysql dump to MSSQL format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:21:13+00:00Added an answer on May 25, 2026 at 1:21 am

    As I got no answers, I went with a solution close to #2 above. I created the database tables one by one by using MSSQL import and export wizard by connecting it through a MySQL DSN. I am still looking for a way to do this is pure rails way, because every time I change any models, I have to manually update the MSSQL database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on my first Rails project, I used Ryan Bates' Nifty-Generators to create the
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
We're working on a Rails project on Heroku that needs to scrape and process
we are currently working on a rails project that uses i18n and we have
My client wants me to download a working ruby on rails project to my
I am working on a Rails 3 project. At the client site, the network
I'm working on implementing omniauth into a Rails project. My problem is that the
I try to run a working rails project from OSX to Debian. I use
On a rails project that I know to have been working as recently as
I'm working on a Rails project that utilizes Action Mailer to send out mail

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.