{"title":"SqlDataType Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-sqldatatype-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-sqldatatype-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-sqldatatype-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets the data type that you want to allow in a code field.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":119,"chars":27},{"level":2,"title":"Property value","slug":"property-value","at":146,"chars":310},{"level":2,"title":"Syntax","slug":"syntax","at":456,"chars":43},{"level":2,"title":"Remarks","slug":"remarks","at":499,"chars":475},{"level":2,"title":"Varchar","slug":"varchar","at":974,"chars":145},{"level":2,"title":"Integer","slug":"integer","at":1119,"chars":561},{"level":2,"title":"Variant","slug":"variant","at":1680,"chars":844},{"level":2,"title":"Related information","slug":"related-information","at":2524,"chars":172}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets the data type that you want to allow in a code field.\n## Applies to\n Table field\n## Property value\nValue|Available or changed with|Description\nVarchar|runtime version 1.0|The data type is Varchar. This is the default value.\nInteger|runtime version 1.0|The data type is Integer.\nVariant|runtime version 1.0|The data type is Variant\nBigInteger|runtime version 1.0|The data type is BigInteger.\n## Syntax\n```al\nSQLDataType = Varchar;\n```\n## Remarks\nThe values available are Varchar, Integer, BigInteger, and Variant. Leaving the value set at \\<Undefined>means that you accept the default setting, which is Varchar.\n> NOTE\n> The Variant option is represented by the SQL_VARIANT SQL data type that has been introduced in SQL Server 2000 and is not supported by SQL Server 7.0. This means that selecting Variant as the SQL Data Type property when creating or modifying a table on SQL Server 7.0 results in an error.\n## Varchar\nIf you set SQL Data Type to Varchar, all the values in the field are compared and sorted as character data, including numeric values.\n## Integer\nIf you set SQL Data Type to Integer, then the following are true:\n All the values in the field are compared and sorted as integers. No alphanumeric values can be stored in the field.\n If you enter negative values in the column outside Dynamics 365 Business Central using external tools, they cannot be read into Dynamics 365 Business Central.\n The value \"0\" \\(zero\\) is used to represent an empty string in Dynamics 365 Business Central.\n Non-numeric code values or any numeric values beginning with \"0\" \\(zero\\) cannot be entered in the code field.\n## Variant\nIf you set SQL Data Type to Variant, then the following are true:\n The values in the field are compared and sorted according to their base data type. Numeric values are sorted after alphanumeric values.\n Data that is entered into the code field in Dynamics 365 Business Central is stored as either the Varchar or Integer base data type, depending on the value that has been entered.\n Any value beginning with \"0\" \\(zero\\) can be entered in the code field and is stored as an Integer base data type.\n> NOTE\n> You can change the SQL Data Type of a code field from Varchar or Integer to Variant and the data in the column is changed accordingly. You cannot change the SQL Data Type of a code field from Variant to Varchar or Integer, unless there are no rows in the table or unless the field contains only an empty string in every row.\n## Related information\ndevenv-properties\nInteger Data Type<../methods-auto/library>\nBigInteger Data Type<../methods-auto/library>\nVariant Data Type<../methods-auto/library>"}