开发者

insert SQL dummy column

开发者 https://www.devze.com 2023-01-02 05:07 出处:网络
HI there.. this is a bit hard to explain so i will show code of the update equivalent .. declare @dummy as int;

HI there..

this is a bit hard to explain so i will show code of the update equivalent ..

   declare @dummy as int;
    UPDATE pages
    SET 
    @dummy = 0
,field ='asdsa' ... etc

because i am writing a code generator it gets messy trying to determine if a comma is needed or not.. i am having this problem with inserts now.. ive tried this dummy approach but doesnt work... 开发者_开发百科is it possible to force an insert into a column that doesnt exist.. the @dummy works for update, so hoping there is a way for insert..

thanks heaps A


No way to do this on INSERT, unless you have a dummy column in each table.

Of course, my question now is why don't you have defaults and/or parametrization and/or use an ORM and/or use reflection-based solutions...

0

精彩评论

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