Script para obtener la definición de una tabla en Sql Server.

SELECT
	OBJECT_NAME(C.OBJECT_ID) AS 'Tabla'
	,C.name AS 'Columna'
	,SCHEMA_NAME(T.schema_id) AS 'Esquema'
	,T.name AS 'Tipo'	
	,C.max_length AS 'Tamaño Maximo en Bytes'
	,C.precision AS 'Precisión'
	,C.scale AS 'Escala'
FROM 
	sys.columns AS C
JOIN 
	sys.types AS T 
ON 
	C.user_type_id = T.user_type_id
WHERE 
	OBJECT_NAME(C.OBJECT_ID)='Card' 
ORDER BY 
	C.OBJECT_ID;

Agregar comentario

Loading