Cannot restore CDC-enabled DB on Express Edition - sql-server

While restoring database I got this error
SQL Server cannot load database 'XXX' because Change Data Capture is enabled. The currently installed edition of SQL Server does not support Change Data Capture. Either disable Change Data Capture in the database by using a supported edition of SQL Server, or upgrade the instance to one that supports Change Data Capture.
Mine SQL Server
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (Intel X86) Jun 28 2012 08:42:37 Copyright (c) Microsoft Corporation Express Edition with Advanced Services on Windows NT 6.1 (Build 7600: )
I know there is no feature of CDC in Express Edition but i got XXX.bak file which i need to restore on my sql server. Is there any way of script to remove CDC feature from the file?

Related

FILESTREAM feature is disabled.

I am trying to restore a backup of database taken from sql server 2012. The destination system as sql serer 2017(Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 16299: ) )
But I am getting this error:
TITLE: Microsoft SQL Server Management Studio
Restore of database 'SITELINEDEV' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: FILESTREAM feature is disabled. (Microsoft.SqlServer.SmoExtended)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=14.0.17213.0+((SSMS_Rel).171128-2020)&LinkId=20476
Can you please suggest me solution to this?
Enable the filestream feature of your SQL 2017 instance and try the restore again.
One way to enable filestream is with SQL Server 2017 Configuration Manager (C:\Windows\SysWOW64\SQLServerManager14.msc). Select SQL Server Services, right-click on the SQL Server service in the right pane, and select Properties. Click on the FILESTREAM tab and check the Enable FILESTREAM check boxes.
I'm pretty confident you can't restore a .bak from a 2012 server to 2017. I'd recommend Generating Scripts for the database, and include both schema and data and run the generated scripts against your 2017 server.

SQL Server Database Mail Error/Missing

Current SQL Server:
SQL Server 2016 Express SP1
Microsoft SQL Server 2016 (SP1-CU7-GDR) (KB4057119) - 13.0.4466.4 (X64)
Dec 22 2017 11:25:00
Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 15063: )
Downloaded Cumulative Update 1 and went through the installation steps
Downloaded Microsoft .NET Framework 3.5
Database Mail still does not show. Suggestions?
Of note, when I click on the download file for Microsoft .NET Framework 3.5, it doesn't do anything even when trying to run as an Administrator.
Thank you!
http://www.sqlservercentral.com/blogs/querying-microsoft-sql-server/2013/09/02/sending-mail-using-sql-server-express-edition/
In SQL server standard and enterprise edition,A DataBase mail functionality in built to sent mail.But in SQL Server express edition,You need either use CLR integration or configure SQL Mail using MSDB system database.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/cd59b9cc-21ea-4130-afd1-791124031ada/can-sql-server-express-send-emails?forum=sqlexpress
You can make use of CLR Integration for sending email from SQL Server Express.
http://www.sqlservercentral.com/articles/SQL+Server+Express/71341/
http://www.vnypatel.com/sending-emails-with-clr-sql-server-express-editions
SQL Server Express does not support database mail.
https://msdn.microsoft.com/en-us/library/cc645993.aspx

SQL Server "Index Usage Statistics" report causes "incorrect syntax near ')'"

In SQL Server 2008 R2 Standard Edition:
SELECT ##version
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) Jun 17 2011 00:54:03 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)
with non-express edition tools:
Microsoft SQL Server Management Studio 10.50.2500.0
Microsoft Data Access Components (MDAC) 6.1.7601.17514
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.0.8112.16421
Microsoft .NET Framework 2.0.50727.5448
Operating System 6.1.7601
running on Windows Small Business Server 2011 Standard 64-bit:
Against a database in SQL Server 2000 compatibility mode:
If I try to run the Index Usage Statistics report I get the error:
How to make it go away?
I threw in every red herring I could think of. There should be enough extraneous information that everyone can throw out a theory.
The various reports in SQL Server Mgmt Studio make use of DMV (dynamic management views) like the sys.dm_db_index_usage_stats to fetch their data.
Those DMV are only available if you're running on compatibility level 90 (SQL Server 2005) and up. You won't be able to get this to work if you're stuck in SQL Server 2000 compatibility level (80), unfortunately.

SQL Server 2008 R2 Express: MDF file not attached in SQL Server 2008 Developer

I use this command on both express and developer addition
select ##VERSION
Express server result is below
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (Intel X86)
Apr 22 2011 11:57:00
Copyright (c) Microsoft Corporation
Express Edition with Advanced Services on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)
and developer result is blow
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)
Jul 9 2008 14:43:34 Copyright (c) 1988-2008 Microsoft Corporation Developer Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)
When I try to attach the MDF file from my Express edition to my developer edition, I get this error:
An exception occurred while executing a
transact sql statement or batch the
database 'example' cannot be opened
because it is version 661. This
server supports version 655. A
downgrade path is not supported could
not open new database 'example' create
database is aborted. Microsoft Server,
Error: 948
Since your version of Express is newer than your version of Developer, you will not be able to migrate directly, but you have a few options, in my order of preference:
Upgrade to SQL Server 2008 R2 Developer Edition - by far the simplest approach
Use a third party product to replicate schema and then the data (e.g. Red Gate SQL Compare / SQL Data Compare - I blogged about several other options here).
Use a manual script, such as this one from Jonathan Kehayias
Use the import-export wizard from Developer Edition to pull the data/schema from Express
This is the problem of your sql version. You have created database in another version and the version in which you are trying to attach is different and old.
What you can do is create a backup file, and create new empty database and then restore that backup in it.
Note: While restoring, after providing backup file, see on left side, there is "options", click it, and then in there, you must select overwrite option, other wise it will give you structure error that the database backup that you are trying to attach has different structure than the database in which the backup is being restored.
Since SQL Server does not allow downgrading you can create a backup of your database in SQL Server 2008 instance and use third party tools, ApexSQL Diff and ApexSQL Data Diff to restore the backup from an older to a newer version of SQL Server.
You can read detailed explanation of the process in this article:Restoring SQL Server database backup to an older version of SQL Server
Hope this helps
Disclaimer: I work for ApexSQL as a Support Engineer

Copying SQL Server DB using script

I have to copy a db from a remote server to my local dev machine.
What is the best way to do it.
Last night I made a script for the remote db using xSQL Object and ran it on the local server. the script gave a bunch of errors. Below is the select ##version output for the 2 servers. is there a reason the script is not working
The remote server is using SQL server authentication, the local one is using windows authentication
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (X64)
Jul 9 2008 14:17:44
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2)
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)
Jul 9 2008 14:43:34
Copyright (c) 1988-2008 Microsoft Corporation
Express Edition with Advanced Services on Windows NT 5.1 <X86> (Build 2600: Service Pack 2)
It would be helpful if your provided some of the errors your script produced.
I notice you're using Enterprise and Express editions - these two editions have differing features, described here: http://www.microsoft.com/sqlserver/2008/en/us/editions.aspx. Perhaps you're using a feature that Express edition doesn't support, or your database is too big.
Not sure if the functionality is exactly the same in 2008, but in 2005, you can open up SQL Management Studio, right-click on the dbase you'd like to copy, and then click on Export Data.
This will guide you through a wizard, allowing you to export the data to another SQL dbase, including one that runs on your local machine. Used it many times - works great.
Why don't you just do a backup and restore?

Resources