I have a question about the types nvarchar and sysname. When I use the following query I get for nvarchar 2 types:
select sc.name as [name Field], st.name as [Name Type]
from sysobjects so
join syscolumns sc on sc.id = so.id
join systypes st on st.xtype = sc.xtype
where so.Xtype = 'u'
and so.name = 'TableName'
Result:
Field1 nvarchar
Field1 sysname
But when I use the following stored procedure:
exec sp_MShelpcolumns 'TableName'
Result:
Field1 nvarchar
Why I get by the first query 2 results?
select sc.name as [name Field], st.name as [Name Type]
from sysobjects so
join syscolumns sc on sc.id = so.id
join systypes st on st.xtype = sc.xtype
where so.Xtype = 'u'
and so.name = 'TableName'
Result:
Field1 nvarchar
Field1 sysname
But when I use the following stored procedure:
exec sp_MShelpcolumns 'TableName'
Result:
Field1 nvarchar
Why I get by the first query 2 results?