惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

博客园 - 兰亭

【转】优秀的人才是免费的,平庸的人才是昂贵的 [转]泰坦尼克号禁播的内容,震撼 [转]Android基础类库 我的2012 SQL SERVER默认工作线程数过少导致数据库阻塞[已解决] Delphi TrayIcon任务栏图标毛边问题[部分解决] [转]一篇好文,以在迷茫时阅读 宝宝该吃什么?还能吃什么? 借刀杀兔(冷笑话) SQL SERVER 2005 导入数据 令人啼笑皆非的《银河系漫游指南》 令人郁闷的DateTime.ToString()方法 我的2007 不可否认,傲游(Maxthon)确实越来越垃圾 轻量级Ajax解决方案:Anthem.NET初探 FCKeditor的中文文件名解决方案 [转贴]程序员如何防止脑疲劳:下午补充一些干果 [转贴]细说HTML元素的ID和Name属性的区别 在.NET中使用Access数据库的注意事项
执行动态SQL语句时传入参数
兰亭 · 2006-07-11 · via 博客园 - 兰亭

使用sp_executesql执行动态SQL语句,同时向里面传入参数。

create procedure proc_SelectDynamic
    
@Id    int,        --    ID
    @LbId    int,        --    类别ID
    @GetField nvarchar(200)    --    获取字段名
AS
    
declare @sql nvarchar(300), @param nvarchar(500)
    
set @sql = 'SELECT ' + @GetField + ' FROM TEST WHERE ID = @ID AND LBID = @LBID '
    
set @param = '@ID int, @LbId int'

    
exec sp_executesql @sql@param@id@lbid