DECLARE @SQL nvarchar(4000) = ''
SELECT @SQL += '['+COLUMN_NAME+']' + ', ' FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME
= 'Employee'
select SUBSTRING(@SQL,0,len(@SQL))
result-
[EmployeeID], [OldID], [Contract_Type], [EmployeeCode]
No comments:
Post a Comment