VS Studio 2015 and management studio 2012 - sql-server

So I made a data on sql server manangement studio 2012. When I went to access that data in visual studio and gave me an error and told me I needed to upgrade database. Which it asked and I said yes. So I worked with the database a little and inserted a couple of cells from Visual studio and now when i log back over to management studio the database is stuck in recovery pending. Is there a way to fix this? This is localdb so the files and mdf.

VS2015 is not the best suite for SSMS 2012, it will bring the compatible issue, for example, the integration service, etc. Switch to use VS2012, and if your database is in Restoring status for long time for small size database, most likely you did not use With recovery when you Restore the database because the database is waiting for the latest Transaction Log, you could try Restore Database [YourDatabase] with Recovery, and then refresh it, should be good.
PS :you could add STATS to track the progress just in case that database is still being restored.

Related

SSMS Tables (expanding...) when trying to refresh

I have sql server management studio (SSMS) v18.9.1 and visual studio 2022 v17.1.1.
I'm using EF Migrations (dotnet 6) and after making changes to the pocos, I run add-migration followed by update-database from the package manager console window in visual studio.
If I try to refresh SSMS by right-clicking\Tables\Refresh I'm presented with SSMS Tables (expanding...) message. The table do eventually appear but this can take up to 10 minutes.
My colleague is experiencing the same behaviour on his laptop.
Any ideas how to fix?
if you are accessing your local database it will be fast. if you accessing azure or cloud database it will take time based on load. it will not occur often.

Sql management Studio 2014 crashed + backup databases before reinstall

I have installed sql server 2014 standard edition on windows server 2012R2, it was working fine. but after few days i try to open management studio but it says cannot find one or more components try reinstalling the application. i have seen many solution for recovery and reinstalling but my first concern is data backup. as its a live system i dont want to lose any data. can any one tell so surely that how i can backup data and recover management studio. are there any files which need to be copied and can be replaced after reinstalling. i will be thankful if some one can give sure answer. Again remember its a live system i cannot lose any data. Thanks
I hope that SQL services are still online, you can take backup using sqlcmd and try to repair the management studio.
example.
SqlCmd -E -S Server_Name –Q “BACKUP DATABASE [Name_of_Database] TO DISK=’X:PathToBackupLocation[Name_of_Database].bak'”

How to restore SQL Server 2014 database to SQL Server Express 2012

When I try to restored DB , every time I am getting this error
TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore of database 'PramodDb' failed.
(Microsoft.SqlServer.Management.RelationalEngineTasks)
------------------------------ ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: The database was backed up on a server
running version 12.00.4100. That version is incompatible with this
server, which is running version 11.00.6020. Either restore the
database on a server that supports the backup, or use a backup that is
compatible with this server. (Microsoft.SqlServer.SmoExtented)
Please help me.
Like always it helps to read the error. Let me quote pretty much all of your error message:
The database was backed up on a server running version 12.00.4100. That
version is incompatible with this server, which is running version 11.00.6020.
Either restore the database on a server that supports the backup, or use a
backup that is compatible with this server.
General rule: No downgrade. On top, restoring on express is generally possibly problematic due to the limitations of the express version.
So, you need to either export/script import the database, or grab yourself and install the free developer version. Ever since they made this one free there is no excuse for even the most junior developer not to work against it.
The answer you cannot do that. You cannot downgrade a database.
As far as the work around is concerned you need to use the Import/Export wizards in SSMS to make it working.
You can't, but...
You can try Scripting your 2014 database and execute the Scripts on a blank 2012 database.
To open the Generate and Publish Scripts Wizard: In Object Explorer, expand Databases, right-click a database, point to Tasks, and then click Generate Scripts. Follow the steps in the Wizard to script all database's objects.
Note the disk space required.
You can script schema and data. See the following article:
https://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/

Adventureworks restore failed

I've just installed MS SQL Server Express 2014 and SQL Server Management Studio 2014 under Windows 10. I'm following the official Microsoft tutorial on database fundamentals, which uses the Adventureworks DW2008 database. I have tried to restore this dB using the Restore GUI, but it fails every time, as shown here:
AdventureWorks restore failure
I have verified the backup media, but it still fails. I have also restored a different dB, and that worked fine, so I know I am following the correct procedure. I have the file (AdventureworksDW2008Big.bak) in the following location:
C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Backup
Yes, I have thoroughly researched this, but still apologies if there is already an answer on here - I couldn't find it.
The DW in the filename is for Data Warehouse and only works on that edition of SQL Server. As you only installed SQL Express you cannot use it.
Why not try Adventure Works 2014 Full Database Backup.zip instead. If you really need 2008/R2 try the none-DW from here:
AdventureWorks2008R2_Database.zip
AdventureWorks2008_Database.zip
I do not know if it will solve your problem or not,
but I had same problem. I mean I am using SQL SERVER 2017 and I wanted to restore AdventureWorks2012.
I received restore failed error, and I decided to restore AdventureWorks2017. my queries on AdventureWorks2012 in an older system in university led to the same results as my queries in AdventureWorks2017 in my system. if you are using a version of SQL SERVER and trying to restore an older or another version of AdventureWorks, you can try the same way.
I mean restoring a version of AdventureWorks which is the same as the version of your SQL SERVER.
Best to run SSMS as an administrator to avoid access denied errors (do this by right click on SSMS and choose More -> administrator)
copy adventureworksxx.bak into the sql server DATA directory where by
default all databases are usually located. ( Note: if it is in other directory
the restore may not find it OR may cause errors later)
Restore the database

Azure SQL Database Management GUI, where is it?

Are we going back to green command prompts in place of the GUI. I like the cloud sql database but I also like the GUI of management studio of traditional SQL databases of the past. Its a major cut in productivity going back to scripting what you used to be able to see in a GUI. Visual Studio database designer fails almost 95% upon loading when connecting to an Azure cloud SQL database. In fact that surface designer will only load local databases and that is a 60 second plus struggle of crossing your fingers. So visual studio 2012 to 2013 is a not a valid until some awake folks at Microsoft decide to make that a working reality.
What work a rounds are there to view and/or design cloud SQL databases. Keys, constraints indexes, etc..
Looks like you can do it by latest update of SSMS 2014
SQL Server 2014 Management Studio - updated support for the latest Azure SQL Database Update V12 (preview)

Resources