-- 전체 테이블 목록 변수에 넣기
declare @TableNames varchar(8000)
SELECT top 10 @TableNames = coalesce(@TableNames,'') + name + ', '
FROM sysobjects
WHERE xtype = 'U'
SELECT LEFT( @TableNames, LEN(@TableNames) - 1 ) AS TableNames
--테이블의 컬럼 목록 변수에 넣기
declare @ColumnNames varchar(8000)
declare @TableName varchar(128)
SET @TableName = '_TTFID'
SELECT top 10 @ColumnNames = coalesce( @ColumnNames, '' ) + name + ', '
FROM syscolumns
WHERE id = ( SELECT id FROM sysobjects
WHERE name = @TableName )
ORDER BY colid
SELECT @TableName AS TableName, LEFT( @ColumnNames, LEN( @ColumnNames ) - 1 ) AS ColumnNames
declare @TableNames varchar(8000)
SELECT top 10 @TableNames = coalesce(@TableNames,'') + name + ', '
FROM sysobjects
WHERE xtype = 'U'
SELECT LEFT( @TableNames, LEN(@TableNames) - 1 ) AS TableNames
--테이블의 컬럼 목록 변수에 넣기
declare @ColumnNames varchar(8000)
declare @TableName varchar(128)
SET @TableName = '_TTFID'
SELECT top 10 @ColumnNames = coalesce( @ColumnNames, '' ) + name + ', '
FROM syscolumns
WHERE id = ( SELECT id FROM sysobjects
WHERE name = @TableName )
ORDER BY colid
SELECT @TableName AS TableName, LEFT( @ColumnNames, LEN( @ColumnNames ) - 1 ) AS ColumnNames
덧글을 달아 주세요
TTF 2008/08/07 15:51 고유주소 고치기 답하기
http://blog.naver.com/mickey109?Redirect=Log&logNo=60004820276
TTF 2008/08/08 00:05 고유주소 고치기 답하기
http://blog.paran.com/woogigi/22023056