Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE query

Status
Not open for further replies.

harkness1

Programmer
Mar 23, 2005
1
GB
Hi all,
I need to update a row in a table, but without prior knowledge of the column names. A website somewhere said that it was possible to use wildcards and so i tried the following query:

UPDATE clients SET * = ('tom','jones');

but this returns a syntax error at '*'.

anyone got any ideas? thx for your time

felix
 
not sure this is possible and my guess as to why is that it would be quite dangerous !

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
without prior knowledge of the column names

why do you not have knowledge of the column names...if you can do an update to the table, i'd assume that you could do a select from it as well...

"...we both know I'm training to become a cagefigher...see what happens if you try 'n hit me..."
 
Harkness, the code you gave would simply set every field in the CLIENTS table = to Tom Jones. Is that really what you want to do? You can find out column names by using
Code:
sp_columns TABLENAME
in the query analyzer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top