Over a year ago i started at Ford working with Oracle. At the end of the year due to cuts i was let go, but was brought back on in January to a new project. I finally do some of the design so it can be done correctly! It's a rare treat to get in at the beginning and design from scratch. We spoke to the Data Architect (DA) and it looks like he'll be OK with me doing his job. I even got the distinct feeling that he had a clue.
Unfortunately, i have to work with Microsoft SQL Server. I don't like it much. They expect you to use the graphical interface. The provided tool (i just downloaded 2005 Express, expecting to use 2005 here) for command line is SQLCMD. It runs scripts, but once interactive mode is started, it does not. In Oracle's SQL*Plus, i had tens of scripts that made my life easier. It was always @this or @that. Need to check indexes on a TABLE, no problem, @ind tablename. Need to check used space, @space. From simple to complex, @ scripts are one of the things that make SQL*Plus an excellent tool. Yet, nothing like that for SQL Server. It is expected for the user to use the graphical interface in Management Studio. Query Analyzer was integrated into it.
But wait, there's more. SQLCMD does not use ; as a statement terminator. Offically, SQLCMD is a T-SQL executor, so the T-SQL command GO must be used. And, it has to be on its own line. That means that every script is at least two lines. And that is if you want to COMMIT it. Don't want to commit? Well, then start with BEGIN TRANS to let SQL Server know you care about this obscure thing call transactions. And i thought mysql was bad. Sheesh.
To be fair SQLCMD does allow the word GO to be replaced with another token, such as a semi-colon. But it still must be on its own line. I tried / (to match Oracle's version of GO) but the command caused the shortcut to close the window right away. It's a solidus, not a backslash, why doesn't it work?
Microsoft wants all commands besides GO to start with a colon. The run-command token is !!. So, to run dir, the command is
The graphical tool is not too bad. F5 will runs lines or scripts. It just doesn't compare to the ease of use of a DOS window, especially a few DOS windows each for a different environment. On my last project i had a minimum of four windows: local, Dev, QA, and Prod. Then again, in Dev and QA we had two usernames. One with rights for development and one with the application rights. So, when testing a stored PROCEDURE, CREATE with the higher rights, but test with the lower. All in all, a few windows were open. Matching text, and alt-tab and numbered shortcut switching made this very easy to use. Management studio is probably going to be a lot harder. Remembering which tab is which (unless i can get the instance name in a prompt), and switching between them will be very different.
Oh well, i'll just have to get used to it. Now i need to find the best sites to follow. For Oracle i followed Tom Kyte, Richard Foote, and others (and probably will continue to do so), but i need to find the Microsoft equivalents. As long as they support RSS it ought to be easy to follow.
I feel better now.