1

Could someone tell me if you can import an Access database into SQL Server retaining the keys and the relationships established in Access?

If so, please show me how I can do this.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Jota Q
  • 53
  • 1
  • 4
  • Have you tried googling "import access database to sql server"? Here is the first link that I found in that search: [https://support.microsoft.com/en-us/kb/237980](https://support.microsoft.com/en-us/kb/237980) Also possible duplicate of [http://stackoverflow.com/questions/1307512/how-to-export-an-entire-access-database-to-sql-server](http://stackoverflow.com/questions/1307512/how-to-export-an-entire-access-database-to-sql-server) – John Odom May 06 '15 at 16:53
  • Yes. I did it... and it is not that easy. the link you send me does not work because refers access 97!!!!! and I need the utility imports the relationship between tables. Import without keys and relationship is easy but with keys and relationship... That is what I want to know. – Jota Q May 06 '15 at 17:04
  • 3
    [SQL Server Migration Assistant for Access](http://www.microsoft.com/en-us/download/details.aspx?id=43690) – Gord Thompson May 06 '15 at 17:11
  • @JotaQ What version of access are you using then? You should add a tag to your question specifying the version. – John Odom May 06 '15 at 18:07

2 Answers2

4

(Quoting a comment to another answer:)

I am tried with Microsoft SQL Server Migration Assistant for Access and this tool doesn't export relationships

Nonsense. SQL Server Migration Assistant for Access definitely can transfer an Access database to SQL Server and preserve the relationships between the tables.

Access database:

accessDb.png

SSMA for Access report:

ssmaReport.png

Resulting SQL Server database:

ssmsDiagram.png

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
1

This refers to Access 2007 - Access does not automatically create relationships between related tables at the end of an import operation. You must manually create the relationships between the various new and existing tables by using the options on the Relationships tab. To display the Relationships tab:

https://support.office.com/en-au/article/Import-or-link-to-SQL-Server-data-a5a3b4eb-57b9-45a0-b732-77bc6089b84e

bob kendall
  • 55
  • 11
  • 3
    I thought the question was about importing in the other direction, *from* Access *to* SQL Server. – Gord Thompson May 06 '15 at 17:45
  • I am tried with Microsoft SQL Server Migration Assistant for Access and this tool doesn't export relationships... I think it's impossible... – Jota Q May 06 '15 at 20:42