SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Script to determine if all chars are same in field

By gamma, 2003/05/29

Total article views: 32 | Views in the last 30 days: 1

This script is a fix to the "Script to determine if all chars are same in field"
posted by Harvard Kinkead (hneal_98) .
That script doesn't handle strings with trailing spaces (e.g. set @repeat = 'bbbb ')
It happens because of the nature of Len function.
To bypass this limitation my script concatenates one character to tested string and then takes it into account in length evaluation.
If the length is 1 then true, else false.

By gamma, 2003/05/29

Total article views: 32 | Views in the last 30 days: 1
Your response
 
 
Related tags

Miscellaneous    
 
Like this? Try these...

Find Parent Child RelationShip

By Jorge Novo | Category: Miscellaneous
(not yet rated) | 270 reads

The Ultimate Index Usage Reporter

(not yet rated) | 494 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com