Carl, sometimes there's just no application to be had... SQL is it.
Mark, the reason you are getting the error is that you must either have SA permissions or your DBA is going to have to setup a special proxy account for you. The hard part will be both convincing the DBA that you gotta have it to do your job and then them figuring out how to do it.
Now, you could cheat a little bit... when you meet an immovable object, go around it... run your SQL through a batch file that uses OSQL... it'll take a lot more finagling with outputing results sets to files and the like, not to mention some pretty good ol' fashioned DOS knowledge, but it can be done.
I just went through the very same thing with my DBA's... the big concern with xp_CmdShell is that it's very powerful and you can do a lot of damage to the server either maliciously or by accident. It also makes for one hell of a security hole unless you have DBA's that know how to handle the tool. Fortunately, I have good DBA's that said, "you develop it on your desktop server and how to move it to production. We'll figure out how to run it for you." What a bunch of great folks... they setup a special proxy where I can call a special SQL job to run my code by proxy. Because of other security measures they took, if I change the store proc, I can't apply grants to the proc so that even I can't run it if it's been changed. The DBA's have to approve all changes and they're the only ones that can apply the correct grants. And, no one but the special account I log into can run the proc. It's amazing how they've given me the flexibility to run it anytime I need to and have locked it down so well. Like I said, great DBA's.
And to heck with rocks, use a hammer 'cause to a hammer, everything is a nail
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair
How to post code problemsHow to post performance problemsForum FAQs