Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debug greyed out - Query Analyzer - User defined function

Status
Not open for further replies.

qztm51

Programmer
Apr 30, 2002
10
US
Somebody please help!

I have a user defined function in SQL Server 2000 that I need to debug. When I go into Query Analyzer and right click on the function in the Object Browser, the Debug option is there, but it is greyed out.

I have opened the Query Analyzer through both Enterprise Manager and through the start-->progams-->Query Analyzer. I have connected as sa (SQL Auth) and as a user of the database (Windows Auth) with db_owner rights and that user is an System Admin in SQL Server as well as the Windows server.

Within the same database, if I go to the Stored Procedures and right click on a selected stored procedure, the debug option is there and I can use it (not greyed-out).

I think it must be a permissions issue, but I don't know where else I need to look. Any help would be greatly appreciated...Thanks,
 
My understanding is that the debugger only debugs store procedures nothing is said about debugging functions.

From books online:
Using Transact-SQL Debugger
SQL Query Analyzer comes equipped with a Transact-SQL debugger that allows you to control and monitor the execution of stored procedures. The debugger supports traditional functionality such as setting breakpoints, defining watch expressions, and single stepping through procedures. This functionality is available when the SQL Server service uses a domain user account.

In a client/server environment, the client workstation running the debugger must be a member of the same domain as the computer running the corresponding instance of SQL Server.

The Transact-SQL debugger in SQL Query Analyzer supports debugging against Microsoft® SQL Server™ 2000, SQL Server version 7.0, and SQL Server version 6.5 Service Pack 2.



Note It is not advisable to use the Transact-SQL debugger on a production server. While in step execution mode, the debugger can lock certain system resources that are needed by other processes.

I suppose you could try re-writing the function as a stored procedure and then debug it.

Best Regards,
Mike
 
Mike,

Thank you for your response.

I think you are correct about the Debug feature not working on functions. I had read the books online, but seeing the Debug greyed-out and also reading comments on other web sites made me think it was possibly permissions. I guess it was wishful thinking on my part.

I will try re-writing the function as a stored procedure...that's a great idea. I had blinders on trying to figure out how to get one thing working instead of working around it. Thanks again for your help!

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top