質問があります:
Select a from tbl_abc where id in ( select id from tbl_xyz where mainid = 12)
このクエリを実行しているときは、実行に1〜2秒かかりますが、ストアドプロシージャで同じクエリを使用しているときは、次のクエリに5分以上かかります。
If(Select a from tbl_abc where id in ( select id from tbl_xyz where mainid = 12))
BEGIN
-- CREATE TEMPORARY TABLE [Say: #temp1]
#temp1 => Select a from tbl_abc where id in ( select id from tbl_xyz where mainid = 12)
inserting the same value in the temp table
drop #temp1
END
これの理由は何でしょうか?どうすればこれを解決できますか?asp.netからSPを実行しています