I have 2 databases. One is an old one created on Microsoft SQL server 2012 but restored to Microsoft sql server 2014
And another one that was created from scratch on Microsoft SQL server 2016 (was migrated).
I ran on both servers (below)
dbcc dropcleanbuffers;
DBCC FREEPROCCACHE;
When i run my app on first run it takes 30 mins for each database(a lot of data loading).
Once completed i close my app (making sure there are no active tasks)
I run again this time without clearing the cache.
SQL 2012 database now takes 4 mins however my SQL2016 database still take 30 mins.
if i run (below) again they both take the same time. (30 mins)
dbcc dropcleanbuffers;
DBCC FREEPROCCACHE;
I'm assuming this is a cache issue, so what i would like to know is, where are cache settings on the database / server and how to change them which will allow the sql 2016 database to perform the same as SQL 2012 database?
i am using winforms DBCommand and using ExecuteNonQuery() for query execution, I'm using SSMS to connect to sql server to view the database.
Thank you
Related
SQL Server Management Studio 17.2
SQL Server 2014 (v12.0.6329.1)
I'm trying to track down a problematic query. I'm looking at the Activity monitor and when I try to view the whole query, it's truncated.
How do I configure SSMS to show the whole query?
I have a problem with my new instance database in SQL Server 2014, I installed SQL server 2014 and have restored all the databases I had in my instance of SQL Server 2012, but it seems that SQL Server 2014 is slower. Is this the correct way to migrate data?
An example of that is slower is that if I open SQL Server Management Studio 2014 and try to deploy the database tree of my instance and it takes around 3 minutes, mientrar SQL Server Management Studio 2012 takes 3 seconds.
I was researching on how to support databases and replace all compatibility mode to 120 which is the compatibility mode SQL Server 2014 but still just as slow.
Can anybody help me?
Thank you very much and regards
Backup/restore is common way to switch database to another instance.
You mean connect to the instance is slower in new management studio? you need to run sql server Configuration Manager to enable all the server/client protocols such as Shared Memory/Namedpipe etc.
If you are saying the database performance is slower after migrated to new instance. You need to do some migration work:
https://www.mssqltips.com/sqlservertip/1936/sql-server-database-migration-checklist/
I have a restaurant with two computers, on the same network, each computer has SQL Server 2014 and my POS Software (Point of Sale).
Every once in a while I take a backup from my MAIN to my BACKUP computers.
The problem is that in SQL Server 2014 Express, the service SQL Server Agent is not starting, in any way possible, I tried.
I want to be able to connect to my MAIN computer through network.
All SQL Server 2014 data is connected well and working, plus all Services are running well, except for SQL Server Agent.
I see two solutions:
I downgrade my database from 2014 to 2012 and have SQL Server Agent Service Running, however I don't know how to do that.
I fix the SQL Server Agent service and have everything working well, I don't know how to do that either, I tried googling it, awkwardly I couldn't find an answer.
SQL Agent is not available on SQL Server Express edition, only on Standard and Enterprise
If you had SQL Agent running in 2012, that implies you have either standard, bi or enterprise edition.
Downgrading a database to an older version is not an easy task. There is no direct way to do this. If you still have your 2012 backup and very little or nothing has changed since the upgrade, just restore the 2012 database and manually sync the databases (i.e. manually move data). If it's a non-trivial amount of changes, you'll need to do a database copy or export/import from 2014 to 2012.
If you want to setup a scheduled backup of the SQL Express database, you can create a task using Windows scheduler to execute the backup using sqlcmd. For example:
SqlCmd -E -S Server_Name –Q “BACKUP DATABASE your_prod_db TO DISK='D:\folder_on_local_drive\your_prod_db.bak'"
As hinted in the sample, you should backup to the local computer first then copy the backup file to your remote computer. This can be part of the same job (ideally) or a separate job (a bit of extra effort to get the timing right). This can significantly increase the success rate of getting a good backup plus it'll probably run a lot faster too.
In MS SQL Server 2008, I would like to investigate and tune the queries that are being executed by an application in a limited time interval. Can I, e.g. from SQL Server Management Studio, generate a log of all SQL being executed and how long time each query took (and which parameters they were executed with)?
You can use Profiler for this purpose - from SSMS, go to Tools -> SQL Server Profiler.
You need to use the MS SQL Profiler to do this
http://msdn.microsoft.com/en-us/library/ms181091.aspx
I have strange scenario in which if I create database using SQL Server 2008 Express (database compatibility level SQL Server 2008) and perform insert using xml datatype, it executes indefinitely, but when same query is executed on database with compatibility level SQL Server 2005 it runs fine and executes in less than one minute.
Thanks
Microsoft has whitepapers about changes between SQL2005 and 2008. I would look there for any related breaking changes. If you expect to get an adequate answer on this site I would suggest posting code.