| Author |
Topic |
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-04-11 : 05:58:23
|
| hello sir,i want to pass the null value in table.if i write "NULL"then Blanck value passed.i want to pass NULL world.gayatri |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-04-11 : 06:07:01
|
how are you entering it into the table?declare @t table (col varchar(10))insert into @t select nullunion all select 'null' Em |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-04-11 : 06:39:30
|
| really i don't understand pls again tell me.thanku |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2008-04-11 : 06:42:16
|
quote: Originally posted by Gayatri D.Patil really i don't understand pls again tell me.thanku
Please post the query which is used by you |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-04-11 : 06:43:10
|
| i asked a question of how you are trying to pass this null value into your table.then posted a sample bit of code for you to run to see the difference between passing NULL and a string of 'NULL'Em |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-04-11 : 07:24:56
|
hello sir,siri want UpdatedBy,UpdateDatethese two fields NULL. string[] strAryCols = new string[9]; string[] strAryValues = new string[9]; strAryCols[0] = "IndexCode"; strAryCols[1] = "DescrLong"; strAryCols[2] = "DescrShort"; strAryCols[3] = "CtryCode"; strAryCols[4] = "StatusCode"; strAryCols[5] = "CreatedBy"; strAryCols[6] = "CreatedDateTime"; strAryCols[7] = "UpdatedBy"; strAryCols = "UpdateDateTime"; strAryValues[0] = "" + txtIndexCode.Text + ""; strAryValues[1] = "'" + txtDescrLong.Text + "'"; strAryValues[2] = "'" + txtDescrShort.Text + "'"; strAryValues[3] = "" + cmbCntryCode.SelectedValue + ""; strAryValues[4] = "'" + cmbStatus.Text + "'"; strAryValues[5] = "'" + Environment.UserName.ToString() + "'"; strAryValues[6] = DateTime.Now.ToShortDateString(); strAryValues[7] = "Null"; strAryValues = "Null"; try { int iRow = objDal.funInsert("Asset.tIndexMaster", strAryCols, strAryValues); funFillGrid(); |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-11 : 07:33:39
|
| Remove the double-quotes around NULL.strAryValues[7] = null;strAryValues = null;Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-11 : 09:02:59
|
| Note that NULL is entirely differenct from 'NULL'select case when NULL='NULL' then 'equal' else 'not equal' endMadhivananFailing to plan is Planning to fail |
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-04-14 : 06:12:04
|
quote: Originally posted by harsh_athalye Remove the double-quotes around NULL.strAryValues[7] = null;strAryValues = null;Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
|
 |
|
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-04-14 : 06:13:20
|
| sir,when i remove the double quotes syantax error is come.gayatri |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-14 : 06:20:46
|
| I assume it is C#.Net. What is the error you get? You should write null (all lowercase).Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|