About 50 results
Open links in new tab
  1. mysql - What is dynamic SQL? - Stack Overflow

    Dynamic SQL is merely where the query has been built on the fly - with some vendors, you can build up the text of the dynamic query within one stored procedure, and then execute the …

  2. What is a dynamic SQL query, and when would I want to use one?

    Feb 3, 2010 · Here's a few articles: Introduction to Dynamic SQL Dynamic SQL Beginner's Guide From Introduction to Dynamic SQL: Dynamic SQL is a term used to mean SQL code that is …

  3. Dynamic SQL - EXEC (@SQL) versus EXEC SP_EXECUTESQL (@SQL)

    Apr 16, 2015 · What are the real world pros and cons of executing a dynamic SQL command in a stored procedure in SQL Server using EXEC (@SQL) versus EXEC SP_EXECUTESQL @SQL ?

  4. How to execute a dynamic sql using a variable inside a procedure

    Nov 12, 2024 · How to execute a dynamic SQL in a stored procedure which uses a variable which is defined as a first day of the month. Consider this just an example Declare V_frst_day date …

  5. How to use table variable in a dynamic sql statement?

    On SQL Server 2008+ it is possible to use Table Valued Parameters to pass in a table variable to a dynamic SQL statement as long as you don't need to update the values in the table itself. So …

  6. Assign result of dynamic sql to variable - Stack Overflow

    Assign result of dynamic sql to variable Asked 14 years, 4 months ago Modified 6 years, 10 months ago Viewed 209k times

  7. SQL Server dynamic queries - Stack Overflow

    The way you do this is with dynamically generated SQL which is run through the sp_executesql () stored procedure. In general you pass in your required table name to your master procedure, …

  8. cursor for loop & dynamic SQL - Snowflake - Stack Overflow

    Aug 18, 2022 · I'm attempting to write a procedure that takes in a list of tables and date_column to create some row_counts by calendar dates for reconciliation purposes. SELECT t.* FROM ( …

  9. Building dynamic where condition in SQL statement

    I want to build custom Where condition based on stored procedure inputs, if not null then I will use them in the statement, else I will not use them. if @Vendor_Name is not null begin set @

  10. Using bind variables with dynamic SELECT INTO clause in PL/SQL

    I agree with the others that the first method (dynamic SQL) is much better than the second (dynamic PL/SQL). Dynamic PL/SQL is very rare and almost never necessary. Based on …