SQL Server 2008 to SQL Server CE (Windows Phone 7) - sql-server-2008

I'm looking at the possibility of using the tool SQLMetal. I was wondering is there a way I can create a basic DB using SQL Server 2008 and then convert that to a .sdf so I could then use the SQLMetal tool to create the appropriate WP7 classes.

I suggest you use my SQL Server Toolbox add-in (or if you do not have Visual Studio Pro or higher, you can use my command line utilities). The toolbox allows you to script a SQL Server 2008 database and run this script against a SQL Server Compact 3.5 database. The toolbox can also create the DataContext and related classes via a simple GUI. See my blog for more info: http://erikej.blogspot.com

Related

Run-Time error '-2147024703 (800700c1)' when running Access 2010 with SQL Server 2008

I have an application written in MS ACCESS 2007 using VBA, connecting to an SQL Server at the back end. Both Access and SQL Server are running locally.
My machine runs Access 2010 and MS SQL Server Express 2008 R2 (both 32-bit, on WinXP) with no problem.
I have another machine, Win7 64-bit, running both Access 2010 and SQL Server 2008 (NOT R2) 64-bit.
When I run the Access application on the 64-bit machine, I have a drop down box to select the SQL Server which holds the various databases. When I select the server, after a few seconds I get an error:
Run-time error '-2147024703 (800700c1)':
Automation error %1 is not a valid Win32 application.
When I select the Debug option, the yellow arrow points to:
Set oServer = New SQLDMO.SQLServer
The next line is:
oServer.Connect ServerName, strSQLUser, strSQLPwd
In the watch list, I can see that ServerName, strSQLUser, and strSQLPwd hold the right values to access the SQL Server. I've tested these in sqlcmd and successfully was able to query tables.
Can anyone please help me out on this one? I'm not sure what to do next.
Seems like you've got registered a 32-bit SQLDMO on your system that is being used for connection to the 64-bit instance. Check your registry / file system for SQLDMO.dll versions and register the correct one.
Also check MSDN "Installing SQL-DMO" because SQLDMO was scheduled for remove after SQL Server 2008 R2:
Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
SQL Server Database Management Objects (SQL-DMO) has been removed from SQL Server 2008 R2 Express and the SQL Server 2008 R2 Feature Pack. SQL-DMO also does not support Database Engine features introduced after SQL Server 2000. We recommend that you modify applications that currently use this feature as soon as possible. If you must support SQL-DMO, install the Backward Compatibility Components from the SQL Server 2008 Feature Pack from the Microsoft Download Center. Do not use SQL-DMO in new development work; use SQL Server Management Objects (SMO) instead. You can obtain the SMO documentation by installing SQL Server 2008 R2 Books Online.
Thanks for this.
I looked to find SQLDMO.DLL 64-bit version, but although using the Backwards Comparability package for x64, installing using the MSI did not do the job.
I had to manually extract the files and place the correct version (which is ~2MB larger than the x86 version as an indication to knowing which one is the x64) and then run 'regsvr32 sqldmo.dll ' in the command line (very important: need to run cmd as Administrator for this to succeed).
After the module has been registered, my Access front end run great.

Cannot attach 2008 R2 database to 2008 instance

So I have made a set up file and install it to target computer which has no .Net 4.0 or SQL Server 2008.
I add them as prerequisites and setup downloaded from the internet the .Net 4.0 and SQL Server 2008.
The setup finished successfully.
When I run the program, it gives an exception:
cannot open xxxxxx.mdf file. it is version 650. and your is xxx...
I searched it out and learned that SQL Server installed on target computer is lower than the database file I created (the database file was created in SQL Server 2008 R2).
So, no connections can be opened.
To solve this, What can I do?
Thank you...
You can't attach a 2008 R2 database to a 2008 instance - you can only go forward, not backward. So either install 2008 R2 at the destination, or you'll have to re-create your database in 2008. If you install 2008 locally alongside 2008 R2, you can create an empty database in 2008 and use tools like Red-Gate's SQL Compare / SQL Data Compare, or the schema compare feature in SQL Server Data Tools, to translate your database relatively quickly.
There is no way to open an MDF file with a lower version of SQLServer.
Of course you could add as a prerequisite SQLServer 2008 R2 (express or full).
But the best course is to distribute a SQL Script containing schema and data.
This could be done using SqlServer Management Studio,
Right click on the database
Select Task
Select Generate Script.
Follow the Wizard.
In the last page of the wizard you could find the button Advanced
Clicking on it will give you full control on what to put inside the script.
The script could be distributed with your application with instructions on how to execute on the target machine.

Mysql to SQL Server 2008

Am using Joomla 1.3 for one of my client website. and now I want to move it to custom asp.net application with SQL Server 2008.
What's the best opensource to handle this migration ?
In other context this answer is answered here: Migrate some data from MySQL to MSSQL
Since you already have full SQL 2008, open the Visual Studio Intelligence BI installed with your SQL installation. Then create a new project "Integration Services Project".
Therefor you create a new connection to your ODBC (should be wizards available). Then add your tables, there you can modify, convert, tranasform the data.
The complete project you can save and add as sheduled task to your sql server agent.
Here is a tutorial which explains more: http://msdn.microsoft.com/en-us/library/ms169917.aspx

How to package and deploy a c# desktop application with a sql server 2008 database in visual studio 2010?

I'm working on a school project desktop application in c# using Visual Studio 2010 (.NET 4.0) and the application uses a SQL Server 2008 database that's running on a SQL Server instance on the development machine I'm working with.
My question is how do I package up the database with the c# project so that the application works no matter what machine I'm using it on regardless of whether the machine it's installed on has SQL Server installed or not?
Thank you.
use SQL Server Compact Edition (SQL CE)
If it's not a web application and it's making a direct use of the database, how is it going to work without an instance of SQL server running?
I'd make an .msi for the application and I'd write a SQL script for installing the database and populating it with the data.
You can use SQLServer tools for scripting the tables and the data.

advantages of sql management studio?

i just installed sql server 2008 express in order to learn microsoft sql.
why should i install sql management studio express? is it much easier to use this GUI?
If you installed SQL Server 2008 Express and got a GUI, that is the SQL Management Studio Express which was included in the installation.
They have a seperate installation fo the Management Studio Express, which will install just the client GUI without the database server, in case you want to use it to connect to a SQL Server database running on another machine.
The default GUI for SQL Server is Management Studio, so you should already have it. If not, it is a free download here.
It gives you visual access to tables, stored procedure and many of the other features of SQL Server. Not to mention a nice SQL editor with syntax highlighting which also works as a SQL console.