what is dynamic sql

Answers were Sorted based on User's Feedback



what is dynamic sql..

Answer / hima

Dynamic SQL is a term used to mean SQL code that is
generated programatically (in part or fully) by your program
before it is executed. As a result it is a very flexible and
powerful tool. You can use dynamic sql to accomplish tasks
such as adding where clauses to a search based on what
fields are filled out on a form or to create tables with
varying names.
Using dynamic SQL you can put a SQL statement inside a
variable and execute that statement. It's what you have to
do when you're trying to run Select * from @TableName.

Is This Answer Correct ?    6 Yes 1 No

what is dynamic sql..

Answer / nilesh

Dynamic SQL enables you to write programs that reference
SQL statements whose full text is not known until runtime.
Before discussing dynamic SQL in detail, a clear definition
of static SQL may provide a good starting point for
understanding dynamic SQL. Static SQL statements do not
change from execution to execution. The full text of static
SQL statements are known at compilation, which provides the
following benefits:

Successful compilation verifies that the SQL statements
reference valid database objects.
Successful compilation verifies that the necessary
privileges are in place to access the database objects.
Performance of static SQL is generally better than dynamic
SQL.
Because of these advantages, you should use dynamic SQL
only if you cannot use static SQL to accomplish your goals,
or if using static SQL is cumbersome compared to dynamic
SQL. However, static SQL has limitations that can be
overcome with dynamic SQL. You may not always know the full
text of the SQL statements that must be executed in a
PL/SQL procedure. Your program may accept user input that
defines the SQL statements to execute, or your program may
need to complete some processing work to determine the
correct course of action. In such cases, you should use
dynamic SQL.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is the purpose of namespace in c#?

0 Answers  


What's the difference between System.String and System..StringBuilder in C#?

0 Answers   PUCIT,


What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

3 Answers  


What is Web.config?

0 Answers   Amazon,


What?s class SortedList underneath?

2 Answers  






Can we override interface methods in c#?

0 Answers  


What are the collection classes ?

2 Answers   Digital GlobalSoft,


how do you do exception management

4 Answers   Accenture, HCL,


How to add controls dynamically to the form using c#.net.

0 Answers  


What is a .exe extension files? How is it similar to .dll extension files?

0 Answers   Accenture,


What are the benefits of using windows services:

0 Answers  


What is main thread in c#?

0 Answers  


Categories