SELECT SysObjects.[Name] as TableName,
SysColumns.[Name] as ColumnName,
CASE SysTypes.[Name]
WHEN'sysname'THEN
'nvarchar'
ELSE
SysTypes.[Name]
END
AS [Name],CASE SysTypes.[Name]
WHEN'nvarchar'THEN
SysColumns.[Length] / 2
WHEN
'sysname'
THEN
SysColumns.[Length] / 2
ELSE
SysColumns.[Length]
END
AS [Length]
FROM
SysObjects INNER JOIN SysColumns
ON SysObjects.[Id] = SysColumns.[Id]
INNER JOIN SysTypes
ON SysTypes.[xtype] = SysColumns.[xtype]
WHERE SysObjects.[type] = 'U'ORDER BY SysObjects.[Name]
SysColumns.[Name] as
CASE SysTypes.[Name]
WHEN'sysname'THEN
'nvarchar'
ELSE
SysTypes.[Name]
END
AS [Name],CASE SysTypes.[Name]
WHEN'nvarchar'THEN
SysColumns.[Length] / 2
WHEN
'sysname'
THEN
SysColumns.[Length] / 2
ELSE
SysColumns.[Length]
END
AS [Length]
FROM
SysObjects INNER JOIN SysColumns
ON SysObjects.[Id] =
INNER JOIN SysTypes
ON SysTypes.[xtype] =
WHERE SysObjects.[type] = 'U'ORDER BY SysObjects.[Name]
No comments:
Post a Comment