开发者

To Update 100 Columns in a single query

开发者 https://www.devze.com 2023-04-05 20:54 出处:网络
I need to update a table which contains more than 100 columns in it. I\'m using an update query to do this. My problem is instead of specifying all the 100 columns in an update query is it possible to

I need to update a table which contains more than 100 columns in it. I'm using an update query to do this. My problem is instead of specifying all the 100 columns in an update query is it possible to update without the column names.

Query:

开发者_如何学Python
Update tbleName set Col1='',Col2='',Col3='',.....Coln='';
commit;

Is there any possibility to update this table columns without specifying 100 columns.

Note:

This table contains more than 120 columns but I need to update 100 columns .

Sorry, I forgot mention this, I need to update first 100 columns only!!!

Thanks in advance!

--Ranga


No you must have to specify which column value you want to modify in update statement.


Considered little application thats reads column names from this table and prepares update query? I think you could even use stored procedures for that.


120 columns? Ouch, that's a pain. You could build up a sql string and just execute it.

0

精彩评论

暂无评论...
验证码 换一张
取 消