Laboratory/MSSQL 45

MSSQL 전체 DB Full Backup 스크립트

DECLARE @DIRLIST TABLE([OUTPUT] VARCHAR(1000)) --삭제할백업디렉토리리스트테이블변수 INSERT INTO @DIRLIST EXEC XP_CMDSHELL 'DIR T:\DB_BACKUP\FULL_BACKUP\ /AD /B' --백업디렉토리경로하위에날짜별백업폴더리스트조회하여테이블변수에INSERT DECLARE @CMD VARCHAR(4000) SET @CMD ='' DECLARE @DIRNAME VARCHAR(100) WHILE EXISTS ( SELECT * FROM @DIRLIST WHERE LEN(OUTPUT)=8 AND OUTPUT LIKE '20%' AND OUTPUT

Laboratory/MSSQL 2014.02.25

Mapping System Tables to System Views (Transact-SQL) SQL Server 2008 R2 Other Versions This topic shows the mapping between the system tables and functions and system views and functions. The following table maps the system tables that are in the mast..

출처 : http://msdn.microsoft.com/en-us/library/ms187997.aspx Mapping System Tables to System Views (Transact-SQL) SQL Server 2008 R2 Other Versions This topic shows the mapping between the system tables and functions and system views and functions. The following table maps the system tables that are in the master database in SQL Server 2000 to their corresponding system views or functions in SQL S..

Laboratory/MSSQL 2011.08.02

ROW_NUMBER(Transact-SQL)

ROW_NUMBER(Transact-SQL)결과 집합 파티션 내의 행 일련 번호를 반환합니다. 각 파티션의 첫 번째 행은 1로 시작합니다. Transact-SQL 구문 표기 규칙 구문 ROW_NUMBER ( ) OVER ( [ ] ) 인수 FROM 절이 생성한 결과 집합을 ROW_NUMBER 함수가 적용되는 파티션으로 나눕니다. PARTITION BY 구문은 OVER 절(Transact-SQL)을 참조하십시오. 파티션에서 ROW_NUMBER 값이 행에 할당되는 순서를 결정합니다. 자세한 내용은 ORDER BY 절(Transact-SQL)를 참조하십시오. 순위 함수에 가 사용된 경우 정수는 열을 나타낼 수 없습니다. 반환 형식 bigint 주의 ORDER BY 절은 지정된 파티션 내에서 행에 고유 ROW_..

Laboratory/MSSQL 2011.06.28