My application contains a textbox that allows the user to specify a valid SQL expression that will be used to create the 'computed' portion of a computed column.
This project will create the parsing mechanism to ensure the textbox contains a valid expression. The parser should support all available expressions available to SQL Server 2000 including:
- Arithmetic operators
- String operators
- Existiing Columns
- built-in SQL functions
- Type conversion using 'cast'
The list of existing column names and types will be available to you in a Listbox that the user can use to add existing fields to the textbox. The order may also simply type the column name into an expression.
The purpose of this algorithm is to prevent a malformed expression from being executed by the SQL server engine and producing an error.
This validation code must be written in asp and validate the user's input against SQL Server. The routine is basically a function that accepts an expression as a parameter and returns true or false indicating whether the expression is valid or not. If the expression is not valid, a variable containing the error description returned by SQL Server should be set.
The expression can be any valid SQL expression used as a computed column. The expression may or may not contain existing columns.
The following are some sample expressions:
[UnitPrice] * 10
invalid because of mismatched parentheses
[Unit Price] * 10
invalid because the column name does not exist
valid even though it does not reference any columns.
I need this validation routine ASAP so please only respond if yo have the time. I can show you the web page that will be used for validation as well.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).