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

Is it possible to create trigger on views?

545


What do you mean by collation recursive stored procedure?

583


How retrieve field names from the table in SQL through JAVA code?

1395


How to create an index on an existing table in ms sql server?

491


How to use old values to define new values in update statements in ms sql server?

674






Explain error handling in ssis?

565


When we should use and scope of @@identity?

537


What are views in ms sql server?

592


List the different types of collation sensitivities in sql server?

520


Explain about protocol layer present in SQL server?

605


What is the usage of sign function?

585


How to execute function in stored procedure sql server?

535


What is filestream?

554


Does sql server 2000 full-text search support clustering?

500


What is shared lock?

485