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

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 兰亭

【转】优秀的人才是免费的,平庸的人才是昂贵的 [转]泰坦尼克号禁播的内容,震撼 [转]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