July 24, 2012 at 1:57 pm
In my application, user will select different columns to create a select statement.
For example, user A will create a statement like below:
Select orderID, orderDate, Amount, City from tableOrder
user B will create a statement like below:
Select orderID, orderDate from tableOrder
My app need to remove [City] no matter user how to select another columns.(about 20 columns in list)
How to check original user's SQL statement and make new SQL statement without [City] column?
July 24, 2012 at 2:05 pm
it depends on how the user selects the columns they want. i would do any actual dynamic query creation with a stored procedure API level and validate any input given to the stored procedure.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
July 24, 2012 at 4:54 pm
adonetok (7/24/2012)
In my application, user will select different columns to create a select statement.For example, user A will create a statement like below:
Select orderID, orderDate, Amount, City from tableOrder
user B will create a statement like below:
Select orderID, orderDate from tableOrder
My app need to remove [City] no matter user how to select another columns.(about 20 columns in list)
How to check original user's SQL statement and make new SQL statement without [City] column?
The easy way to do this is to not allow the users to query the table directly. Build a that doesn't include the city column and give them SELECT access to that instead.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 24, 2012 at 6:01 pm
capn.hector (7/24/2012)
it depends on how the user selects the columns they want. i would do any actual dynamic query creation with a stored procedure API level and validate any input given to the stored procedure.
If you create a view and remove city from it and give them the select access to the view. Wouldn't that work?
Regards,
TA
Regards,
SQLisAwe5oMe.
July 24, 2012 at 7:09 pm
SQLCrazyCertified (7/24/2012)
capn.hector (7/24/2012)
it depends on how the user selects the columns they want. i would do any actual dynamic query creation with a stored procedure API level and validate any input given to the stored procedure.If you create a view and remove city from it and give them the select access to the view. Wouldn't that work?
Regards,
TA
That would be the way depending on what the owants to accomplish.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply