The following script can be used to all for all the tables in your .

SELECT + '.' + AS TableName, as ColumnName
WHEN IN ('char','varchar') THEN'('+CASE WHEN sys.columns.max_length<0 then="" max="" else="" convert="" varchar="" ="" sys="" columns="" max_length="" end="" when="" types="" name="" in="" nvarchar="" nchar="" case="" 0="" 2="" numeric="" precision="" scale="" as="" datatype="" is_nullable="1" null="" not="" nullable="" from="" inner="" join="" t="" on="" system_type_id="sys.types._type_id" and="" is__defined="0" objects="" o="" object_id="sys.objects.object_id" schemas="" schema_id="sys.schemas.schema_id" where="" select="" _name="" information_schema="" tables="" order="" by="" column_id="" code="">

Source link


Please enter your comment!
Please enter your name here