Home > Database > Mysql Tutorial > 动态查询输出数据

动态查询输出数据

WBOY
Release: 2016-06-07 14:56:52
Original
1346 people have browsed it

动态查询输出字符串 无 declare?@sql1?nvarchar(200),@sql2?nvarchar(200)declare?@count?nvarchar(100);set?@sql1?=?'SELECT?CONVERT(varchar(100),?GETDATE(),?0)'set?@sql2?=?'SELECT?@count?=?CONVERT(varchar(100),?GETDATE(),?0)'exec?sp_executesql??@

动态查询输出字符串
declare?@sql1?nvarchar(200),@sql2?nvarchar(200)
declare?@count?nvarchar(100);
set?@sql1?=?'SELECT?CONVERT(varchar(100),?GETDATE(),?0)'
set?@sql2?=?'SELECT?@count?=?CONVERT(varchar(100),?GETDATE(),?0)'
exec?sp_executesql??@sql2,N'@count?nvarchar(50)?out',@count?out
print?@sql1?+':'+?@count
Copy after login
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template