How do I populate a SQL Server Compact database?

ぃ、小莉子 提交于 2019-12-24 12:15:39

问题


So I'm building a windows app, and as a result, I'm going to use SQL Server Compact instead of the normal SQL Server as I figure it can then be run on any computer, not just one with SQL Server installed.

The problem is from what I've seen, you can't seem to do any scripting in SQL Compact, you can't declare variables, you can only do one statement at one time.

I generally have like a reference data script stored that I run everytime I rebuild the database. Is this possible in Compact?

The only thing I can think of is to build a seperate application that reads the script and manually runs each individual query, but that just seems cumbersome. However, is that the only way?


回答1:


You can use my SQL Server Compact scripting Tools for this: http://sqlcetoolbox.codeplex.com (VS add-in) and http://exportsqlce.codeplex.com (command line)



来源:https://stackoverflow.com/questions/5528416/how-do-i-populate-a-sql-server-compact-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!