SQL CE Reset + Best Tools to Manage SQL CE
-
Monday, November 26, 2012 1:26 PM
Hello, I need some help with regards to the SQL Compact Edition.
1. I need to reset all indexes and empty databases (latter part I've done) - maybe there is something out there but I'm not using the correct key words to search with.
2. What is the best too to manage SQL CE databases? I am currently using SqlCe40Toolbox.exe .... but I'm sure there are better, any suggestions?
Thanks for reading my thread.
All Replies
-
Monday, November 26, 2012 2:05 PMModerator
1: Not sure what you mean by reset indexes, once a lot of data has been deleted, you can use the Maintenance menu in the Toolbox to Compact the database, to reclaim unused disk Space.
2: I have a list of all available tools here: http://erikej.blogspot.dk/2009/04/sql-compact-3rd-party-tools.html (Disclaimer: I am the author of sqlce40toolbox.exe).
Please mark as answer, if this was it. Visit my SQL Server Compact blog
-
Monday, November 26, 2012 5:01 PM
Nice tool you have there, I found it pretty useful. I would like to know how to reset all indexes back to 0 ... since I automatically give an ID through SQL Identity, I would like to empty the database and start afresh, since I was using it for testing. Is this possible using any one of your tools?
Also thanks for your blog link, some wikid info out there!
Cheers.
-
Monday, November 26, 2012 5:58 PMModerator
Use a command like:
ALTER TABLE [OrderDetails] ALTER COLUMN OrderDetailId IDENTITY (1,1)
Please mark as answer, if this was it. Visit my SQL Server Compact blog
- Marked As Answer by jacqmizz Tuesday, November 27, 2012 7:54 AM
-
Monday, November 26, 2012 5:59 PMModerator
Use a command like:
ALTER TABLE [OrderDetails] ALTER COLUMN OrderDetailId IDENTITY (1,1)
Please mark as answer, if this was it. Visit my SQL Server Compact blog
-
Tuesday, November 27, 2012 6:44 AMModerator
Hi jacqmizz,
Regarding your first question, since you want to reset all indexes and empty databases, we can remove the databases from your application and recreate the ones we needed.
To your second question, we can manage SQL Server Compact databases with Visual Studio or SQL Server Management Studio. For more detail information, please refer to the following link:
Server Explorer/Database Explorer:
http://msdn.microsoft.com/en-us/library/x603htbk.aspxManaging SQL Server Compact Edition Databases with SQL Server Management Studio:
http://technet.microsoft.com/en-us/library/ms172933(v=sql.90).aspxAllen Li
TechNet Community Support- Marked As Answer by jacqmizz Tuesday, November 27, 2012 7:53 AM
-
Tuesday, November 27, 2012 8:01 AMThanks for your replies, I found the information very useful, however a small comment to Allen Li - SQL Server Management Studio is not reading my .sdf database 4.0 ... I will give it a couple of other tries though, now knowing that it may be used, maybe wasn't persistent enough last round! Thanks
-
Tuesday, November 27, 2012 8:19 AMModerator
No version of SSMS supports SQL Server Compact 4.0Please mark as answer, if this was it. Visit my SQL Server Compact blog
- Marked As Answer by jacqmizz Tuesday, November 27, 2012 9:21 AM
-
Tuesday, November 27, 2012 9:21 AM
Ahhh that's why Erik ..... then I will continue using SqlCe40Toolbox.exe ......
If I were to suggest and improvements, I would definitely add the reset database indexes and data .... it would be nice to have.
PS: Nice blog too +my vote
-
Tuesday, November 27, 2012 10:07 AMModeratorReset data - is that: DELETE FROM [table] ? In that case it is already there (per table) ??
Please mark as answer, if this was it. Visit my SQL Server Compact blog


