Transparent Data Encryption is a encryption method for encrypting database files at rest. This method is native to the DB engine and is one of the most best methods to encrypt your data files to ensure performance doesn't take a hit. SQL Server and Oracle both support TDE natively on its database engine. Now let … Continue reading Enable TDE (Transparent Data Encryption) for SQL Server 2016
2012
Inner Join in SQL Server
Tables are a userbasic b userlmits c groupauthclass -- 2 Table Inner Join SQL Server -- -- 3 Table Inner Join SQL Server --
Truncate Log in Database Mirroring SQL Server 2008 2012
select log_reuse_wait_desc from sys.databases where name = 'AdventureWorks' If Output is "LOG_BACKUP" -- Execute 2 Times just in case -- BACKUP LOG AdventureWorks TO DISK='NUL:' -- Now Truncate the Log -- USE AdventureWorks GO ALTER DATABASE AdventureWorksSET RECOVERY SIMPLE WITH NO_WAIT; GO DBCC SHRINKFILE(AdventureWorks_LOG, 100); GO ALTER DATABASE AdventureWorks SET RECOVERY FULL WITH NO_WAIT; GO
Enable XP_CMDSHELL SQL Server 2008 2012
EXEC sp_configure 'show advanced option',1 GO RECONFIGURE GO EXEC sp_configure 'xp_cmdshell', 1 GO RECONFIGURE GO
Run Powershell Script from Task Scheduler
Action : Start a Program Program : powershell.exe Add Arguements (Optional) "& 'c:\checkDS\CheckDiskSpace_post.ps1'"