본문 바로가기

㏈ª By β┖υΕJini103

SQL Server SP 상단 주석 제거 퇴근 할려는데 카톡으로 쿼리로 SP 주석 제거 할 수 있는 방법 물어 보길래 한번 만들어 봤습니다. SELECT REPLACE(ss.definition, SUBSTRING(ss.definition, CHARINDEX('/*', ss.definition) - 2, CHARINDEX('*/', ss.definition) + 4 - CHARINDEX('/*', ss.definition)), '') AS [주석제거SP], ss.definition [기존SP] FROM Admin.sys.objects AS so INNER JOIN Admin.sys.sql_modules AS ss ON so.object_id = ss.object_id WHERE so.schema_id = 1 AND type = 'P' AND ss.. 2013. 2. 8.
RECOVERY_PENDING 복구 방법 RECOVERY PENDING The database will be in this state if SQL Server knows that recovery needs to be run on the database but something is preventing recovery from starting. This is different from SUSPECT because there's nothing to say that recovery is going to fail - it just hasn't started yet. An example of this is when the database wasn't cleanly shut down (i.e. there was at least one uncommitted.. 2012. 12. 21.
Merge Replication 수동 삭제 및 서버 변경에 따른 Hostname 변경 (SQL 2000) 증상 전세계 여러매장에서 대략 5000여대의 POS 를 사용하고 있다. 각각의 POS 는 SQL Server 2000 Personal Edition 설치 되어 있다. 각 매장마다 판매 및 상품의 데이터를 공유하기 위해 매장 별로 Merge Replication 을 사용하고 있는 구조다. 이렇게 많은 POS 의 재설치시 설치 시간을 단축하기 위해 Ghost 를 사용한다. 기본 Base Server 가 아니라 이미 사용중인 특정 서버를 Ghost 로 떠서 기존에 사용중인 Replication 정보가 저장 되어 있다. Merge Replication 를 재구성 할려고 하거나 EM 게시자에서 DELETE 를 통해 Replication 를 제거 할려고 하면 Error 가 발생한다. 그리고 Replication 으.. 2012. 12. 13.
Dynamic PIVOT CLR [원문] http://www.sqlservercentral.com/articles/.Net/94922/ 해외 사이트에서 다이나믹 피벗을 CLR 로 만든걸 보고 한번 테스트 해보았습니다. 피벗을 좀더 쉽게 사용 할수 있습니다. 성능은 장담 못하지만 ^^ 소스 파일 컴파일 한 DLL 파일 DynamicPivot.cs using System; using System.Collections; using System.Collections.Generic; using System.Data.SqlClient; using System.Data; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; namespace Syx.Functions { public parti.. 2012. 12. 12.