473,503 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 21 '05 #1
6 1558
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
Jul 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

Jul 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

Jul 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


Jul 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
Jul 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

Jul 21 '05 #7

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

Similar topics

0
1138
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
3268
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
2750
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
1885
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
3083
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
4367
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
2137
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
4190
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
7746
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
2150
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
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.