On the SQL server I want to monitor via AppInsight, I am supposed to run the following script to setup permissions. So I Opened MSQLS Management Studio, connected to the database (Sharepoint 2010, SQL 2008) and clicked "New Query" pasted the script and hit Execute. Nothing I have tweeked or changed has improved the outcome, any suggestions?
USE master
GRANT VIEW SERVER STATE TO AppInsightUser
GRANT VIEW ANY DEFINITION TO AppInsightUser
EXEC sp_adduser @loginame = 'AppInsightUser' ,@name_in_
db = 'AppInsightUser'
GRANT EXECUTE ON xp_readerrorlog TO AppInsightUser
USE msdb
EXEC sp_adduser @loginame = 'AppInsightUser' ,@name_in_
db = 'AppInsightUser'
EXEC sp_addrolemember N'db_datareader',
N'AppInsightUser'
EXECUTE sp_MSforeachdb 'USE [?]; EXEC sp_adduser
@loginame = ''AppInsightUser'', @name_in_db =
''AppInsightUser'''
THE FIRST TWO LINES OF THE ERROR:
Msg 15151, Level 16, State 1, Line 2
Cannot find the login 'AppInsightUser', because it does not exist or you do not have permission.