Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 t-sql 2008 pass parameters
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

332 Posts

Posted - 01/06/2013 :  17:47:19  Show Profile  Reply with Quote
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?

Flowing Fount of Yak Knowledge

United Kingdom
3385 Posts

Posted - 01/07/2013 :  05:46:00  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000