Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Is there a way to output debugging information in UDF's so I can see the state of variables in various places?
Life is a comedy to those who think; a tragedy to those who feel.
  • *Experts*
Posted

I can't think of any direct way to do it. I know you can't put print statements in there. You also won't see the value of variables when using SQL Profiler.

 

You could modify the function to write values to a table and look at the results after. You could also cut and past the function into Query Analyzer and look at the values there - not as a function, but executing each line one at a time.

 

If you have the time, you could investigate setting up SQL Server to allow stepping through code. I've done it once, a long time ago, to step through a stored proc one line at a time. I don't know if you can step into functions though.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...