相关疑难解决方法(0)

检查项目是否存在的最佳方法是:选择计数(ID)还是存在(...)?

如果表格包含超过700,000行,则确定项目是否存在的性能最佳

if (Select count(id) from Registeration where email='email@w.cn') > 0
    print 'Exist'
else
    print 'Not Exist'
Run Code Online (Sandbox Code Playgroud)

要么

if Exists(Select id from Registeration where email='email@w.cn') 
    print 'Exist'
else
    print 'Not Exist'
Run Code Online (Sandbox Code Playgroud)

sql t-sql performance sql-server-2005

16
推荐指数
1
解决办法
7159
查看次数

标签 统计

performance ×1

sql ×1

sql-server-2005 ×1

t-sql ×1