Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
quarinteen
Starting Member
40 Posts |
Posted - 2008-09-24 : 12:11:59
|
| can anyone help me out the following statement bombs..insert into Pcinfo (isvalidnode) values('1') where machineName like '%ws%' |
|
|
bjoerns
Posting Yak Master
154 Posts |
Posted - 2008-09-24 : 12:13:56
|
| Does it nothing? Gives an error message? Deletes Pcinfo table? Blasts the server? |
 |
|
|
nduggan23
Starting Member
42 Posts |
Posted - 2008-09-24 : 12:15:07
|
| You need to provide a table definition to be sure but if isvalidnode is a bit column then remove the '' around 1. otherwise i cant see anything wrong with the statement. |
 |
|
|
quarinteen
Starting Member
40 Posts |
Posted - 2008-09-24 : 12:20:59
|
| no isvalidnode is a varchar max. I get the errorMsg 156, Level 15, State 1, Line 1Incorrect syntax near the keyword 'where'. |
 |
|
|
bjoerns
Posting Yak Master
154 Posts |
Posted - 2008-09-24 : 12:25:13
|
| update Pcinfo set isvalidnode = '1' where machineName like '%ws%'insert inserts a whole row. |
 |
|
|
quarinteen
Starting Member
40 Posts |
Posted - 2008-09-24 : 15:05:56
|
| update Pcinfo set isvalidnode = '1' where machineName like '%ws%' that worked so now how do I select the followingselect * from routerinfo where isvalidnode = nullthis returns nothing although there is several in that column that are null |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-24 : 15:09:16
|
quote: Originally posted by quarinteen update Pcinfo set isvalidnode = '1' where machineName like '%ws%' that worked so now how do I select the followingselect * from routerinfo where isvalidnode = is nullthis returns nothing although there is several in that column that are null
null is not stored as a value so it wont work with comparison operators like =. so use is null for comparison unless you have set ansi nulls settings off. |
 |
|
|
quarinteen
Starting Member
40 Posts |
Posted - 2008-09-24 : 15:16:23
|
| thanks that did it |
 |
|
|
|
|
|