What is the diff between Static Queries and Dynamic queries
give me some examples

Answer Posted / praveen

Static queries are the queries we normally use like SELECT *
FROM EMPLOYEE. where as dynamic queries can be built and
executed dynamically. sp_executesql system stored procedure
is used to execute dynamic sql statements.

Eg: sp_executesql N'select * from employee'

dynamic sql queries will take more time to execute when
compared to static queries

Is This Answer Correct ?    18 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data file in computer?

544


What is the sql server 2000 version number?

550


What is the bookmark lookup and rid lookup?

576


What action plan is preferred if sql server is not responding?

537


How do database indexes work?

542






What is dbcc? Give few examples.

579


What will be the maximum number of index per table?

589


If we delete pack Spec what will be the status of pack Body ?

968


what are different types of backups available in sql server? : Sql server database administration

496


what is memory-optimized nonclustered indexes

559


How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?

512


What is the purpose of a table?

523


what types of replication are supported in sql server? : Sql server database administration

466


Introduction of rollup clause using sum and group by clause?

538


What are different types of views?

551