Quantcast
Channel: Best database field type for a URL - Stack Overflow
Browsing latest articles
Browse All 12 View Live
↧

Image may be NSFW.
Clik here to view.

Answer by Alter for Best database field type for a URL

Here are some SQL data types according to AWS.

View Article


Answer by Flavio Tordini for Best database field type for a URL

You should use a VARCHAR with an ASCII character encoding. URLs are percent encoded and international domain names use punycode so ASCII is enough to store them. This will use much less space than...

View Article

Answer by brokethebuildagain for Best database field type for a URL

This really depends on your use case (see below), but storing as TEXT has performance issues, and a huge VARCHAR sounds like overkill for most cases.My approach: use a generous, but not unreasonably...

View Article

Answer by mrgrieves for Best database field type for a URL

You'll want to choose between a TEXT or VARCHAR column based on how often the URL will be used and whether you actually need the length to be unbound.Use VARCHAR with maxlength >= 2,083 as...

View Article

Answer by sohaiby for Best database field type for a URL

You better use varchar(max) which (in terms of size) means varchar (65535).This will even store your bigger web addresses and will save your space as well.The max specifier expands the storage...

View Article


Answer by micahwittman for Best database field type for a URL

Lowest common denominator max URL length among popular web browsers: 2,083 (Internet Explorer)http://dev.mysql.com/doc/refman/5.0/en/char.htmlValues in VARCHAR columns are variable-length strings. The...

View Article

Answer by CesarB for Best database field type for a URL

Most web servers have a URL length limit (which is why there is an error code for "URI too long"), meaning there is a practical upper size. Find the default length limit for the most popular web...

View Article

Answer by matt b for Best database field type for a URL

I don't know about other browsers, but IE7 has a 2083 character limit for HTTP GET operations. Unless any other browsers have lower limits, I don't see why you'd need any more characters than 2083.

View Article


Answer by carson for Best database field type for a URL

Most browsers will let you put very large amounts of data in a URL and thus lots of things end up creating very large URLs so if you are talking about anything more than the domain part of a URL you...

View Article


Answer by Bob Probst for Best database field type for a URL

varchar(max) for SQLServer2005varchar(65535) for MySQL 5.0.3 and laterThis will allocate storage as need and shouldn't affect performance.

View Article

Answer by Daniel Spiewak for Best database field type for a URL

VARCHAR(512) (or similar) should be sufficient. However, since you don't really know the maximum length of the URLs in question, I might just go direct to TEXT. The danger with this is of course loss...

View Article

Best database field type for a URL

I need to store a url in a MySQL table. What's the best practice for defining a field that will hold a URL with an undetermined length?

View Article
Browsing latest articles
Browse All 12 View Live