PreacherUK
Technical User
Hi guys,
I'm planning an application that will allow a user to select their choice of fields from a table into a spreadsheet/report.
I'm still very much an access user/programmer but have been using SQL more recently (so my thinking is probably not completly SQL orientated and I'm doing things the wrong way round) therefore any pointers from the SQL gurus would be most appreciated.
What I thought I would do is have a Vb front end that allows users to check a number of tick boxes selecting their chosen fields, this is sent to a table in SQL.
Then an sp/udf is executed that will build a query to return the data requested. Something like this:
Exec DynamicSQL (Select * from UserChoiceTable)
Would this work? Is there a more established way of doing this, building dynamic SQL strings?
I'm planning an application that will allow a user to select their choice of fields from a table into a spreadsheet/report.
I'm still very much an access user/programmer but have been using SQL more recently (so my thinking is probably not completly SQL orientated and I'm doing things the wrong way round) therefore any pointers from the SQL gurus would be most appreciated.
What I thought I would do is have a Vb front end that allows users to check a number of tick boxes selecting their chosen fields, this is sent to a table in SQL.
Then an sp/udf is executed that will build a query to return the data requested. Something like this:
Exec DynamicSQL (Select * from UserChoiceTable)
Would this work? Is there a more established way of doing this, building dynamic SQL strings?