edmund_mitchell
asked on
Stored proc syntax -- returning a boolean -- to VB 6 code
Hello,
I need to see an example of a stored proc that receives a string (representing a logon_name) as an input parameter, and checks the user table to see if there is already a user with that logon_name, if so, returns a boolean of true.
Then, how can I call that stored proc from VB 6 code and "get" the Boolean?
I have no idea how to do this, so thanks for your help, or suggestions for better ways of doing this.
I need to see an example of a stored proc that receives a string (representing a logon_name) as an input parameter, and checks the user table to see if there is already a user with that logon_name, if so, returns a boolean of true.
Then, how can I call that stored proc from VB 6 code and "get" the Boolean?
I have no idea how to do this, so thanks for your help, or suggestions for better ways of doing this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I hope that worked -- I split the points equally. Thanks to you both!
>> Do you happen to know if that search is case sensitive or insensitive?
That depends on the type of installation. If the installation is case sensitive, the comparison will be; if it is not, the comparison won't be.
Now, if you want to force it to be insensitive, even on a case sensitive installation, convert both to upper (or lower) case, for example:
SELECT 1 FROM [user] WHERE UPPER(logon_name) = UPPER(@logon_name)
If you want to force it to be case sensitive on a case-insensitive installation, you have to cast to varbinary, like so:
SELECT 1 FROM [user] WHERE CAST(logon_name AS VARBINARY(50)) = CAST(@logon_name AS VARBINARY(50))
That depends on the type of installation. If the installation is case sensitive, the comparison will be; if it is not, the comparison won't be.
Now, if you want to force it to be insensitive, even on a case sensitive installation, convert both to upper (or lower) case, for example:
SELECT 1 FROM [user] WHERE UPPER(logon_name) = UPPER(@logon_name)
If you want to force it to be case sensitive on a case-insensitive installation, you have to cast to varbinary, like so:
SELECT 1 FROM [user] WHERE CAST(logon_name AS VARBINARY(50)) = CAST(@logon_name AS VARBINARY(50))
ASKER