wildcards for select query in sql server and dreamweaver in asp..
Posted on 2006-11-20
i am using ms sql 2005 and dreamweaver with asp and I am trying to query a table for a member number and also a scheme type.. There are about 30 scheme types that can have access to the site and the rest are blocked access.. I am trying something like the code below, with no Joy!! The MMColParam is a session variable with their user id stored in it and then I want to list the acceptable codes and if the code is like one in the list display the data, if the code is not in the list, give them an error.. I would really like to use a wildcard instead of a massive statement with loads of ands in it.. The format is fairly simple e.g. dir1f, dir2f, dir3f etc.. some of the others are corp1f, corp2f etc...
They first log in and this is the page they get sent to, so the userid is always going to be in the session....
WHERE user_id = MMColParam AND [current_scheme] LIKE 'DIR_' OR [current_scheme] LIKE 'CORP_'
Any ideas or pointers would be great....