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

Sponsored Links



User does not have permission to run DBCC TRACEON

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 16-05-2009
Member
 
Join Date: May 2008
Posts: 860
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
Member
 
Join Date: May 2008
Posts: 685
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
Member
 
Join Date: Jan 2008
Posts: 1,515
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 XSI is offline
Member
 
Join Date: May 2008
Posts: 271
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
Tags: , , ,



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
Change the permission level of a user in Frontpage D_chapple Tips & Tweaks 1 06-02-2011 03:44 AM
Making permission for normal user in Linux Disha N Operating Systems 4 27-12-2010 09:56 AM
Mstsc /console user permission Itkila Active Directory 2 06-01-2010 03:29 PM
Permission for user Asghar Operating Systems 1 16-10-2009 11:13 AM
Display the user permission on a share folder Klums Active Directory 3 12-08-2008 08:34 AM


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