Tag | SQL Server 2000 Posts

Ever need to parse SQL Syntax using .NET without actually executing the SQL? Pretty sweet because you can actually do this with built in sql server options. Works out pretty well. Executing a statement with a syntax error, referencing an object that doesn’t exist, a stored procedure with parameters that has no parameters, etc produces a SqlException with an appropriate error message. 1: static void ParseQuery(string sql) 2: { 3: SqlConnection connection = new SqlConnection("some_connect... ...
Recently I was tasked with the responsibility of purging database from one of our SQL 2000 databases. One of the test cases is to use a copy of a database that is a small production database and delete all of the data contained within. After the delete is executed then I can review the data tables and see what is left over or was skipped after the delete script runs. Looking at the properties of hundreds of tables in Enterprise Manager seemed pretty tedious. After a quick query to Bing I was able ...
This week I had a need for NUnit based unit testing against a class that depended on a provided SqlConnection. Up to this point I had been able to mock external objects and their behavior based on interfaces, but with a SqlConnection I could not mock. There are some options for mocking the SqlConnection such as TypeMock, but I needed a realistic connection to test against. This also proved as a good method for building the expected DB interface. The solution that worked best for my environment (only ...
This tip might not fix everyone's issue, but for the problem I was facing today this worked out just fine. We have a scheduled weekly DTS package that is failing for the reason specified in this title: "Protocol error in TDS stream". For weeks we've just been running the thing manually, but that's not a solution, just a delay of the problem. I decided to investigate. I found an article on the SQLTeam.com forums that helped get this working finally. For us, all that was necessary was to switch the ...