Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Dynamic Query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

suriyarupa
Starting Member

19 Posts

Posted - 03/13/2013 :  06:34:25  Show Profile  Reply with Quote
Dynamic query will take time to execute? What is the difference between Select query inside Query string and outside of Query string? Which one will take time to execute.?

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 03/13/2013 :  06:41:08  Show Profile  Reply with Quote
depends on the query always. Cant say always dynamic will take time or vice versa. One thing to note is dynamic sql using sp_executesql will have ability to cache plans as against ones using EXEC()

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

suriyarupa
Starting Member

19 Posts

Posted - 03/14/2013 :  03:39:40  Show Profile  Reply with Quote
Thanks for ur reply.
So you mean to say,If query has been written by using SP_ExecuteSQL command,then it will take time to execute.

Edited by - suriyarupa on 03/14/2013 03:40:23
Go to Top of Page
  Previous Topic Topic Next 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.03 seconds. Powered By: Snitz Forums 2000