score:0
The sys.types and sys.systypes have some of that info, play around with these queries
select *
from sys.types
select *
from sys.systypes
score:0
What about trying this. It uses the tables sysobjects
, syscolumns
and systypes
to find table name, column name, type and length in bytes. You can select more fields as you need from syscolumns
or systypes
.
SELECT
top 5
so.name as tablename,
sc.name as columnname,
st.name as typename,
sc.length as columnlength_bytes
FROM
syscolumns sc
INNER JOIN
sysobjects so
on sc.id = so.id
INNER JOIN
systypes st
on sc.xtype = st.xtype
WHERE
so.xtype = 'U'
ORDER BY
sc.length desc
More questions
- SQL Query to get largest datatype in schema
- Get the SQL table column schema with Datatype and Max Length in number value
- SQL Server: Get table primary key using sql query
- SQL - Query to get server's IP address
- set default schema for a sql query
- SQL Query to search schema of all tables
- sql query to get earliest date
- SQL query to get the deadlocks in SQL SERVER 2008
- Select query to get data from SQL Server
- How to get correct query execution time in SQL Server?
- How to get a view table query (code) in SQL Server 2008 Management Studio
- SQL Query to get aggregated result in comma separators along with group by column in SQL Server
- How do I get parameter values for SQL Server query in SQL Server Profiler
- Get SQL Server schema via a SQL query?
- How to get column names from a query in SQL Server
- SQL Query to get latest price
- How to get Distinct values in SQL Query
- SQL Query to get misc column information
- how to query SQL Server via REST to get XML
- Get only two decimal points in money datatype in SQL Server
- SQL Server query to get data type for all columns in table?
- Get Value From Json object contain table column using SQL Query
- Display DataType and Size of Column from SQL Server Query Results at Runtime
- Get User Data in a Formatted Way With Sql Query
- SQL Query to get recursive count of employees under each manager
- SQL query to get the top "n" scores out of a list
- SQL query to get full hierarchy path
- Get number of employees who worked in more than one department with SQL query
- SQL Query to get the Sum of all column values in the last row of a resultset along with row sum (group by)
- SQL query to get the precision value of a column
More questions with similar tag
- Using Dense Rank to simulate Count(Distinct) but running into a problem
- Query Timeout in EF Core but runs fast in SSMS
- Cannot find stored procedure
- How to find out if a user exists in a db using sp_executesql?
- Updating sql table with results from left join (sql server)
- Tree structure recursive sum of aggregated values from another table
- SQL Server select all records that do not have duplicate value with prefix
- SQL server filtering CJK punctuation characters
- SQL - create multiple calendars in one table
- How to insert data into temp table using Case statement in SQL
- Join multiple tables and pick results from most recent table
- Importing specific date format to Excel from Microsoft SQL Server
- MySql emulation running on Microsoft SQL 2008
- SQL - How to split results into buckets that have an approximately equal sum of values. Non normal distribution
- Projecting simultaneous database queries
- SQL Server deadlock and Data Pages
- Connection String in c#
- How to make a identity column for a 2-key primary key
- Display days between statuses listed horizontally
- Get only the Date part of DateTime in mssql
- SQL show all values with COUNT in a "WHERE IN ()" clause
- SQL - count occurrences in a column by DAY
- Can Database Mirroring Be Setup On MS SQLServer Between Two Clusters
- SQL Server query for finding weeknumber of a month considering thursday as week counter
- How to change the format of time for a specific column in SQL Server from hhmmss to hh:mm:ss
- Trimmed mean on computed (avg) column
- write a query without CTE
- How to reduce size of a SQL server docker volume after deleting unused databases?
- How do I correctly implement quotename in SQL Server?
- Calculate final outcomes based on Results/ID for multiple fields
Source:
stackoverflow.com