How to build an SQL-string from a record

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I need a solution for this in SQL Server, or in VB.NET, so for this reason I
posted it to the 2 newsgroups.

I need to build an SQL String from a given record.
For exemple: I have in my table tblMyCows this record:
CowID: 1
CowName: Bella (a typical Belgian cowname)
CowGender: Female

I should have something that generates me the Insert-statement for it: like
this: "INSERT INTO tblMyCows (CowID, CowName, CowGender) VALUES (1, 'Bella',
'Female')".

If possible the same with an update an delete statement, and it would be
really nice if it could detect itself the primary keys, and use them for for
the update and Delete statements.

Anybody any idea?

Thanks a lot in advance,

Pieter
 
Pieter,

Do you now need Bella because you was yesterday to much involved with
Stella.
I count 4 newsgroups, not 2.

However your problem sounds not difficult for me, what I not direct see, is
if the tblMycows is a datatable or that it is a table in a database?

Cor
 
Pieter,
Hehe it was Jupiler :-)

You don't believe it, that was what I wrote first.
However Bella and Stella did sound better.

:-)

I have no sample at hand I will try to make it (I don't promish I succeed),
than probably I show it tomorrow. (I have the other way around).

Cor
 
Back
Top