当用SQL server management studio使用IP连接时提示如下错误:

 

sql server 2008r2:The target principal name is incorrect. Cannot generate SSPI context

 

解决方法:

cmd中执行(注意管理员权限运行):

    SETSPN -A MSSQLSvc/DBServerName:1433 DBServerName