Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Import/Export files (.txt/.csv/.xls) into SQL 2005 Compact Edition Expand / Collapse
Author
Message
Posted Saturday, April 23, 2011 8:20 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, April 14, 2014 8:14 AM
Points: 374, Visits: 911
I have an SDF file. I need to import some new data into a new table in that SDF. The data could be a .TXT/.csv/.xls.. What are the ways available to do the import/export into SQL 2005 CE?

Also, how to query an table in SDF from an SQL 2005 Enterprise edition?
Post #1097853
Posted Saturday, April 23, 2011 9:46 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
Pardon my ignorance. What's an "SDF"?

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1097856
Posted Saturday, April 23, 2011 10:03 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, April 14, 2014 8:14 AM
Points: 374, Visits: 911
Jeff,

yes, it was an revelation to me. I didnt knew abt this.

From MSDN:

"A SQL Server Compact Edition database is stored in a file with the .sdf extension"

http://msdn.microsoft.com/en-us/library/ms171986(v=SQL.90).aspx
Post #1097858
Posted Sunday, April 24, 2011 6:30 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 12:01 PM
Points: 12,744, Visits: 31,074
Jeff Moden (4/23/2011)
Pardon my ignorance. What's an "SDF"?


SQL Server Compact Edition databases are supposed to a good idea for mobile phones and other portable devices;There's no service like SQLServer needed to run against them, it's kind of like an access database in that regard.

I think the target audience is actually Laptops that need to sync with a master database on an intermittent basis, because you can make push/pull replication subscriptions to them. You know, the typical, in the field issues where they need access to database stuff, add invoices, and sync later.

At least for smaller devices/ mobile development, The problem is that it requires the compact .NET framework, which in turn requires the Windows mobile operating system.

Since that's not as popular as say, the Android OS, your future markets a little more limited; I ended up using SQLite database instead, as there's more code examples for using that, and can be used with or without the Windows OS on those portables, as well as in full windows Operating systems.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1097885
Posted Sunday, April 24, 2011 6:37 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:49 AM
Points: 6,798, Visits: 6,272
Jeff Moden (4/23/2011)
Pardon my ignorance. What's an "SDF"?

Crikey Jeff, I'm agog with amazement
You being a SQL god an 'all
I guess DBA's don't venture out of the sandbox after all



Far away is close at hand in the images of elsewhere.

Anon.

Post #1097886
Posted Sunday, April 24, 2011 3:44 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
David Burrows (4/24/2011)
Jeff Moden (4/23/2011)
Pardon my ignorance. What's an "SDF"?

Crikey Jeff, I'm agog with amazement
You being a SQL god an 'all
I guess DBA's don't venture out of the sandbox after all


BWAA-HAAA!!!! I don't consider CE to be SQL in any way, shape, or form. In fact, I'm sure the abbreviation of "CE" actually stands for "Crippled Edition" or "Cruddy Example" or "Crap/Excrement". It's nothing more than a data dumping ground for the very things people have mentioned. It can't use stored procedures, functions, views, or even variables. The best it can do is be interfaced with a front end using 100% embedded code. Sure, it'll run some pretty limited SQL scripts. After I found out what it was for, I never looked at it again. Certainly not long enough to be made familiar with the file extensions it uses.

My closest contact with CE was when my boss asked me to convert some rather sophisticated T-SQL to CE. After studying about its limitations, I told my boss that he really needs to hire a good front end developer that can read T-SQL well enough to write objects and procs in the "C" family of code from it because there was simply no way possible to migrate T-SQL to CE.

Does CE do what it was designed to do? Absolutely. And that's precisely why I don't use it nor do I study it. It's apparently MicroSoft's answer to about the closest you can get to a NO SQL product without actually being one.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1097942
Posted Sunday, April 24, 2011 4:12 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
Ok... I got all of my griping out of the way . Does anyone have an answer for balasach82 question about how to import txt/csv/xls data into CE because I sure don't know. I'm thinking the front end code would need to do that.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1097945
Posted Monday, April 25, 2011 1:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:49 AM
Points: 6,798, Visits: 6,272
Nice riposte Jeff
I consider myself remonstrated

My only dabble with SDF was on a scanner with an older version of CE to SQL2K via Web Service. I believe the newer versions allow better access to SQL Server but I could be wrong. I will check with one of my colleagues who has worked on this sort of thing when I get back to the shop tomorrow.



Far away is close at hand in the images of elsewhere.

Anon.

Post #1097986
Posted Monday, April 25, 2011 8:09 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
Gah!... I didn't mean to turn it into a rant. Sorry. The only real advantage that CE has compared to custom code might be it's ability to sort and join so you don't have to write that stuff into a custom file handler.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1098124
Posted Thursday, April 28, 2011 8:35 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, February 11, 2013 8:49 AM
Points: 51, Visits: 117
You can connect to a CE database using the Server Management Studio (choose CE from the Server Type dropdown) and then you will have to browse to the directory containing the sdf file. I believe you can import/export data from there.

A program could also be written to do imports and exports.

John
Post #1100282
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse