Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
RandyLewisKemp
Starting Member
4 Posts |
Posted - 2007-10-28 : 16:34:37
|
| I posted a question a few days ago, to get some general information what this command does: command.cmdosql -S (local)\SQLEXPRESS -E -i DropDB.sql DropDB.sqlIF EXISTS (SELECT name FROM sys.databases WHERE name = N'Caching')DROP DATABASE [Caching]I have gotten some great answers. Now I like to ask a deeper question. This command was created for SQL Server Express, for an internal software package at my company, by an outside vendor. However, sometimes this command doesn't work 100% on all user computers. So I have two questions.1. Is there any way to either enhance the command, or the database command, to provide error diagnostics, to find out the issue for an individual user computer, why it doesn't always work?2. Can anyone think of any scenarios that would prevent this from working? The key element here is that this caching database is supposed to allow individuals to use a particular piece of software, when they aren't connected to the network at work. But it doesn't always work on each computer - 100% of the time - even when the computer has SQL Server Express installed, and is running Windows XP.Randy |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-10-28 : 21:41:28
|
| 1. What was the problem on user computers? Did you get any error? You can use -o option to keep all output messages.2. No sql instance on the machine, windows account used is not valid sql login in the instance, the account doesn't have permission to drop db. |
 |
|
|
askben
Starting Member
8 Posts |
Posted - 2007-10-29 : 16:31:53
|
| The other reason that it might not work is that there could be a connection to the database and therefore it would not allow it to be dropped. You should capture the messages that come out of osql (-o) as was stated so that you can see what the messages are related to.------------Ben Miller |
 |
|
|
|
|
|
|
|