1

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
Vishal Suthar
  • 17,013
  • 3
  • 59
  • 105
divz
  • 7,847
  • 23
  • 55
  • 78

2 Answers2

0

The easiest place to do that is in SQL Server Management Studio, or SSMS. It's a free download from Microsoft.

http://www.microsoft.com/en-us/download/details.aspx?id=8961

You could type these into an ODBC console but you may as well get the proper tool for the job.

Nick.Mc
  • 18,304
  • 6
  • 61
  • 91
0

Please read this answer.

TSQL to grant db_datareader and db_datawriter for MS SQL Server

You can execute this once for the database.

Community
  • 1
  • 1
Akalanka
  • 310
  • 5
  • 12