Thursday, April 02, 2009

Attach database

In MsSQL, a database can attach with system stored procedure sp_attach_db. The simplest way to execute this stored procedure is with this syntax

EXEC sp_attach_db ‘databaseName’, ‘path/to/database/file’

Or if you want to attach more than 1 file use this syntax

EXEC sp_attach_db ‘databaseName’, ‘path/to/database/file/1’ [,‘path/to/database/file/2’] [,‘path/to/database/file/3’]


You can attach database file up to 16 files. The ‘path/to/database/file’ should no more than 260 characters long.

This stored procedure is a shortcut for creating a database with syntax

CREATE DATABASE databaseName ON (FILENAME = ‘/path/to/database/file/1’ [,FILENAME = ‘/path/to/database/file/2’] [FILENAME = ‘/path/to/database/file/3’] […FILENAME = ‘/path/to/database/file/16’]) FOR ATTACH

FOR ATTACH required all data files, and if multiple log files exists, they must be attach to

Tuesday, September 16, 2008

pake clob, bukan varchar2(4000)

aargrgrhhh ....
ketemu lagi kolom yg seharusnya pake clob tapi di definisikan pake
varchar2(4000), ya gak bakalan cukuplah panjang data yg mau di inputkan.

ganti!

ALTER TABLE TABLENAME MODIFY COLUMNNAME CLOB

ALTER TABLE TABLENAME ALTER COLUMN COLUMNNAME

butuh create function di oracle & mssql

huaaahh ...
ternyata ada yg harus di rombak di query programku, gak bisa ditulis
pake coldfusion. jadinya sekarang harus nyari cara buat create function,
kalo gak, gak bakalan bisa sama jumlah yg ditampilkan.

hm ...

Friday, September 05, 2008

install ubuntu 804 alternate di ubuntu 710

setelah beberapa hari mendownload iso ubuntu dari server kambing,http://kambing.ui.edu/pub/ubuntu/ubuntu/8.04/ubuntu-8.04-alternate-i386.iso
ukutan filenya 73096396 byte.

installnya pake innotek VirtualBox lanjutan dari penasaran gak bisa install versi servernya, sekilas udah jalan OK, tp masih mungkin masih perlu tambahan modul2 lain untuk bisa sesuai keinginan.

tujuan pertama installnya sih gara2 penasaran pengen install Oracle di
ubuntu, mungkin dicoba minggu depan, senin atau selasa. install Oracle biar bisa belajar sendiri gak tergantung dari server yg disediakan kantor, berarti installnya Oracle XE.

lebih baik install sendiri trus ya bisa sesuka hati mo diapain, gak akan ada yg ngomel kalo server gagal berjalan normal :p

Loading, Login, Desktop














Wednesday, September 03, 2008

reset nomor identity di MS SQL

cara untuk reset nomor identity di MS SQL menggunakan perintah


DBCC CHECKIDENT (namatable, RESEED, nomoridentity)


contohnya jika kita punya tableA, kita ingin ketika melakukan INSERT, nomor identity menjadi nomor 1


DBCC CHECKIDENT (tableA, RESEED, 0)