AdventureWorks 2014 database for SQLite - sql-server

For university purpose I need to use AdventureWorks 2014 sample database. What I can download is a .bak file to use with SQL Server, but I'm using DataGrip with SQLite on MacBook. How can I convert it or get it to work with my setup?

If you are required to use the AdventureWorks database for your course, you will need access to an instance of SQL Server. There is no way around this. You can install Developer or Express edition in a Windows VM on your MacBook, dual-boot Windows via Boot Camp, get access to a server on-campus, or set up a VM on Azure or AWS with SQL Server on it and restore the database there.
There is no way to use a SQL Server database backup file with SQLite or any other RDBMS that isn't SQL Server. Further, I expect that if your course requires this database for the assignments, "converting" it to SQLite isn't going to do you any good because of the differences between the two RDBMSs - they use different dialects of SQL and have different features.

Related

Deploying a database to SQL Azure through SSMS fails with views in the database

I'm having issues deploying databases to SQL Azure DB from SQL Server Management Studio using the Tasks > "Deploy Databases to Microsoft SQL Azure" option path. I notice this tends to fail if the database has views. Is this a well-known issue or am I doing something wrong?
Please consider not using SSMS and use Microsoft Data Migration Assistant (DMA) instead. DMA is the easiest way to migrate a database to Azure SQL Database. It gives you an assessment of the database and tells you about possible blocking points and existent incompatibilities of the database with Azure SQL Database. You can download DMA from here.

Syncing a SQL Server CE database with a regular SQL Server database

There's an Umbraco site that various people been contributing content to. It runs on a hosted domain using a SQL Server Compact edition database for the CMS. It's about to go live and I need to sync the dev database to the live SQL Server instance which is hosted by a third party.
I just ass(u)me(d) that I could attach the .sdf to my local SQL Server and use a commercial tool (Redgate/SQLDelta etc.) to copy it to the live db. This does not seem to be possible. While I have managed to attach the .sdf using Linqpad, I can't connect to it like a regular database.
The best option seems to be to script out the entire database, but this seems like an impossible task using just Linqpad (no flies on Linqpad, obviously - it isn't the tool for such a task). Any less onerous options would be gratefully accepted.
You can use my free "SQL Server Compact Toolbox" Visual Studio extension for this. It can generate a script of the entire SQL Server Compact database, that you can then run against an empty SQL Server database.
In the past I did this kind of scenario wherein I need to copy the data from the SQL Server CE to a SQL Server database. Have you tried adding the .sdf to an ODBC then linked that ODBC to SQL Server?

Proper way to Import data from Access to SQL Server?

I'm asking for the proper way, in SQL Server's T-SQL (I think that's what it is) code or using another language, to import data from a Microsoft Access MDB Database into a new SQL Server Database.
Now, typically I would just import it in. The problem is I'm writing a .SQL script (I could use another technology if needed) to do all this leg work as this will need to be done fairly regularly. Likely at least once a week, for about 5 months in the year.
To digress a tad, I had wanted to implement a single database and distinguish separate source database using something like a DatabaseID field, but the powers that be overthrew me there.
I was previously using SQL Server Management Studio 2012 with SQL Server 2008 running the T-SQL (on a production machine) that worked fine. I've now migrated to a local SQL Server Management Studio 2012 with SQL Server 2012 (for development) and the code that used to work doesn't anymore.
This code is what used to work: SELECT * INTO [dbo].[Controls] FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\Show.mdb; Jet OLEDB:Database Password=BobSaget')...[Control] The password has been obfuscated for security ...
That's likely a sloppy solution. What's the ideal way?
Thanks in advance!
I would recommend using Microsoft's SQL Server Migration Assistant for Access.
SQL Server Migration Assistant (SSMA) is a free supported tool from Microsoft that simplifies database migration process from Access to SQL Server. SSMA for Access automates conversion of Microsoft Access database objects to SQL Server database objects, loads the objects into SQL Server, and then migrates data from Microsoft Access to SQL Server.
SSMA for Access v5.2 is designed to support migration from Microsoft Access 97 and higher to all editions of SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, and SQL Azure.
You can find it here.
You may need to fix the structure after the migration as it tends to over exaggerate many of the data types.
Have you checked your DCOM security on MSDAINITIALIZE?
I had this problem when moving to a local instance of SSMS 2012.
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2011/09/28/troubleshooting-cannot-create-an-instance-of-ole-db-provider.aspx

Database created in XP to be opened on Vista

I have a database in SQL server which is created on xp and to be opened on vista
When i try opening it on Vista.
Would this be possible
Thanks
Sun
SQL Server creates files that SQL Server can read. The file formats are independent of Windows versions.
What you should be aware of/considering are SQL Server versions and editions.
For instance, if you create a DB using SQL Server 2008 R2, you will not be able to attach/restore such a database using SQL Server 2005 or 2008, no matter what OS you're working on.
Similarly, if you've applied a particular service pack to the installation where the .mdf originates, you need to be working at the same or later service pack on the system where you want to read the file.
Similarly, if you create a database that uses features that are only available in higher level editions of SQL Server - i.e. something only available in Enterprise/Developer edition - you may have issues using the same database on a Standard Edition installation.
You don't open a sql server database with "xp" or "vista". You open the database in Sql Server. That's all that matters here: does the machine have the correct version of Sql Server available? Note that no version of Windows ships with Sql Server installed by default.
Also, unless you're talking about Sql Server Compact Edition you might want to re-think this. Full editions of Sql Server belong on the server editions of Windows. If you're building a database for an app that will live on individual user's desktop and the database will only serve the instance of the app on the machine, do not use sql server for that database. Instead, use something like Sql Server Compact Edition (it uses a different engine than full sql server that is more desktop-friendly), SQLite, or even Access.
Yes, there is no reason why this should not work.
As #Demian said, you can not open database created in SQL Server 2008 R2 in SQL Server 2008. But alternatively if you are sure that your database is not using any features specific to R2, you can script out whole database and then create similar database by running those scripts into SQL Server 2008 (ofcourse with some changes in script). And then just write some insert scripts to import data from 2008R2 to 2008 (Or you can use SSIS to dump data from one location to another location)
I think the question itself is pretty unclear. No explaination of environment of both XP and Vista machines (e.g. DBMS versions including SPs) or how you are trying to open/access database (using attach or by restoring backup). Without proper information I don't think there is any EXACT solution.

Will a database generated from SQL Server Express work with the main version of SQL?

I want to create a SQL Server Express database on my local machine and then upload it to a website that will be using the full SQL Server software - can I do this ?
The MS SQL Express databases are completely compatible with full versions of MS SQL Server. So just backup and restore.
You certainly can. You have a few options:
Backup and restore
Script everything manually
Database publishing wizard
Microsoft SQL Server Database Publishing Wizard can be found here:
http://www.microsoft.com/downloads/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
Yes, they are designed to be compatible. You can either script out of the database or use the Backup/Restore functionality built into SQL Server Management Studio. More details on the latter can be found here.
You can move from SQL Express to the full SQL Server quite easily. There's a couple of ways to go about doing this, but the easiest is to back up the databases in question on SQL Express, install the full version of SQL Server, and restore the databases there. Both programs use the same database backup format. However both instances of SQL Server should be configured with the same collation.
A better approach might be to buy SQL Server Developer edition. It's quite cheap and will install on a desktop O/S such as Windows XP. The main advantage over SQL Server Express is that it has all of the features of Enterprise Edition (CLR sprocs, SSIS etc.) and you can develop with this functionality. YMMV as you may or may not need these features.

Resources