Showing posts with label export. Show all posts
Showing posts with label export. Show all posts

Friday, March 23, 2012

How many ways are provided by Microsoft to import data into SQL Mobile database?

SQL Mobile database seems to not provide import/export utilities.

I think using Publication/Subscription is one of the solution, is it right?

Also, besides typing insert statement manually, there are any other ways to transform data to the SQL Mobile database?

There are no formal Import or Export programs/utilities for SQLCe at this point and there is no bulk copy class in the SqlCe namespace. Yes, you can setup a SQLCe database as a subscriber in a Merge replication configuration against a SQL Server Workgroup or better server. You can also write your own INSERT scripts (as I illustrate in an an example in my EBook). Exporting data is simply a matter of writing a class that exposes a DataReader against the database--SqlClient can read that data stream and import it into SQL Server using SqlBulkCopy. This is discussed in my new EBook. See www.hitchhikerguides.net.|||Or simply read it into a dataset and the write it with the XMLWriter.

Here is some sample code for doing the INSERT that was written in a previous post (near end)

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=926140&SiteID=1

Sunday, February 19, 2012

How get column headers in QA CSV export

Using Query Analyzer and SS 2000, if I export a query result set of a
SELECT to a CSV file is there any way to get the column names included as
the first line of the file?
Bill Todd
Bill Todd wrote:
> Using Query Analyzer and SS 2000, if I export a query result set of a
> SELECT to a CSV file is there any way to get the column names
> included as the first line of the file?
You can use the DTS import/export wizard for that.
David Gugick
Imceda Software
www.imceda.com
|||The only thing I have been able to get the DTS wizard to do is display the
error message "the value for a required parameter is missing" which is
really helpful. Is there any documentation for the beginner for DTS?
Bill Todd
David Gugick wrote:

> Bill Todd wrote:
> You can use the DTS import/export wizard for that.
|||Bill Todd wrote:[vbcol=seagreen]
> The only thing I have been able to get the DTS wizard to do is
> display the error message "the value for a required parameter is
> missing" which is really helpful. Is there any documentation for the
> beginner for DTS?
I'm not sure what problem you are having. The wizard is pretty simple to
use:
1- Select a server and a database
2- Select Text File as the destination and enter a text file name for
the output (CSV entension)
3 - Click Use a query to specify data to transfer
4 - Enter query, such as: Select * from sysobjects (or use query
builder)
5 - Click Delimited, Column Delimiter = TAB, and First Row Has Column
Names
6- Click Run Immediately (and possibly save DTS package for future use)
The file should be created in CSV format. Let us know if you have any
problems.
David Gugick
Imceda Software
www.imceda.com