Hi All,
A typical issue found in SQL Server 2008, not sure if any one observed.
I created a table with following SQL:
CREATE table TESTER (COL_A NVARCHAR(100), COL_B INT, COL_C NUMERIC(18,8));
When we export the Create Script by Right Click on the table > "Script Table To" > "Create To" > "new Query Window"> Script is As Below
CREATE TABLE [dbo].[TESTER](
[COL_A] [nvarchar](100) NULL,
[COL_B] [int] NULL,
[COL_C] [numeric](18, 8) NULL
) ON [PRIMARY]
When I try Querying the Meta Data table "SYS.ALL_COLUMNS" using the following Script
Select * from sys.all_columns where OBJECT_NAME(object_id) = 'Tester'
Result is:
name system_type_id user_type_id max_length precision scale collation_name
COL_A 231 231 200 0 0 Latin1_General_CI_AS
COL_B 56 56 4 10 0 NULL
COL_C 108 108 9 18 8 NULL
Which shows me the Column Size where NVARCHAR is declared is shown double (200 Instead on 100).
Can some body explain why is this issue occurring, It is screwing the Procedured which are written based on the Meta Data, for Fetching the Create Script of a table.
please need help.....!
Thanks,
Sudhir Nune.