database 需要在不使用管理工作室的情况下创建新数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3210138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Need to create new database without using management studio
提问by remo
How to create new database with SQL Server Express 2008 without using Management Studio?
如何在不使用 Management Studio 的情况下使用 SQL Server Express 2008 创建新数据库?
Do i need to download sp1?
我需要下载sp1吗?
回答by Chris Diver
You can use the SqlCmdutility 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.
打开命令提示符,然后键入 SqlCmd.exe 并按回车键,您应该会得到1)
这意味着您已连接。
Once connected execute
一旦连接执行
1) CREATE DATABASE dbname
2) GO
回答by gbn
Use CREATE DATABASEvia sqlcmdor another other database connection (even VBA from Excel...)
通过sqlcmd或其他其他数据库连接(甚至来自 Excel 的 VBA...)使用CREATE DATABASE
回答by SteveCav
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).
您可以使用连接字符串在代码(.net express 或其他东西)中连接到它,然后运行一个 sql 脚本来创建一个数据库(请参阅http://msdn.microsoft.com/en-us/library/ms176061.aspx)。
But why can't you use the management studio?
但是为什么不能使用管理工作室呢?