I'm using MS Query Analyzer (as part of SQL Server 2000) to write T-SQL scripts to pull data out of a DB. This involves querying some tables, iterating through the results (using a cursor), some basic processing of the results and putting the processed data into another table. This is working pretty well as I can view the tables and stored procedures and edit/run the scripts against them all in Query Analyzer.
The main issue I have is the script editing kinda sux. It's pretty much notepad with syntax highlighting. There's very little understanding of the databases I'm scripting against. And none of the other programming aids that most IDEs provide, eg. code completion on keywords and database table and column names would be very handy.
My question is: are there any tools that provide a better T-SQL scripting environment, while maintaining the same (or better) level of integration with SQL Server? Free/open source tools would be preferred, but commerical ones would also be considered.