Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blanks added to Char strings

Status
Not open for further replies.

jjwild

Programmer
Joined
Sep 7, 2001
Messages
115
Location
US
Is there an option we can set in SQL Server so blank characters are not appended to character strings to fill the field?

Example: If we save a part number "1234" into a field that can hold 8 characters, SQL saves it with 4 spaces at the end, ie "1234 ". When we read it back we have to trim those spaces off before we can compare it to our original part number "1234" and get a match.

Is there an option in SQL Server where it will not add the four spaces?

Thanks,

Aaron
 

Check the ANSI_PADDING option. Read the topics "SET ANSI_PADDING" and "Setting Database Options" in SQL BOL. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top