database/mssql

쿼리문만들기 - insert

labj 2012. 3. 22. 01:01

쿼리문만들기 - insert

 

select
'INSERT INTO ROOMCODE ( ROOMNO,NAME,EN_NAME,FLOOR,LIBNO,BOOKABLE,OPEN_TYPE,'+
'USER_POS,USER_STATUS,MAX_USE_CNT,APPLY_QUOTA,DEF_USE_MIN,'+
'MAX_USE_MIN,CAN_EXTEND_TIME,MAX_EXTEND_MIN,MAX_EXTEND_CNT,MAX_BOOK_CNT,'+
'MIN_SEAT_MIN,MAX_SEAT_EACH_MIN,RSV_BREAK_CHK,ALL_DAY_RESERVE,'+
'ALL_DAY_ASSIGN,USE_RESERVE_PERIOD) values ('+
convert(varchar,ROOMNO            )+',',
'$'+NAME+'$,',
'$'+EN_NAME+'$,',
convert(varchar,FLOOR             )+',',
convert(varchar,LIBNO             )+',',
convert(varchar,BOOKABLE          )+',',
convert(varchar,OPEN_TYPE         )+',',
'$'+USER_POS+'$,',
'$'+USER_STATUS+'$,',
convert(varchar,MAX_USE_CNT       )+',',
convert(varchar,APPLY_QUOTA       )+',',
convert(varchar,DEF_USE_MIN       )+',',
convert(varchar,MAX_USE_MIN       )+',',
convert(varchar,CAN_EXTEND_TIME   )+',',
convert(varchar,MAX_EXTEND_MIN    )+',',
convert(varchar,MAX_EXTEND_CNT    )+',',
convert(varchar,MAX_BOOK_CNT      )+',',
convert(varchar,MIN_SEAT_MIN      )+',',
convert(varchar,MAX_SEAT_EACH_MIN )+',',
convert(varchar,RSV_BREAK_CHK     )+',',
convert(varchar,ALL_DAY_RESERVE   )+',',
convert(varchar,ALL_DAY_ASSIGN    )+',',
convert(varchar,USE_RESERVE_PERIOD)+');'
from roomcode;


'database > mssql' 카테고리의 다른 글

MSSQL 2005 Express 설정 변경  (0) 2012.03.22
0 붙이기  (2) 2012.03.22
시간별예약현황 달력형태  (0) 2012.03.22
Microsoft SQL Server 2005 에서 MSDE로 Database 옮기기  (0) 2012.03.22
Log file Delete  (0) 2012.03.22