Can you supply more information? How are you building the query? I doubt
you have this query:
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
in the datafile. What version of SQL Server are you running and what kind
of hardware? What tool are you using to do the insert? Is this just a
stand alone table? Have you checked your transaction log? What is the
recovery model being used? Simple? How fast are your disks? If you send
this as many statements, each statement has to be written to the log before
moving to the next. Adding transactions will really help out the process,
such as (obviously I just repeated your statement over and over, but you get
the point):
BEGIN TRANSACTION
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
COMMIT TRANSACTION
This only requires a single write to the transaction log...
I hope I don't sound like a jerk (I really am not one) but from what I saw
on the SQLite website it is a very compact simple (perhaps one might say
"lite" SQL Engine. SQL Server does have more overhead, but you are correct,
there are definitely setting that can help. Also, check out the SQL
Profiler tool to watch the statements. You can then see how often a command
is sent, which can tell you if the import tool is taking longer or the
inserts themselves.
--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)
Post by BaltDan,
thanks, that was the problem! Removed all quotes around column names, and
now it works.
However, the performance is utterly devastating... the import of one
datafile (around 30'000 records) takes over 3 minutes. If I remove the
indices, it's about 10% less... still 3 minutes. With SQLite, the exact same
process did 30'000 records in 6 seconds (with SQL inserts, no bulk import of
any kind).
Are there any SQL Server settings that might help speed up that process?
Post by Dan GuzmanPost by BaltI tried double quotes, single quotes, with and without the trailing ;,
Have you tried no quotes? IIRC, DBLib defaulted to QUOTED_IDENTIFERS OFF.
Also, see my reply to your other post.
--
Hope this helps.
Dan Guzman
SQL Server MVP
Post by BaltHi all,
INSERT INTO dta ("CH1", "CH2", "CH3", "CH4", "CH5", "Date", "OLSTime",
"Latitude", "Longitude", "Orbit", "Scan") VALUES ( -71.74, 13.36,
34.32, -158.13, 1237.52, 5001, 1007, 1.02, -42.25, 26117, 1);
This statement works fine when executed in SQL Server Management Studio and
inserts the data as expected. When I run that query through
dbcmd/dbsqlexec
from within my C program, i get above error for each and every column
SQL Server Message 207: Invalid column name 'CH1'.
SQL Server Message 207: Invalid column name 'CH2'.
... and so forth, for every column in the table.
I tried double quotes, single quotes, with and without the trailing ;,
executing sp_defaultdb after login so as to make sure we're on the right
database, I also tried specifying the table name as dbo.dta instead of just
dta... all to no avail.
Any ideas anyone??
Thanks!
- balt