W
will~
Excel 2003 SP3 on Windows XP SP2
I have problem when trying to construct an SQL Insert statement using the
CONCATENATE function in Excel. There are over 50 fields.
I would like to construct an SQL insert statement from tables stored in
Excel to be used to populate tables in a SQL database. Using the CONCATENATE
function below I ends up with a complete SQL insert statement
=CONCATENATE("INSERT INTO Product (Field1,Field2,Field3,Field4,Field5)
VALUES ('",B2,"','",C2,"',",D2,",",E2,",",F2,")")
When I try to do the same for a large table (> 50 fields). I have the
following error in Excel ("The formula you typed contains an error").
Reading through the forum Excel sees to have a limit of 30 strings for the
CONCATENATE function.
However, the concatenate function only allow me to enter 14 fields. There
seems to be some sort of limits in total characters within concatenate
function (when I shorten some of the field names i.e. to F1, F2, F3 I could
enter more fields)
Please could you advice how I could maybe do multiple CONCATENATE. For
example, concatenate the first 30 strings, then concatenate the result of
that with the remaining 20 strings, etc?
Many thanks in advance,
I have problem when trying to construct an SQL Insert statement using the
CONCATENATE function in Excel. There are over 50 fields.
I would like to construct an SQL insert statement from tables stored in
Excel to be used to populate tables in a SQL database. Using the CONCATENATE
function below I ends up with a complete SQL insert statement
=CONCATENATE("INSERT INTO Product (Field1,Field2,Field3,Field4,Field5)
VALUES ('",B2,"','",C2,"',",D2,",",E2,",",F2,")")
When I try to do the same for a large table (> 50 fields). I have the
following error in Excel ("The formula you typed contains an error").
Reading through the forum Excel sees to have a limit of 30 strings for the
CONCATENATE function.
However, the concatenate function only allow me to enter 14 fields. There
seems to be some sort of limits in total characters within concatenate
function (when I shorten some of the field names i.e. to F1, F2, F3 I could
enter more fields)
Please could you advice how I could maybe do multiple CONCATENATE. For
example, concatenate the first 30 strings, then concatenate the result of
that with the remaining 20 strings, etc?
Many thanks in advance,