Posts tagged Data Types

Table information – column lengths, counts and unique counts

1
Hi. The Transact-SQL script below returns the following information: ID – Just an identity column used within the script SchemaName – The name of the schema TableName – Obviously, the name of the table ColumnName Type – The data type of the column Length – The maximum number of bytes used by the [...]

List of table columns, with data types

2
The Transact-SQL query below, returns the table name, column name, data type, and maximum length. This is useful when producing database documentation SELECT       schema_name(O.schema_id) + '.' + O.name AS TableName,       C.name AS ColumnName,       T.name AS Type,       C.max_length AS [...]

Problem with ISNULL

0
While going through “Question of the day” from http://www.sqlservercentral.com/, I discovered an issue with the ISNULL function. If you were to run the query below, you will be suprised to hear, that the result returned is “A”.  I am sure you would expect the result to be [...]
Go to Top