Windows Tip

MS SQL Tip

kucky 2007. 1. 31. 12:00

1. SQL DB Log 용량 조절

->backup log werpdb with truncate_only

DBCC SHRINKFILE (werpdb_log, 100)


2. 전체 테이블 뒤져서 업데이트 하기

->select Distinct 'UPDATE ' + o.name + ' SET itemcode = ''' + '1234' + ''' where ItemCode = ''' + 'ABCD' + ''''
from sysobjects o , syscolumns c where o.id = c.id and o.type = 'u' and c.name = 'itemcode'
 

3. MSDE의 SA암호 변경

C:\Program Files\Microsoft SQL Server\MSSQL\Binn>osql -E
1>

2>sp_password @old = null, @new = 'Newpassword', @loginname = 'sa'


필요할때 않보이는 녀석들..ㅡㅡ;;