Inserting records into a table....


Author
Message
StarkMike
StarkMike
StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)
Group: Forum Members
Posts: 436, Visits: 944
I'm importing data from a CSV file. I am reading the file in using TextFieldParser and while I read it in I am building an INSERT sql statement on the fly. Here is what the SQL statement looks like:



INSERT INTO STITagsImport (TagNumber)

SELECT tbl.Expr1 FROM (

SELECT 'ATV0E0' AS Expr1 UNION ALL

SELECT 'ATV0E0' AS Expr1 UNION ALL

SELECT '1180849' AS Expr1 UNION ALL

SELECT 'END' AS Expr1

) AS tbl



The reason I am doing this is because I dont want to make four separate round trips to the database with four separate INSERT statements. I was just wondering if there was a better way.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search