Home > Database > Mysql Tutorial > 获得MSSQL表中的所有列字段名称的方法(存储过程)

获得MSSQL表中的所有列字段名称的方法(存储过程)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:55:13
Original
1347 people have browsed it

原文地址: http://www.haokaoshi.com/html/jsjdj/3j/sjk/fd/37567.html SQL Server Create Proc pAllColumnSql (@tableName varchar(50)) as Declare @Name Varchar(2000) set @Name =’’ select @Name =@Name + ’,’ + Cast([name] as Varchar) from sys

原文地址: http://www.haokaoshi.com/html/jsjdj/3j/sjk/fd/37567.html SQL Server
Create  Proc pAllColumnSql 
(@tableName varchar(50)) 
as 
    
Declare @Name Varchar(2000) 
set @Name =’’ 
select @Name =@Name + ’,’ + Cast([name] as Varchar) 
from syscolumns 
where id=object_id(@tableName) 
set @name = substring(@name,2,len(@name)-1) 
select @name
Copy after login
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template