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
 General SQL Server Forums
 New to SQL Server Programming
 Need Help on a varchar

Author  Topic 

Arctic
Starting Member

2 Posts

Posted - 2012-01-24 : 16:28:52
I'm really new to this whole SQL thing so be gentle.

In a table I have a varchar(17) I understand that it will not allow anything over 17 characters.
My application will sometimes give me 16 characters is there something else that I could be using ? I have a combination of numbers and letters in this as it is a vin number of a part.

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-24 : 16:31:42
Are you having a problem?

I find it hard to believe a vin is only 17 chars



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-24 : 19:21:04
quote:
Originally posted by Arctic

I'm really new to this whole SQL thing so be gentle.

In a table I have a varchar(17) I understand that it will not allow anything over 17 characters.
My application will sometimes give me 16 characters is there something else that I could be using ? I have a combination of numbers and letters in this as it is a vin number of a part.


varchar means variable character. so if your application gives only 16 char data it will only allocate space for 16 chars and store the data. varchar(17) means it can have maximum 17 characters and actual space used depends on number of characters present in data.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Arctic
Starting Member

2 Posts

Posted - 2012-01-25 : 10:50:56
Brett,
I sometimes only get 16 characters. And Yes the Vin is only 17
Thought it would be easier to have database reject the # then program the scanner.

Thanks for any help you maybe able to give me


quote:
Originally posted by X002548

Are you having a problem?

I find it hard to believe a vin is only 17 chars



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/




Go to Top of Page
   

- Advertisement -