2009.05.14 18:55
보통 적으로 많이 사용하는 쿼리들 입니다.
--System table Query
select * from sysobjects where xtype='u'
--Table size
select table_name = convert(varchar(30), min(o.name)), table_size = ltrim(str(sum(reserved) *8192/1024,15,0) + 'kb'),crdate,refdate
from sysindexes i inner join sysobjects o on (o.id = i.id)
where i.indid in (0,1,255) and o.xtype = 'U'
group by i.id,crdate, refdate
order by refdate desc
--Table PK 기본키
select name from sysobjects where xtype ='pk'
--Table name
select x.id, substring(y.name,1,30) as [table], substring(x.name,1,30)
as field_name, substring(type_name(x.xusertype),1,20) as type,
convert(int,x.length) as length
from syscolumns x inner join
sysobjects y on x.id = y.id
where (y.type='U')
order by x.id, y.name, x.colid
-- Columns
select * from syscolumns
--Table Field
sp_helpindex s_member_tbl
--# 참고 Sysobjects
select * from sysobjects
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
10 | SQL 인젝션에 이용되는 XP_cmdshell 확장프로시져 삭제 방법 | dhkim | 2008.12.24 | 18516 |
9 | SQL 인젝션 치료용 커서 | dhkim | 2008.12.10 | 15078 |
8 | MS-SQL 개체 소유권 변경 | 레이쩡 | 2008.09.18 | 24883 |
7 | MS SQL 트랜잭션 로그를 줄이는 방법 | 레이쩡 | 2008.09.18 | 21236 |
6 | Microsoft Source Code Analyzer for SQL Injection 관련 자료 | dhkim | 2008.07.25 | 21540 |
5 | MDF파일만 있을 경우 복구하는 방법(SQL2000만 해당) | shpark | 2008.07.07 | 24688 |
4 | SQL Server 인덱스 설정의 효과 | dhkim | 2008.06.27 | 23597 |
3 | tempdb 복구 및 이동 방법 | hostway | 2008.05.15 | 22795 |
2 | 실행중인 Mssql 버젼 확인 | hostway | 2008.05.15 | 25320 |
1 | sql injection 보안 점검 | hostway | 2008.05.14 | 21727 |