473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to build an SQL-string from a record

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

Nov 21 '05 #1
6 886
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
Nov 21 '05 #2
Hi Pieter,

maybe this can be of help (haven't tested it yet)

http://vyaskn.tripod.com/code.htm#inserts

btw I would rather be involved with Stella than with Heineken ;-)

hth Peter


"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:O4**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #3
Hehe it was Jupiler :-)

And tblMyCows is a table in a Database.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #4
Hm thanks, it seems really nice, and just the thing I was looking for :-)

"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:On**************@TK2MSFTNGP09.phx.gbl...
Hi Pieter,

maybe this can be of help (haven't tested it yet)

http://vyaskn.tripod.com/code.htm#inserts

btw I would rather be involved with Stella than with Heineken ;-)

hth Peter


"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:O4**************@TK2MSFTNGP09.phx.gbl...
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


Nov 21 '05 #5
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
Nov 21 '05 #6
Pieter,

Wrong answer (not the jupiler), I have that part from the sample from which
in my opinion you should be able to do the rest yourself, when not, than
reply.

Have a look in this message.
http://groups-beta.google.com/group/...8c5467f8?hl=en

Cor

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scott Auge | last post by:
I created this script to help make zip files for software distributions. It will: -- Create a build number -- Create a VERSION file so people know which build they have -- Update the...
6
by: philipdm | last post by:
I am building a SQL statement that returns a number. when I execute the Built SQL statment EXEC(@Build). What I need to do now is take that number that comes back and store it in another variable...
1
by: MichaelC | last post by:
Hi all, I'm a newbie to SQL and I need help with investigating what ways are possible to build an interface of some sort that wraps around a SQL query script. I have a simple SQL query which...
3
by: Jerry Boone | last post by:
I have a development unit running XP Pro and I cannot get it to build a web project without restarting IIS. There errors in the task list are.... ! Could not copy temporary files to the output...
9
by: Alessandro | last post by:
When I build a setup project under vb2005, starts "Microsoft sql server 2005 Tool" showing "Please wait while windows configures Microsoft sql server 2005 tools" Then it stop with this message:...
0
by: KDB | last post by:
Hi, I would appreciate if anyone can help with this? I have created a couple of .bat files that creates a SQL database and loads data based on files created using the SQL Server 'Generate SQL...
6
by: iKiLL | last post by:
Hi all I am developing in C#, CF2 and SQL Mobile. Currently my app is using Merge Replication. This is all working well. I have now decided to try and use Result sets in my application but I...
3
by: annoir | last post by:
I am trying to create a stored procedure using the DB2 Connect Development Center. I am able to create the project, connect to the remote database on the mainframe and create the stored procedure....
3
by: mnjkahn via AccessMonster.com | last post by:
I'm running Access 2003, modifying a query that has over 45 fields. When I right click on the field name in Query Design View, and then click Build, Access crashes before the Build window...
1
by: okonita | last post by:
Hi all, I have a T-SQL FUNCTION that I am trying to convert to DB2 SQL function. I ran the code through IBM migration Tool but was unable to get a clean conversion. So okay, I ran the code...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.