2

I'm currently using Microsoft VS 2012 along with Microsoft SQL Server 2014 Express.

I'm trying to work with an existing SQL Server database that I originally obtained as a .bak backup file and had to restore it into my own server.

So adding the said database connection to my VS works fine (testing connection is successful) , however, when ever I try accessing a table (via right click > Show Table Data), I get the following error message:

This database cannot be imported. It is either an unsupported SQL Server version or an unsupported database compatibility

This problem happens only with this specific database, I've tried other DBs that I personally created on previous occasion and all of them seems to work.

I have tried many ways to go around this including :

  • Exporting the table data to excel then importing it back to a new database.
  • Changing the database compatibility level within Microsoft SQL Server.
  • Generating a database script and using it to create a new and empty table to a new database.

Although, none of the above solutions/attempts worked.

That makes me believe that it has something to do with the fact that I originally got the database as a back up file then restored it to my server.

Note: I've being searching for about two days and I already looked around for similar topics but haven't found any that solves my problem. This issue has nothing to do with a specific coding language or what so ever.

Thanks in advance!

EDIT: Having run some more tests, now I can see that none of the other databases that used to work is actually working. This is leading me to think that the problem isn't with that particular database but with the compatibility versions of VS and MSSQL. I am in the process of downloading SQL Server Data Tools for Visual Studio 2012 with the hope that it will resolve my issue. I'll keep the topic updated.

Ahmed Aboumalek
  • 613
  • 4
  • 21
  • What is the SQL Server **version** and edition of the origin database that was backed up and sent to you?? – marc_s Apr 01 '16 at 09:55
  • Sorry for the late response, I had to ask the person about it. It was SQL Server 2012 Entreprise. After running some more tests, I realized that I can't make any of my other databases work for some reason. Now, not only that specific DB tables aren't showing but also the other ones. This makes me thing that now, it's a global problem that is in relation with the compatibility versions of SQL Server and Visual Studio. I'm currently downloading SQL Server Data Tools for Visual Studio 2012 (SSDT), hopping that it will work. I'll keep this topic updated. – Ahmed Aboumalek Apr 01 '16 at 11:01
  • I would *guess* it's a problem with the database compatibility level; SQL Server **2012** supported levels 90 (SQL Server 2005), 100 (SQL Server 2008 / 2008 R2) and 110 (SQL Server 2012), but SQL Server **2014** dropped the support for level 90 (SQL Server 2005). So if the original database was in compatibility level 90, you won't be able to restore it. – marc_s Apr 01 '16 at 11:06
  • I was actually able to restore it in SQL Server, only, I can't access the table date from VS. Before, the problem was only with this table, now It's with all of them, even the ones. I've tried changing the compatibility level of a database to 100 before adding it to VS, but that didn't work either. I accidently bumped into this topic http://stackoverflow.com/questions/24351741/visual-studio-2013-incompatibility-with-ms-sql-server-2014, hopefully that it will do the trick. – Ahmed Aboumalek Apr 01 '16 at 11:16

1 Answers1

2

Problem solved!

All I had to do is install/update SQL Server Data Tools for Visual Studio and that made the trick. I can properly show all of my databases' table data now.

References:

Thanks again for your help @marc_s :)

Community
  • 1
  • 1
Ahmed Aboumalek
  • 613
  • 4
  • 21