Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to create a new table include some sharepath (e.g. \\network\sharespace\test1), To avoid query results follow some blank spaces after the path(e.g. I cann't accept \\network\sharespace\test1__________like this),I need to set its datatype to match the path length. How could I do? could anybody help to to set this?

share|improve this question
    
You might get better answers if people know what SQL server you're using. –  womble Jul 10 '11 at 5:32

2 Answers 2

up vote 2 down vote accepted

Does your language lack a chomp function?

You can use the VARCHAR type to produce a string field of a given length; however, unless your sharepaths are all going to be the same length, you'll still end up with the same problem, so it's time to return to chomp.

share|improve this answer
    
Thank you very much –  pansal Jul 10 '11 at 7:27

SQL 101 for beginners: use a variable length data type (varchar). Then go on and read the documentation about all data types your particular sql server language dialect supports.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.