SQL Server Errorlog 조회
USE master; GO -- 최근 1주일 errorlog 역순 조회 DECLARE @FROM_DTDATETIME = DATEADD(DAY, -7, GETDATE()) , @TO_DTDATETIME = GETDATE(); exec xp_readerrorlog 0, 1, NULL, NULL, @FROM_DT, @TO_DT, N'DESC'; --에러로그 파일번호: 0 = current, 1 = Archive #1, 2 = Archive #2, etc... --로그 파일종류: 1 or NULL = error log, 2 = SQL Agent log --검색인자1: --검색인자2: 검색인자1과는 AND 연산입니다. --검색시작시간 : --검색끝시간: --결과정렬방식= ascending, N ' desc ' =..
SQL Server 파티션(PARTITION) 정보 확인
해당 DB에서 실행 SELECTDB_NAME() AS [DB_NAME] ,T1.[name] AS TABLE_NAME ,T1.[object_id] ,T2.[name] AS INDEX_NAME ,T4.[name]AS PARTITION_SCHEME_NAME ,T5.[name]AS PARTITION_FUNCTION_NAME ,T3.partition_number AS PARTITION_NUMBER ,T3.[rows]AS PARTITION_ROWS ,CASE T5.boundary_value_on_right WHEN 0 THEN 'LEFT' WHEN 1 THEN 'RIGHT' ELSE '' END AS PARTITON_RANGE ,T9.[value]AS RANGE_VALUE ,T7.[name]AS FILEGROUPS..
SQL Server 에서 API 호출 하기
/* exec sp_configure 'show advanced options', 1; go reconfigure; go exec sp_configure 'Ole Automation Procedures', 1; go reconfigure; go */ declare @obj int , @response nvarchar(4000) exec sp_OACreate 'MSXML2.XMLHTTP', @obj out; exec sp_OAMethod @obj, 'open', NULL, 'get', 'https://호출할 API 주소', 'false' exec sp_OAMethod @obj, 'send' exec sp_OAMethod @obj, 'responseText', @response output select @r..