|
Definitions More Info. | Definition ID | 916 | Title | SQL | Category | NOTES | Definition | Database Snapshot Create | Definition Description | CREATE DATABASE [GURMEN_SNAPSHOT] CONTAINMENT = NONE ON PRIMARY ( NAME = N'GURMEN_Data', FILENAME = N'S:\DATA\GURMEN_SNAPSHOT\GURMEN_SNAPSHOT_Data.snap'), ( NAME = N'CDCTBLOGFILE', FILENAME = N'S:\DATA\GURMEN_SNAPSHOT\CDCTBLOGFILE_SNAPSHOT.snap'), ( NAME = N'NEBIMLOGTBLFILE', FILENAME = N'S:\DATA\GURMEN_SNAPSHOT\NEBIMLOGTBLFILE_SNAPSHOT.snap'), ( NAME = N'NonClusteredIdxFile', FILENAME = N'S:\DATA\GURMEN_SNAPSHOT\NonClusteredIdxFile_SNAPSHOT_data.snap') AS SNAPSHOT OF GURMEN GO
-- Dynamic SQL DECLARE @sql varchar(5000) ,@date varchar(26)
SET @date=(SELECT CONVERT(varchar,getdate(),112)+CAST(DATEPART(hh,getdate()) AS varchar)+CAST(DATEPART(MINUTE,getdate())AS varchar))
SET @sql= 'CREATE DATABASE [GURMENSNAP_'+@date+'] CONTAINMENT = NONE ON PRIMARY ( NAME = N''GURMEN_Data'', FILENAME = N''S:\DATA\GURMENSNAPSHOT\GURMENSNAP'+@date+'_Data.snap''), ( NAME = N''CDCTBLOGFILE'', FILENAME = N''S:\DATA\GURMEN_SNAPSHOT\CDCTBLOGFILESNAP'+@date+'.snap''), ( NAME = N''NEBIMLOGTBLFILE'', FILENAME = N''S:\DATA\GURMEN_SNAPSHOT\NEBIMLOGTBLFILESNAP'+@date+'.snap''), ( NAME = N''NonClusteredIdxFile'', FILENAME = N''S:\DATA\GURMEN_SNAPSHOT\NonClusteredIdxFileSNAP'+@date+'_data.snap'') AS SNAPSHOT OF GURMEN GO'
PRINT(@sql) | RecordBy | cunay | Record Date | 29-01-2019 12:35:51 | Düzenle | | Kopyala | | Sil | | |
|
|