Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



User does not have permission to run DBCC TRACEON

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 16-05-2009
Blazej's Avatar
Member
 
Join Date: May 2008
Posts: 863
User does not have permission to run DBCC TRACEON

I have a huge database build under Microsoft SQL Server 2005. I recently faced a major problem when running certain queries in it. Whenever I run a query to get connected and retrieve data from the database, I have the following error message:
Quote:
[Microsoft][SQL Native Client][SQL Server]User 'DOMAIN\username' does not have permission to run DBCC TRACEON.
What is this message about? Is it possible for me to grant access to run DBCC TRACEON to a specific user? How?
Reply With Quote
  #2  
Old 16-05-2009
fellah's Avatar
Member
 
Join Date: May 2008
Posts: 690
Re: User does not have permission to run DBCC TRACEON

Are you trying to set a traceflag when retrieving the data? If so, then I suppose you don't need to trace flag. Actually, to set the trace flags you need to be a sysadmin privileges. So it certainly is not possible. If you really want to do so then use some different method for getting data.
Reply With Quote
  #3  
Old 16-05-2009
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
Re: User does not have permission to run DBCC TRACEON

It is the problem of application name which you may have used. To resolve this problem, just change the name of the application for the ODBC connection. Ideally the name used should be other than 'Microsoft Query'!
Reply With Quote
  #4  
Old 16-05-2009
XSI's Avatar
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 248
Re: User does not have permission to run DBCC TRACEON

To run DBCC Traceon, you require sysadmin rights. You can also programmatically change the connection string using the below example:

Code:
'ChangeConnection
Sub ChangeConnection()
    Dim sh As Worksheet
    Dim qt As QueryTable
    Dim sConnection As String
    For Each sh In ActiveWorkbook.Sheets
        For Each qt In sh.QueryTables
            'Show current connectionstring
            MsgBox ("Tab: " & sh.Name & vbCr & " Current Connection: " & vbCr & qt.Connection)
            'Show current query
            MsgBox ("Tab: " & sh.Name & vbCr & "Current Query: " & vbCr & qt.CommandText)
            'Change Connection
            qt.Connection = "ODBC;DRIVER=SQL Server;SERVER=myserver;DATABASE=myDB;Trusted_Connection=Yes;APP=Excel_TopCustomers;"
            'Change Qry text (the owner for instance)
            qt.CommandText = Replace(qt.CommandText, "DB.dbo.", "DB.Me")
            qt.SavePassword = False
            'Show new connectionstring
            MsgBox ("Tab: " & sh.Name & vbCr & "Connection: " & vbCr & qt.Connection)
            'Show new query
            MsgBox ("Tab: " & sh.Name & vbCr & "Query: " & vbCr & qt.CommandText)
        Next qt
    Next sh
End Sub
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "User does not have permission to run DBCC TRACEON"
Thread Thread Starter Forum Replies Last Post
Making permission for normal user in Linux Disha N Operating Systems 4 27-12-2010 10:56 AM
Mstsc /console user permission Admin Active Directory 3 06-01-2010 04:29 PM
User permission sureshpalani Active Directory 3 15-12-2009 03:00 AM
Permission for user Asghar Operating Systems 1 16-10-2009 12:13 PM
Granting Read Permission to Application Instead of User Tom Bombadil Windows Security 8 04-05-2009 10:32 PM


All times are GMT +5.5. The time now is 11:56 AM.