SQL Stored Procedure : Faydalı Sql Server Komutları 1

Bazı faydalı sql server stored procedure’leri bulabilirsiniz .

Sql Server veri tabanındaki tüm tablolardaki verilerin silinmesi ( Truncate all tables) :

EXEC sp_MSforeachtable ‘TRUNCATE TABLE ?’
  • Sql Server veri tabanındaki tüm tablolardaki verilerin silinmesi (Delete data from all tables):
EXEC sp_MSForEachTable “DELETE FROM ?”
  • Sql Server veri tabanındaki tüm kısıtların (CONSTRAINT) pasif hale getirilmesi (Disable all constraints from all tables):
EXEC sp_msforeachtable “ALTER TABLE ? NOCHECK CONSTRAINT all”
  • Sql Server veri tabanındaki tüm kısıtların (CONSTRAINT) aktif hale getirilmesi (Enable all constraints from all tables):
EXEC sp_msforeachtable “ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all”
  • Sql Server veri tabanındaki tüm tetiklerin (Trigger) pasif hale getirilmesi (Disable all triggers from all tables):
EXEC sp_msforeachtable “ALTER TABLE ? DISABLE TRIGGER all”
  • Sql Server veri tabanındaki tüm tetiklerin (Trigger) aktif hale getirilmesi (Enable all triggers from all tables):
EXECsp_msforeachtable “ALTER TABLE ? ENABLE TRIGGER all”
No feedback yet
Leave a comment

Your email address will not be revealed on this site.
PoorExcellent
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)
This is a captcha-picture. It is used to prevent mass-access by robots.

Please enter the characters from the image above. (case insensitive)

Array
Trackback address for this post
This is a captcha-picture. It is used to prevent mass-access by robots.

Please enter the characters from the image above. (case insensitive)

Array