트랜잭션로그 정리
SELECT [name],
[recovery_model_desc] FROM sys.databases WHERE [name] = DB_NAME()
ALTER DATABASE SyncAddress SET RECOVERY SIMPLE
(SELECT 논리적파일이름 = [Name] FROM sys.database_files WHERE type = 1)
DBCC SHRINKFILE('SyncAddress_log', 500000)
ALTER DATABASE SyncAddress SET RECOVERY FULL
NGRAM
USE [SyncAddress]
GO
/****** Object: UserDefinedFunction [dbo].[FN_PARSE] Script Date: 2018-07-06 오후 2:05:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[FN_PARSE]
(
-- Add the parameters for the function here
@STR NVARCHAR(4000)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
-- Declare the return variable here
DECLARE @RETVAL NVARCHAR(MAX) = ''
DECLARE @MODSTR NVARCHAR(4000) = REPLACE(@STR, ' ', '')
-- Add the T-SQL statements to compute the return value here
DECLARE @GRAM INT = 1
DECLARE @POS INT = 1
WHILE(@GRAM <= LEN(@MODSTR))
BEGIN
IF @GRAM > 5 BREAK
WHILE(@POS + @GRAM <= LEN(@MODSTR))
BEGIN
SET @RETVAL += SUBSTRING(@MODSTR, @POS, @GRAM) + ' '
SET @POS = @POS + 1
END
SET @POS = 1
SET @GRAM = @GRAM + 1
END
-- Return the result of the function
RETURN @RETVAL
END
댓글 없음:
댓글 쓰기