Results 1 to 2 of 2

Thread: parse and performance on store procedure

  1. #1
    Join Date
    Oct 2002
    Location
    Israel
    Posts
    2

    Question parse and performance on store procedure

    Hi All,

    My question is: can the parse of this command bellow afect the perfomance of my store procedure.

    SET @sql = 'insert xxx select TOP ' + CAST(@a as varchar)+ ' * from yyy where zzz = ''' + @zzz + ''' and yyy = ''' + @yyy + ''' order by zzz desc, yyy desc, www desc' exec (@sql)

    Thanks

    Sergio

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Yes it does.

    whenever u r doing a dynamic query make sure u give index hints on select statements
    (Index = zzz_yyy_Non_Cluster_Idx)

    so that Query optimizer doesnt have work on what plan to choose.

Posting Permissions

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