From 57f548d5526d4b929b376bcde14587acb46f3b6e Mon Sep 17 00:00:00 2001 From: pmasl Date: Wed, 4 Dec 2019 15:18:56 -0800 Subject: [PATCH] Update CheckStorageReq_CurrDB.ipynb --- .../features/unicode/notebooks/CheckStorageReq_CurrDB.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/features/unicode/notebooks/CheckStorageReq_CurrDB.ipynb b/samples/features/unicode/notebooks/CheckStorageReq_CurrDB.ipynb index df87b391..d9037afe 100644 --- a/samples/features/unicode/notebooks/CheckStorageReq_CurrDB.ipynb +++ b/samples/features/unicode/notebooks/CheckStorageReq_CurrDB.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "markdown", - "source": "The script below will determine the UTF8 storage requirements for all tables and string columns in the database in scope, and whether the defined data type length has to be changed when converting to UTF-8. The result will show the table and column names that map to CHAR, NCHAR, VARCHAR, and NVARCHAR data types (including UDTs), their current type size definition, actual byte size, and projected byte size once encoded into UTF-8. \r\n\r\nFor example, for the column **EmailAddress** of table **Application.People**, the data type definition is **nvarchar(512)** and the data length for the largest string found in that column is 66 bytes. If changed to **varchar(512)** under a ***_UTF8*** collation, the data length would be reduced to 33 bytes. In this case, converting the column's collation and data type (without changing the size definition) will not cause data loss. \r\n\r\nHowever, if the projected byte size for the column using UTF-8 would be larger than the current data type definition, then the defined data type length would also have to be enlarged. For example, if a column were defined originally as **nvarchar(100)**1, and projected byte size for the column in UTF-8 would be 120, then a changing the column type to a **varchar(100)**2 would result in data loss. The column would have to be defined at least as **varchar(120)**.\r\n\r\n1 Expresses byte-pairs, meaning the column is capable of storing up to 200 bytes of information \r\n2 Expresses bytes, meaning the column is capable of storing up to 100 bytes of information", + "source": "The script below will determine the UTF8 storage requirements for all tables and string columns in the database in scope, and whether the defined data type length has to be changed when converting to UTF-8. The result will show the table and column names that map to CHAR, NCHAR, VARCHAR, and NVARCHAR data types (including UDTs), their current type size definition, actual byte size, and projected byte size once encoded into UTF-8. \r\n\r\nFor example, for the column **EmailAddress** of table **Application.People**, the data type definition is **nvarchar(512)** and the data length for the largest string found in that column is 66 bytes. If changed to **varchar(512)** under a ***_UTF8*** collation, the data length would be reduced to 33 bytes. In this case, converting the column's collation and data type (without changing the size definition) will not cause data loss. \r\n\r\nHowever, if the projected byte size for the column using UTF-8 would be larger than the current data type definition, then the defined data type length would also have to be enlarged. For example, if a column were defined originally as **nvarchar(100)**1, and projected byte size for the column in UTF-8 would be 120, then changing the column type to a **varchar(100)**2 would result in data loss. The column would have to be defined at least as **varchar(120)**.\r\n\r\n1 Expresses byte-pairs, meaning the column is capable of storing up to 200 bytes of information \r\n2 Expresses bytes, meaning the column is capable of storing up to 100 bytes of information", "metadata": {} }, { @@ -219,7 +219,6 @@ }, { "output_type": "execute_result", - "metadata": {}, "execution_count": 7, "data": { "application/vnd.dataresource+json": { @@ -1494,7 +1493,8 @@ ] }, "text/html": "
ObjectNameColumnNameColumnTypeDefinedTypeSizeActualMaxBytesUTF8BytesNeededisdone
[Application].[Cities][CityName]nvarchar10070351
[Application].[Cities_Archive][CityName]nvarchar10032161
[Application].[Countries][Continent]nvarchar6046231
[Application].[Countries][CountryName]nvarchar12042231
[Application].[Countries][CountryType]nvarchar4030151
[Application].[Countries][FormalName]nvarchar120104521
[Application].[Countries][IsoAlpha3Code]nvarchar6631
[Application].[Countries][Region]nvarchar601681
[Application].[Countries][Subregion]nvarchar6050251
[Application].[Countries_Archive][Continent]nvarchar6026131
[Application].[Countries_Archive][CountryName]nvarchar12036181
[Application].[Countries_Archive][CountryType]nvarchar4030151
[Application].[Countries_Archive][FormalName]nvarchar12074371
[Application].[Countries_Archive][IsoAlpha3Code]nvarchar6631
[Application].[Countries_Archive][Region]nvarchar601681
[Application].[Countries_Archive][Subregion]nvarchar6050251
[Application].[DeliveryMethods][DeliveryMethodName]nvarchar10054271
[Application].[DeliveryMethods_Archive][DeliveryMethodName]nvarchar10032161
[Application].[PaymentMethods][PaymentMethodName]nvarchar10022111
[Application].[PaymentMethods_Archive][PaymentMethodName]nvarchar10022111
[Application].[People][EmailAddress]nvarchar51266331
[Application].[People][FaxNumber]nvarchar4028141
[Application].[People][FullName]nvarchar10058291
[Application].[People][LogonName]nvarchar10064321
[Application].[People][PhoneNumber]nvarchar4028141
[Application].[People][PreferredName]nvarchar10040201
[Application].[People][SearchName]nvarchar20292461
[Application].[People_Archive][EmailAddress]nvarchar51266331
[Application].[People_Archive][FaxNumber]nvarchar4028141
[Application].[People_Archive][FullName]nvarchar10046231
[Application].[People_Archive][LogonName]nvarchar10064321
[Application].[People_Archive][PhoneNumber]nvarchar4028141
[Application].[People_Archive][PreferredName]nvarchar10040201
[Application].[People_Archive][SearchName]nvarchar20282411
[Application].[StateProvinces][SalesTerritory]nvarchar10028141
[Application].[StateProvinces][StateProvinceCode]nvarchar10421
[Application].[StateProvinces][StateProvinceName]nvarchar10058291
[Application].[StateProvinces_Archive][SalesTerritory]nvarchar10028141
[Application].[StateProvinces_Archive][StateProvinceCode]nvarchar10421
[Application].[StateProvinces_Archive][StateProvinceName]nvarchar10052261
[Application].[SystemParameters][DeliveryAddressLine1]nvarchar1201681
[Application].[SystemParameters][DeliveryAddressLine2]nvarchar12072361
[Application].[SystemParameters][DeliveryPostalCode]nvarchar201051
[Application].[SystemParameters][PostalAddressLine1]nvarchar12026131
[Application].[SystemParameters][PostalAddressLine2]nvarchar12032161
[Application].[SystemParameters][PostalPostalCode]nvarchar201051
[Application].[TransactionTypes][TransactionTypeName]nvarchar10058291
[Application].[TransactionTypes_Archive][TransactionTypeName]nvarchar1001261
[Purchasing].[PurchaseOrderLines][Description]nvarchar200170851
[Purchasing].[PurchaseOrders][SupplierReference]nvarchar401891
[Purchasing].[SupplierCategories][SupplierCategoryName]nvarchar10054271
[Purchasing].[SupplierCategories_Archive][SupplierCategoryName]nvarchar1001471
[Purchasing].[Suppliers][BankAccountBranch]nvarchar10062311
[Purchasing].[Suppliers][BankAccountCode]nvarchar401261
[Purchasing].[Suppliers][BankAccountName]nvarchar10048241
[Purchasing].[Suppliers][BankAccountNumber]nvarchar4020101
[Purchasing].[Suppliers][BankInternationalCode]nvarchar401051
[Purchasing].[Suppliers][DeliveryAddressLine1]nvarchar1201681
[Purchasing].[Suppliers][DeliveryAddressLine2]nvarchar12052261
[Purchasing].[Suppliers][DeliveryPostalCode]nvarchar201051
[Purchasing].[Suppliers][FaxNumber]nvarchar4028141
[Purchasing].[Suppliers][PhoneNumber]nvarchar4028141
[Purchasing].[Suppliers][PostalAddressLine1]nvarchar12024121
[Purchasing].[Suppliers][PostalAddressLine2]nvarchar12020101
[Purchasing].[Suppliers][PostalPostalCode]nvarchar201051
[Purchasing].[Suppliers][SupplierName]nvarchar20048241
[Purchasing].[Suppliers][SupplierReference]nvarchar4022111
[Purchasing].[Suppliers][WebsiteURL]nvarchar51274371
[Purchasing].[Suppliers_Archive][BankAccountBranch]nvarchar10062311
[Purchasing].[Suppliers_Archive][BankAccountCode]nvarchar401261
[Purchasing].[Suppliers_Archive][BankAccountName]nvarchar10048241
[Purchasing].[Suppliers_Archive][BankAccountNumber]nvarchar4020101
[Purchasing].[Suppliers_Archive][BankInternationalCode]nvarchar401051
[Purchasing].[Suppliers_Archive][DeliveryAddressLine1]nvarchar1201681
[Purchasing].[Suppliers_Archive][DeliveryAddressLine2]nvarchar12052261
[Purchasing].[Suppliers_Archive][DeliveryPostalCode]nvarchar201051
[Purchasing].[Suppliers_Archive][FaxNumber]nvarchar4028141
[Purchasing].[Suppliers_Archive][PhoneNumber]nvarchar4028141
[Purchasing].[Suppliers_Archive][PostalAddressLine1]nvarchar12024121
[Purchasing].[Suppliers_Archive][PostalAddressLine2]nvarchar12020101
[Purchasing].[Suppliers_Archive][PostalPostalCode]nvarchar201051
[Purchasing].[Suppliers_Archive][SupplierName]nvarchar20048241
[Purchasing].[Suppliers_Archive][SupplierReference]nvarchar4022111
[Purchasing].[Suppliers_Archive][WebsiteURL]nvarchar51274371
[Purchasing].[SupplierTransactions][SupplierInvoiceNumber]nvarchar40841
[Sales].[BuyingGroups][BuyingGroupName]nvarchar10026131
[Sales].[BuyingGroups_Archive][BuyingGroupName]nvarchar100NULLNULL1
[Sales].[CustomerCategories][CustomerCategoryName]nvarchar10032161
[Sales].[CustomerCategories_Archive][CustomerCategoryName]nvarchar1001681
[Sales].[Customers][CustomerName]nvarchar20076381
[Sales].[Customers][DeliveryAddressLine1]nvarchar1201891
[Sales].[Customers][DeliveryAddressLine2]nvarchar12052261
[Sales].[Customers][DeliveryPostalCode]nvarchar201051
[Sales].[Customers][DeliveryRun]nvarchar10001
[Sales].[Customers][FaxNumber]nvarchar4028141
[Sales].[Customers][PhoneNumber]nvarchar4028141
[Sales].[Customers][PostalAddressLine1]nvarchar12022111
[Sales].[Customers][PostalAddressLine2]nvarchar12042211
[Sales].[Customers][PostalPostalCode]nvarchar201051
[Sales].[Customers][RunPosition]nvarchar10001
[Sales].[Customers][WebsiteURL]nvarchar512104521
[Sales].[Customers_Archive][CustomerName]nvarchar20046231
[Sales].[Customers_Archive][DeliveryAddressLine1]nvarchar1201681
[Sales].[Customers_Archive][DeliveryAddressLine2]nvarchar12048241
[Sales].[Customers_Archive][DeliveryPostalCode]nvarchar201051
[Sales].[Customers_Archive][DeliveryRun]nvarchar10001
[Sales].[Customers_Archive][FaxNumber]nvarchar4028141
[Sales].[Customers_Archive][PhoneNumber]nvarchar4028141
[Sales].[Customers_Archive][PostalAddressLine1]nvarchar12022111
[Sales].[Customers_Archive][PostalAddressLine2]nvarchar12034171
[Sales].[Customers_Archive][PostalPostalCode]nvarchar201051
[Sales].[Customers_Archive][RunPosition]nvarchar10001
[Sales].[Customers_Archive][WebsiteURL]nvarchar51296481
[Sales].[InvoiceLines][Description]nvarchar200170851
[Sales].[Invoices][ConfirmedReceivedBy]nvarchar800058291
[Sales].[Invoices][CustomerPurchaseOrderNumber]nvarchar401051
[Sales].[Invoices][DeliveryRun]nvarchar10001
[Sales].[Invoices][RunPosition]nvarchar10001
[Sales].[OrderLines][Description]nvarchar200170851
[Sales].[Orders][CustomerPurchaseOrderNumber]nvarchar401051
[Sales].[SpecialDeals][DealDescription]nvarchar6048241
[Warehouse].[Colors][ColorName]nvarchar4022111
[Warehouse].[Colors_Archive][ColorName]nvarchar40841
[Warehouse].[PackageTypes][PackageTypeName]nvarchar1001261
[Warehouse].[PackageTypes_Archive][PackageTypeName]nvarchar100NULLNULL1
[Warehouse].[StockGroups][StockGroupName]nvarchar10038191
[Warehouse].[StockGroups_Archive][StockGroupName]nvarchar1001681
[Warehouse].[StockItemHoldings][BinLocation]nvarchar40841
[Warehouse].[StockItems][Barcode]nvarchar10026131
[Warehouse].[StockItems][Brand]nvarchar1001891
[Warehouse].[StockItems][Size]nvarchar4026131
[Warehouse].[StockItems][StockItemName]nvarchar200170851
[Warehouse].[StockItems_Archive][Barcode]nvarchar10026131
[Warehouse].[StockItems_Archive][Brand]nvarchar1001891
[Warehouse].[StockItems_Archive][Size]nvarchar4026131
[Warehouse].[StockItems_Archive][StockItemName]nvarchar200170851
[Warehouse].[VehicleTemperatures][FullSensorData]nvarchar20003921961
[Warehouse].[VehicleTemperatures][VehicleRegistration]nvarchar401891
" - } + }, + "metadata": {} } ], "execution_count": 7