Link to home
Start Free TrialLog in
Avatar of VBBRett
VBBRett

asked on

Having 2 parameters equate to one parameter

I would like to take two parameters in SQL with SQL Server and concatenate them to be passed to one varchar parameter.  How would I take the two parameters, which must take user input and then pass it all to a larger stringed parameter which essentially gets used into the query?  Thanks!
Avatar of James Murrell
James Murrell
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of VBBRett
VBBRett

ASKER

OK, I am looking for something much simpler then that.  Let's say I have the following:

@cn as varhcar(6)
@mn as varchar(5)

cmn as varchar(12) = @cn + '-' + @mn

How would I declare cmn so that it is not a required parameter for a user to fill in but it is still used in my query?
SOLUTION
Avatar of Partha Mandayam
Partha Mandayam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial