Need to create new database without using management studio

混江龙づ霸主 提交于 2019-12-08 15:46:42

问题


How to create new database with SQL Server Express 2008 without using Management Studio?

Do i need to download sp1?


回答1:


You can use the SqlCmd utility from the command line to execute SQL.

Open a command prompt and then type SqlCmd.exe and press enter, you should then get 1) which means you are connected.

Once connected execute

1) CREATE DATABASE dbname
2) GO



回答2:


Use CREATE DATABASE via sqlcmd or another other database connection (even VBA from Excel...)




回答3:


You could connect to it in code (.net express or something) with a connectionstring, then run an sql script to create a db (see http://msdn.microsoft.com/en-us/library/ms176061.aspx).

But why can't you use the management studio?



来源:https://stackoverflow.com/questions/3210138/need-to-create-new-database-without-using-management-studio

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