본문 바로가기
sql

[sql] DB 컬럼 정보 조회 방법, sp 내용 확인하기

by 퍼포먼스마케팅코더 2022. 9. 26.
반응형

 

 

 

 

use log
go
DECLARE @tableName varchar(100) = N'ZenyFlowLog'; -- 테이블명
SELECT 
TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,COLUMN_DEFAULT,IS_NULLABLE,CHARACTER_SET_NAME
FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = @tableName;
exec sp_helpindex @tableName
exec sp_findModule @tableName
Declare @squery nvarchar(1000);
SET @squery = 'SELECT * FROM dbo.' + @tableName;
exec sp_executesql @squery;



--- exec sp_helptext 'usp_Set_ConfigByAID'  -- 확인하기
반응형

댓글