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 |
mikedu
Starting Member
9 Posts |
Posted - 2012-06-08 : 15:13:12
|
I have (what should be) simple insert into an error table. If count's from two different tables don't match, I want to insert values. The top portion is fine but I am getting an error on my insert statement. ('incorrect syntax near where') Any ideas? declare @notes integer;declare @sql integer;set @notes = (select COUNT(*) from tblPG_Notes_Validation);set @sql = (select COUNT(*) from tblPG_Sql_Validation);INSERT INTO tblPG_ErrorsVALUES (1, 'Total Count doesnt match', GETDATE())where @notes <> @sql |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
mikedu
Starting Member
9 Posts |
Posted - 2012-06-08 : 15:40:37
|
Thanks tara, the last 2nd option was exactly what I was looking for but couldn't think of....must be a friday afternoon thing... |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|