When we are developing some software and we want to clean the SQL database to simulate a new installation, it would be interesting to have a routine that would erase the contents of all tables. This script performs this task, it deletes the contents of all the tables of the instance that is open in SQL Server Management Studio. ATTENTION: The TRUNCATE command erases all the contents of the tables and there is no way to restore, only with backup. Use this script very consciously and in test environments where you really want to do a general clean up in your database. I am not responsible for the use of this in your bank. Created by my friend Airton Junior , it follows the killer script... USE MASTER; --TABELA TEMPORÁRIA PARA ARMAZENAR OS BANCOS SEPARADOS PARA LIMPEZA CREATE TABLE #TEMPORARIA (NOMEBANCO VARCHAR(255)); GO --SEPARATION OF DATABASES INSERT INTO #TEMPORARIA (NOMEBANCO) SELECT name FROM master.sys.databases WHERE name LIKE '% BANKNAME %' AND nam
🔸 Guys, I created this blog to keep content, research and tips that at some point I needed and it took work to locate. The content is free, you can use it at will, but remember to validate and adapt to your needs. 🔸 Pessoal, criei esse blog para ir guardando conteúdos, pesquisas e dicas que em algum momento precisei e deu trabalho localizar. O conteúdo é gratuito, podem usar a vontade, mas lembre-se de validar e adaptar para a sua necessidade.