Script SQL Server
New database realease / version by DOS Command Batch / SQLCMD
changeNavRelease2016.bat
updateNavInterfaceToDBConn.bat
updateNavInterfaceToNew.bat
updateNavInterfaceToOld.bat
Content:...
Disable all the SQL Constraints
EXEC Sp_msforeachtable
@command1="ALTER TABLE ? DISABLE TRIGGER ALL"
go
To enable them afterwards
EXEC Sp_msforeachtable
@command1="ALTER TABLE ? ENABLE TRIGGER ALL"&nb
SSRS Reports data Analysis
SELECT TOP 1000 [name],
[instancename],
[reportid],
 
Calculate the Customer Churn using T-SQL
WITH tm AS
(
SELECT DISTINCT *
FROM  
Dynamic Backup Routine - Deployment
DECLARE @ServerName VARCHAR(50),
@BackupServer VARCHAR(255),
@Databasename VARCHAR(50),
@StrSQL  
Fills the date gaps - Customer Churn
WITH cl
AS (SELECT *
FROM cartopialistings
WHERE state = 'Withdrawn')
SELECT D.f
Shows all the MS SQL Jobs
USE msdb
go
SELECT *
FROM vw_job_and_schedules
CREATE VIEW dbo.vw_job_and_schedules
AS
SELECT [Job ID] = job.job_id,
[Job Name]
Solarwinds - DPA - Ignite - Analyzer performance tool
These are the comparison from some handy tools to administer the Database environment:
English version:
https://www.solarwinds.com/database-performance-monitoring-software/
Portuguese...
Importing CSV using BCP and Data Format
--// Set Up the Metadata
==================================================
CREATE TABLE TestTable(
Column1 varchar(10) NOT NULL,
Column2 varchar(10) NOT NULL,
Column3 varchar(10) NOT NULL
)
GO
This is an example to set up a migration...
Show the last day of month - SQL Server Date Function Last Month
--// This function is compatible >= 2008 version
select EoMonth(getdate(),0)