在SQL中检查auth模式时语法不正确 [英] Incorrect syntax while checking the auth mode in SQL

查看:77
本文介绍了在SQL中检查auth模式时语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SELECT CASE SERVERPROPERTY('IsIntegratedSecurityOnly')   
WHEN 1 THEN 'Windows Authentication'   
WHEN 0 THEN 'Windows and SQL Server Authentication'   
END as [Authentication Mode] 




Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ' '. 





我的尝试:



仅在SQL Server 2008 R2中面临问题



What I have tried:

Facing issue in only SQL Server 2008 R2

推荐答案

嗯。

我刚试过SQL 2012和你的查询copy'n'运行良好:返回Windows和SQL Server身份验证。

和文档 SERVERPROPERTY(Transact-SQL) [ ^ ]它说它适用于SQL 2008,所以它应该适合你。



检查你的查询 - 确保它不是其他的一部分一个更大的查询抛出错误并让你认为它是导致问题的SERVERPROPERTY调用。

如果不这样,你究竟是如何执行查询的?
Hmmm.
I just tried it on SQL 2012 and your query copy'n'pasted ran fine: "Windows and SQL Server Authentication" was returned.
And the documentation SERVERPROPERTY (Transact-SQL)[^] says it appies to SQL 2008, so it should work for you.

Check your query - make sure that it isn't some other part of a bigger query that is throwing the error and making you think it's the SERVERPROPERTY call that causes the problem.
Failing that, how exactly are you executing the query?


这篇关于在SQL中检查auth模式时语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆