executesql 存储过程

WBOY
Release: 2016-06-07 17:59:39
Original
1258 people have browsed it

executesql 存储过程代码,需要的朋友可以参考下。

代码如下:
declare @tt varchar(20)
set @tt = 'monisubbouns'
declare @int int
declare @sql nvarchar(500)
set @sql = 'select @int=count(*) from ' + @tt
exec sp_executesql @sql,N'@int int output',@int output
print @int

Related labels:
source:php.cn
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 Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!