TRUNCATE TABLE master..sysdatabases

...and other neat SQL Server tricks
posts - 55, comments - 60, trackbacks - 14

September 2003 Blog Posts

Is XML Evil?

About a month ago I was asked by a contractor I work with who needed to import some very plain, fixed-width, ASCII text file data into SQL Server. In fact, this SQL Team post is very much like his situation, in that he also was going to convert PLAIN, FIXED-WIDTH, ASCII TEXT (did I mention that already?) into XML and THEN import it into SQL Server. I was absolutely floored that someone would even CONSIDER doing it this way. The only analogy I can think of is taking a haiku that perfectly expresses an idea, and then spend months or...

posted @ Sunday, September 28, 2003 2:10 PM | Filed Under [ Stupidness ]

DOS Rulez All ya SQL Newbies!

As Damian pointed out, you can do a lot of cool things with DOS command-line functions.  Lately I'm particularly enamored of the for command. The DOS for command works like a loop in Basic, C/C++/C#, Java(Script) etc., only you can have it traverse a filespec (like dir *.txt would), a directory tree, or even the contents of a file.  To modify Damian's example a little, you could actually execute each individual SQL script with the following: for %a in (*.sql) do osql -E -Sserver <%a The %a is a DOS replaceable parameter, and it holds the complete file name of each file in the *.sql...

posted @ Sunday, September 28, 2003 9:17 AM | Feedback (3) | Filed Under [ Coolness Command Line ]

Bill Graziano For Governor of California!

Figured no one would remember this blog next year during the presidential election... :) So now our rampant SQL Team egos can rant unchecked by the need to remember we too were once SQL n00bs who didn't know anything!  MWUH HAHAHAHAHAHAHAHA!!!! I sense graz dreading the moment he gave me a blog here, and sympathize deeply. My current blog title (TRUNCATE TABLE master..sysdatabases) may change in the future, unless overwhelmingly positive feedback or threats ask that it remain, so if you like it, let me know! Thanks graz!  Once again you've put another great thing on an otherwise dull Internet!

posted @ Thursday, September 25, 2003 11:31 PM | Filed Under [ Coolness ]

Powered by:
Powered By Subtext Powered By ASP.NET