Results 1 to 2 of 2

Thread: sp_executesql

  1. #1
    Join Date
    Jul 2003

    Unanswered: sp_executesql


    When I run the following query it takes about 30 seconds to finish. If I remove the variables and hardcode values it finishes in 2 seconds. Does anyone have any idea what might be going on here? This query is generated from Clarify (CRM application) and modifying the base code is a pain.

    Thanks in advance for the help.

    exec sp_executesql N' select part_num_objid, part_number, part_desc, part_domain, model_num, mod_level_objid, par_mod_level_objid, mod_level, active, price_qty_objid, priced_qty, fixed_amt, percentage, price, price_inst_eff_dt, price_inst_exp_dt, price_type, unit_measure, objid, p_standalone, p_as_parent, p_as_child, part_line, part_family, part_type, part_status, p_qty_type, is_sppt_prog, price_prog_objid, currency_objid, price_prog_name, price_prog_dspcc, prog_eff_dt, prog_exp_dt, mod_eff_dt, mod_exp_dt, price_type_str, sn_track, sub_scale, currency_name
    from dbo.table_c_options
    where ( p_as_parent = @U1 AND price_prog_objid = @U2 AND (par_mod_level_objid in (@U3)) )
    ', N'@U1 varchar(255),@U2 varchar(255),@U3 varchar(255)', @U1="1",@U2="536870915",@U3="536872651"

  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    Run an execution plan on both versions and see where the difference is (in time or method).


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts