我正在尝试从命令行编写数据库脚本,作为powershell脚本的一部分。如果我运行gui它工作..如果我从命令行运行相同类型的操作它失败:
“C:\ Program Files(x86)\ Microsoft SQL Server \ 90 \ Tools \ Publishing \ 1.4 \ SqlPubWiz”script -d DBNAME DBNAME.sql -schemaonly -targetserver 2008
由于某些原因我得到以下输出,我不知道如何修复!
Generating script for database DBNAME
- Generating only metadata script
- Generating script targeted for SQL Server 2008
Gathering list of objects to script
Scripting objects
................................................Error: Operation is not valid due to the current state of the object.
Microsoft (R) SQL Server Database Publishing Wizard
Version 10.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
答案 0 :(得分:6)
也许这就是我所拥有的:看起来DBNAME区分大小写。
发现于: http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/ecfd4379-ee88-4a60-81a4-d6cc9542b1ff
希望这有助于某人