Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Case and Padding FK Relationship Tester

By Cameron Wells,

DESCRIPTION :

When doing db joins using C#, case and padding matter whereas in SQL
server it doesn't. Therefore as part of the transition to LinQ we need to clean up this mismatch, as FK's that don't match their related PK's will cause inconsistent comparisons (joins which should match that don't anymore when using C#). This script is indentifying the top 20 mismacthes (to help readability) that are not deemed as a mismatch in SQL server. Be wary of the NOT NULL CHAR columns because even though ANSI Padding might be set to OFF for thse column's properties, they will be padded to their column width.

 

HOW TO USE :

Copy content of the script into a query editor, choose a db and then hit execute.

 

RESULTS:

- The underscore in the results demonstrates that there is a blank space in that result.

- Other results displayed are due to case differences i.e. 'A' does not equal 'a'

- (NP) represents that that column has ANSI Padding set to OFF

- (P) represents that that column has ANSI Padding set to ON


Total article views: 428 | Views in the last 30 days: 1
 
Related Articles
FORUM

Saving query results in Excel with column names

Saving query results in Excel with column names

FORUM

Convert the result set from row wise to column wise

Convert the result set from column wise to row wise

FORUM

Procedure Result as column data ..Need urgent help

Procedure Result as column data ..Need urgent help

FORUM

Need help on Getting Result from row to column

Need help on Getting Result from row to column

FORUM

Update Datetime Column to Empty String - No Error - Strange Results

Update Datetime Column to Empty String - No Error - Strange Results

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones