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 |
noamg
Posting Yak Master
215 Posts |
Posted - 2013-06-10 : 15:17:19
|
A store procedure get an input string, like: ‘( TA or ( TB OR TC ) and ( TB AND TD ) )'each number represents a table with list of UserIDs.How to parse correctly string like this ?Noam Graizer |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-06-10 : 17:37:30
|
quote: Originally posted by noamg A store procedure get an input string, like: ‘( TA or ( TB OR TC ) and ( TB AND TD ) )'each number represents a table with list of UserIDs.How to parse correctly string like this ?Noam Graizer
What do you want to get as the output if it is successfully parsed?My initial reaction without knowing very much about it is that you will need to use some type of dynamic queries. However, if TA, TB etc. represent names of tables, that may not be possible. In any case, using dynamic SQL by inserting strings passed in from a client is very unsafe and subject to SQL injection. So if at all you end up going that route, watchout for that, use parameterized queries etc. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-11 : 01:37:07
|
I'm getting confused reading the title and then explanationTitle says parsing math stringand explanation sayseach number represents a table with list of UserIDscan you clearly state the requirements with an example? is the attempt to merge data between tables which can be determined only at runtime?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
|
|
|