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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 t-sql 2008 pass parameters

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2013-01-06 : 17:47:19
In need to pass 5 parameters to a stored procedure in sql server 2008 standard edityion database. The 5 parameters come from a filename in a Visual Basic.Net 2010/2012 application. Two of the parameters are ok since they are numeric values however 3 of the parameters are character that translates to varchar values.
My problem is the fields that are: 1. major product name, 2. sub product name, and 3. customer name may not be the exact values that are actually contained within the database. There may be differences in the values like upper versus lower case, the number of spaces that are entered between words, words like incorporated may have the abbreviation, and other any special circumstances.

Between the 4 of the 5 parameters that are to be supplied to the stored procdure, I obtain distinct (unique) values for rows in the database.

The only thing I think I can do is to look of names in character fields for the minimum size value contained in those columns. Thus my question is how would you write the queries to obtain the values I can referring to?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2013-01-07 : 05:46:00
You can cater for the case by using a collate clause.

As to the spaces and abbreviations - that is more of a business problem - you might need a mapping table to hold the data you want to be the same.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -