Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL SQL-Server Oracle
Hi in my new project we are using dynamic and static sql (inside procedure). but still i dont know what is the difference?
What is the use of Dynamic sql? Both case we are passing parameters from front end then why this dyanmic query ?
where is the use?
Posted 4-Feb-13 21:35pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Static queries run within the security context of the calling code (stored procedure, function etc.), dynamic queries run with the users access permissions.
Dynamic queries are used when you don't know the exact sql, for example when you might change columns or where clauses etc. at runtime.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100