declare @colindex int
declare @colcount int
declare @tableid int
declare @colname varchar(100)
set @tableid = ( select id from sysobjects where name='tblUsrShrProp' )
set @colcount = ( select COUNT(*) from syscolumns where id = @tableid )
set @colindex = 1
while @colindex <= @colcount
begin
set @colname = ( select name from syscolumns where id = @tableid and colorder = @colindex )
print @colname
set @colindex = @colindex + 1
end
declare @colcount int
declare @tableid int
declare @colname varchar(100)
set @tableid = ( select id from sysobjects where name='tblUsrShrProp' )
set @colcount = ( select COUNT(*) from syscolumns where id = @tableid )
set @colindex = 1
while @colindex <= @colcount
begin
set @colname = ( select name from syscolumns where id = @tableid and colorder = @colindex )
print @colname
set @colindex = @colindex + 1
end
select @colcount as columncountname
No comments:
Post a Comment