Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-03-24 : 08:46:04
|
| Jason writes "I've somewhat recently begun using SQL queries as my method of storing a retrieving data from a true database. I have historically used flat comma-delimited files for information storage, but quickly outgrew them. I have a multi-table database that I would like to create an extremely fancy ASP front-end query system for. Something along the lines of:Table:___ Field:___ Operator:___ Value:___ More:____The table would be a dropdown that contains values populated from the tables within the database. Once the table is select, it then queries that table for all fields within it. Condition would be a static dropdown that contains: = , <> , < , > , <= , >= , like , is empty , is not empty , is null , is not null. The value would be the search criteria. More would be "And" & "or" that would be create an addition line that they could add-on to the queryMy example would be an hardware inventory database. Tech's would be able to create dynamic reports that list workstation that fit the criteria that they are requesting... A query would be something like:Table:General Field:CPU Operator:>= Value:500 More:ANDTable:General Field:RAM Operator:>= Value:128 More:ORTable:General Field:USER Operator:<> Value:%JAKOMA% More:ANDTable:General Field:OS Operator:<> Value:WindowsGenerating a list of computer running at least 500Mhz processor & has at least 128Mb RAM, or Systems running a Windows OS w/ JAKOMA being the last user to login. I know this is a difficult one, but it sounds like you guys love those. ;-) My ideal solution would dynamically add additional lines to create the queries with when the user populates the More: field (indicating they would like to get more specific with the query). I've asked our head DBA & the questions made him go cross-eyed. I kinda feel bad. ;-) Thanks guys!!!" |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-03-24 : 08:55:39
|
| My opinion - get a TSQL book or hire someone with querying experience and use QA. Other than that, there are a number of vendors that sell reporting tools. No need to reinvent the wheel. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-03-24 : 09:27:48
|
| I feel this is a programming issue (DHTML/ASP) to build the interface, not really a SQL issue assuming you understand how to build a SQL statment and execute it against a connection (and that you and your DBA have determined that this is truly the way you wish to go).One a side note, remember that you really shouldn't mix AND's and OR's in criteria without using parenthesis so be careful of that ..... and if you wish to use wildcards you must use LIKE or NOT LIKE as opposed to = or <>.- Jeff |
 |
|
|
|
|
|
|
|