Advertisement
3_2004-2005 Complete Applications #147150

SQL Test

When creating a data-driven web site, you obviously need to use a number of SQL queries to grab datasets from your database. Before you use a particular SQL query in one of your production ASP pages, though, you want to ensure that it returns the correct information. Therefore, a SQL query test web page, one that allows you to try various SQL statements and view their results, will often come in handy. For every web database project I work on, I pop this code somewhere onto the server. This page allows me to test out SQL queries before I put them into my ASP code. Recently I was doing a project on a co-located SQL Server in Atlanta. I used this page to set up all the tables from my home office in Florida. The idea is simple. You put SQL code into the form, select the data source from the drop down list and click submit. If the recordset contains columns, a table is built to display all rows and all columns. If the SQL is an data manipulation statement, a message appears stating that the command completed successfully. One of the best features is the clipboard. You can cut and paste SQL into the clipboard and it will be there each time you submit the form. I use a simple array to store the data source connection string. I have also had situations where I used a dictionary object to store the connection strings. Sometimes I use another textarea control instead of the drop down list. This allows me to try out different connection strings.

AI

AIサマリー: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ソースコード
original-source
Upload
オリジナルのコメント (3)
Wayback Machineから復元