SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 actual execution for a function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shaggy
Posting Yak Master

India
245 Posts

Posted - 02/23/2011 :  07:29:19  Show Profile  Reply with Quote
Pops,

I could not able to find actual execution for a function.is there any way to get that and when i closely analyze cpu utilization is high when using function.can anyone please advice for this behaviour.

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 02/23/2011 :  07:49:30  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
you could use profiler. Probably the best way to do it.

Or -- if you know the code that is causing the problem (or you have a high degree of suspicion) you could grab it, run the code in management studio and look at the execution plan.

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

shaggy
Posting Yak Master

India
245 Posts

Posted - 02/23/2011 :  08:07:00  Show Profile  Reply with Quote
Thanks for reply charlie,

when i execute the function with actual execution plan on i could not able to get the exact plan and i could not able to find the query plan for underlying select statement. is there any other way to find
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 02/23/2011 :  10:35:16  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
yeah -- extract the logic from the function -- set it up in script form. give it parameters. Then run it.

Or just have a look at the code -- chances are there's something in there (a loop maybe) that can be rewritten.

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

shaggy
Posting Yak Master

India
245 Posts

Posted - 02/24/2011 :  00:11:56  Show Profile  Reply with Quote
charlie i want to know whether plan will be generated for functions bcoz when using function cpu utilization is very high.i think plan will not be generated .i dont know the exact inner thing, can u put some light on this.
Go to Top of Page

mmarovic
Aged Yak Warrior

Czech Republic
518 Posts

Posted - 02/24/2011 :  08:24:32  Show Profile  Visit mmarovic's Homepage  Send mmarovic a Yahoo! Message  Reply with Quote
How about posting the code of your function?

Mirko

My blog: http://mirko-marovic-eng.blogspot.com/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000