I started using a Sql Compact version of my DB and during the development it occured that the DB needs to be accessible over the network.
Cause I wasn't able to find a way to share the SDF file over net without replication I need to import it into SQL Server 2008 (Express).
Any Ideas?
I solved my problem. GvS's advice gave the keywords to search for:
http://bembengarifin-tech.blogspot.com/2008/08/generate-script-export-data-from-sql-ce.html
CodePlex has a couple of tools now which perfectly address this question.
These are IDE extensions.
If you are using SQL Server Management Studio Express or higher, get this one.
If you are using Visual Studio 2010 Pro or higher, get this one.
This is harder as it looks, because it doesn't seem to work with the SQL Server Import and Export wizard.
You could write a small program, that gets all data from your SDF file table by table/record by record, and then inserts them into the SQL database.
I was looking out to see if you could use ODBC to directly access the database file, but apparently, no... According to this forum thread your best bet is to try to access it through OLEDB/ADO.
Related
I am trying to move my rapidly growing MS Access 2016 database to a SQL Server back end and build an asp.net front end. I am trying to migrate data from the Access database to an instance of SQL server 2014 but this is not going so well. I tried to migrate it using the MS Migration Assistant but this is not supported for versions after 2010. Does anyone know an easy way to convert Access tables to SQL Server?
Thanks in advance.
The only migration assistant that was depreciated was the one built into Access. So you are correct that after Access 2010, the migration system is removed.
However, there is a SQL Migration Assistant for Access that can be used here:
https://www.microsoft.com/en-us/download/details.aspx?id=54255
The above SSMA for Access is better than the old migration assent and is designed for upgrading Access to SQL server.
NOTE CAREFULLY that the shortcut on the desktop is for office x64 which FEW have, so make sure you launch the x32 bit version of SSMA – you find the shortcut to x32 in the programs folder (or just type I SSMA in windows 10 and select the x32 version.
AGAIN:
Make sure you follow above to launch the x32 version else it will not work.
Create your database in SQLServer
In Management studio, Right click on your database. Go to
Tasks
Import data
This should bring up the SQL Server Import and Export Wizard
In Data source, choose Microsoft Access. I have 3 choices in my test server. I'm not sure what one to use, so it might pay to play around.
Follow the Wizard, which should get you to were you want to be
To automate migration from Microsoft Access database(s) to SQL Server
SQL Server Migration Assistant (SSMA) is a free supported tool
A video tutorial and all procedure I posted on the blog:
https://www.imran.xyz/convert-microsoft-access-database-to-sql-server-database/
You can download it from Microsoft
https://www.microsoft.com/en-us/download/details.aspx?id=54255
Regarding the following images, I have obviously installed the Microsoft SQL Server, but I can't find the exe-file or anything named Microsoft SQL Server in the start menu.
Anyone who knows what to do to solve this, or do I need to install something more?
SQL Server runs as a service. You can start and stop it from windows services. SSMS is a gui tool for managing ddl (creating and altering tables and index's for example) and dml (writing queries to inquire, update or add data to databases).SSMS comes free with every edition of SQL server - perhaps you didn't tick a box when installing? You can also do this stuff the old fashioned way using sqlcmd from command line(DBAs love this for some reason) but for us mortals SSMS is much less of a struggle. As an aside there are other guis such as Toad (expensive) and Heidisql (free) amongst others which will do the job.
Looks like you have the engine. What you've got to do now is install SQL Server Management Studio: https://msdn.microsoft.com/hr-hr/library/mt238290.aspx
Looks like you have the various SQL Server components that are installed by Visual Studio (recent version) or SQL Server Data Tools (as used by VS).
I'm new to SQLServer and related Visual Studio tools though I know SQL well.
I want to have a local test DB on my dev PC with some stored procedures (so it needs to be SQL Server not SQLLite). LocalDB seems the answer and I can create a LocalDB MDF file through Server Explorer. But I don't think I can/should be putting an MDF file in version control - other developers need to have this DB for their local testing too.
I feel like the Visual Studio SQL Server Project type is what I'm after here but I don't see how such a project is linked to an actual DB. In my mind I imagine setting up a SQLServer project in VS, adding tables/stored procs/etc, and this will automatically build a LocalDB MDF file.
I'm unsure how thee things hang together and where the files all go, can someone help clarify this?
I'm basically starting from the point: I have a SLN with my C# projects in. My C# code calls certain stored procedures using a connections string from configuration but no DB actually exists in the wild yet. Any developer ideally needs a dummy DB to be created when they build the code, not have to create it manually, without installing SQLServer.
So it seems like I want to create a SQLServer Project in my solution, which will magically create a LocalDB. Is that feasible/correct?
Do you need to use Visual Studio at all, would SSMS not meet the requirements if you only want to execute some stored procedures? SQL Server Express is free, it's just limited on size, I believe that the SQL developers edition is free as of pretty recently, may be worth looking into.
I've got a couple of installations of SQL Server on Hyper-V Virtual machines too for testing purposes, this could be an option.
I'm working on an ASP.NET MVC site which will have a database. While I'm in this very early testing/concept phase I'm not hosting the database anywhere, just inside the local mdf file. What are some tools I can use to connect to the local test server so I can browse the tables and run test queries against the information in them without having to implement my own code/views? I'm interested in something like Sequel Pro for the Mac or phpmyadmin for linux (OS doesn't really matter since I'm working on a Mac developing inside a win 7 virtual machine).
Thanks!
(NOTE: I realize it is possible to get the table info dumped via Visual Studio, but it seems slow and not too useful... unless I'm missing a good way to use VS2010 the way I'd use one of the tools mentioned above?)
You can use SQL Server Management Studio Express to browse it, and do several other useful things as well, including table design and the like.
Consider using the built in tools right within Visual Studio. You'll need SQL Express installed, but you won't necessarily need Management Studio.
Go back to the Visual Studio installer (Repair or resintall features), and ensure that's selected as a feature.
Open Server Explorer, and create a new Data Connection.
Choose Microsoft SQL Server Database File
find your .mdf
Server Explorer then gives you a drill down of your Tables, Views, Stored Procedures, etc.
I need a tool that will look at a Microsoft SQL Server database and export the data as a SQL script. I want to be able to run the script on another box with an empty database and insert all the data from the previous one without having to muck with the index's due to ref-integ constraints.
Try a tool like Red Gate Data Compare or DBGhost. Both have trials I believe.
http://www.innovartis.co.uk/
http://www.red-gate.com/products/sql_data_compare/index.htm
Use Microsoft SQL Server Database Publishing Wizard.
Depending on what version of SQL Server you have, you can right click the database, choose generate scripts, choose the tables you want, and uncheck the option to script structure and choose the option to script the data.
If you're using Visual Studio 2008 or above you should be able to script out the database when you do a publish of the website/web application. Scott Guthrie has a few examples of how to do this out of Visual Studio 2005: Deploying a Database Part I and SQL Server Database publishing kit.
Hope this works for you.
I decided to go with Redgate SQL Packager it create a very nice script for the entire DB or an exe that will install it if necessary