Archive for the ‘yardımcı kod’ Category

Oracle cursors kullanımı

Monday, January 14th, 2008

Oracle'da cursor kullanımı declare  vRC1 SYS_REFCURSOR;  vTemp acc_def%rowtype; begin  OPEN vRC1 FOR SELECT * from acc_def;  loop   fetch vRC1 into vTemp;   exit when vRC1%notfound;   dbms_output.put_line(':'||vTemp.id_no || '-'||vTemp.description);  end loop; end;

Tüm tablolara update statistics ve sp_recompile geçmek

Thursday, September 20th, 2007

Bir veritabanındaki tüm tablolara update statistics ve sp_recompile yapmak istiyorsanız aşağıdaki sql kodunu çalıştırarak ilgili kodu üreterek çalıştırabilirsiniz: select 'update statistics ' + db_name() + '..' + name + ' go exec ' + db_name() + '..sp_recompile ' + name + ' go ' from sysobjects where type='U'