Friday, March 16, 2012

Parameterized Queries

I was wondering about this. If I have a parameterized query such as the following

Insert into table (column1, column2, column3) values (@dotnet.itags.org.c1, @dotnet.itags.org.c2, @dotnet.itags.org.c3)

and I only specify one parameter, say c1 only, would column2 and column 3 be overwritten with null values or left as they are?

would this even work?Well you haven't said what database you are using but sql server/msde would give an error of parameter missing.
True - - if you include parameters in the values list, you must define those parameters - - otherwise, you will get an error.
yeah thanks i realised. I'm using sql server by the way. It would be nice if I could define a query then only update the new fields by using P queries though.....

0 comments:

Post a Comment