Iam working in ruby on rails for fetching existing tables from remote MS Sql database.Iam getting this error while trying to run the application.
ODBC::Error: 42000 (229) [Microsoft][ODBC SQL Server Driver][SQL Server]The SELECT permission was denied on the object 'TeviceDetails', database 'BObd', schema 'dbo'.: EXEC sp_executesql N'SELECT [TeviceDetails].* FROM [TeviceDetails]'
From forums and other sites i understand this is due to 'permission denied from server DB' and mentioned several solutions to rectify this.following are the solutions i got from forums.
But my problem is, i really don't know where to type/grant these privileges. (Is it in ruby console or ODBC console.If it is in ODBC console ,from where i can access this ODBC console??)
USE msdb
CREATE USER [TheUser] FOR LOGIN [TheLogin]
GO
GRANT EXECUTE ON sp_start_job TO [TheUser]
GO
SQLAgentUserRole
SQLAgentReaderRole
SQLAgentOperatorRole