SKW Data Life Hacks: How to Default to VARCHAR Instead of evil NVARCHAR Data Type
As a surveying, engineering and construction firm, it is important for SKW to stay in tune with our clients’ on-demand needs for managing their data. For example, a client may request adding new feature classes or tables to their databases in a hurry.
By following these configuration steps, you can exceed your client’s expectations by quickly and easily delivering those feature classes and tables while defaulting to less restricted data objects.
When you are working in GIS programs, such as ESRI, and you create tables and feature classes, the backend database usually defaults to NVARCHAR data type. However, NVARCHAR restricts your size and alphanumeric characters, while VARCHAR gives you and your clients more flexibility when inputting textual data. With these steps, you will be able to deliver on-demand, user-friendly data objects, avoiding the evil NVARCHAR data type.
Open “Export Geodatabase Configuration Keywords” ArcTool > Type in the Connection to your desired Geodatabase > Type in Path and File name for your outputted text file.
Then, open the outputted text file in your word processing software of choice. Scroll down to the UNICODE_STRING parameter and type in FALSE inside double quotes. Save the file.
Open “Import Geodatabase Configuration Keywords” ArcTool > Type in the Connection to your desired Geodatabase > Type in Path & File name for your edited text file in the Input File text box.
Then, create a new table or Feature Class inside ArcCatalog via your desired Database Connection. Be sure to refresh ArcCatalog and refresh your MS SQL Server Management Studio and your connection inside Management Studio. Then, confirm that the Text datatypes in ArcGIS are in fact VARCHAR datatypes inside MS SQL Server.
Then, viola! You have a VARCHAR data type much more welcoming to a variety of textual data for your GIS needs. Why is VARCHAR better: uses less storage space; better performing queries; and allows end-users to input & store twice as many alpha-numeric characters!
GIS Technical Architect at APTIM
8 年NVARCHAR is not EVIL The primary difference is Unicode support for other languages, which is why ESRI has it on by default. They are also both variable in length so adjust to the size of the column data. Varchar length is twice that of nvarchar (8k vs. 4k), but the max setting both hold up to 2GB. The decision really comes down to whether or not you need Unicode support. And Unicode is a superset of ASCII so you can consider it more flexible.
GISP, ICP, Educator, Explorer, Agent of Change
8 年Good stuff, but both should be avoided in most cases. It makes things messy.