ajaypappan
asked on
procedure for bulk insert
how can i write a procedure to do bulk insert into a table. What i am trying to achieve is to do some sort of automatic process like the procedure should pick up file from k:\folder and update the table..can anyone help me in this issue
ASKER
The fields in file are delimited by inverted comma..
name of file: APAPORD1.txt
tablename: OrderOct2004
fields:account
division
name
opendate
salsid
salesman
location
calltype
wtnnum
btnno
provider
ringto
circuit
firstcall
lastcall
canceldate
loadate
entrydate
est_usage
inter_stat
inter_date
inter_mess
inter_actn
inter_corr
intra_stat
intra_date
intra_mess
intra_actn
intra_corr
cable
lec_stat
lec_mess
name of file: APAPORD1.txt
tablename: OrderOct2004
fields:account
division
name
opendate
salsid
salesman
location
calltype
wtnnum
btnno
provider
ringto
circuit
firstcall
lastcall
canceldate
loadate
entrydate
est_usage
inter_stat
inter_date
inter_mess
inter_actn
inter_corr
intra_stat
intra_date
intra_mess
intra_actn
intra_corr
cable
lec_stat
lec_mess
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
there are two field in the table that are date fields will the string automatically convert to date field?
Sql will attempt to match the format of the field.
ASKER
what is this warning I am gettin when i try to create a table?
Warning: The table 'OrderOct2004Ex' has been created but its maximum row size (12356) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
Warning: The table 'OrderOct2004Ex' has been created but its maximum row size (12356) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
Are you using a large amount of TEXT or IMAGE fields ?
ASKER
yes i do..
ASKER
but this message i got when i created a table..
TEXT and IMAGE are very large datatypes, especially in comparison to the other ones. do you HAVE to use them ? text is for storing large amounts of data, image is for actual images.
Instead of TEXT, consider varchar.
Instead of TEXT, consider varchar.
ASKER
Thanks buddy for all your help....
What's the name of the file and table/columns being inserted into ?