In your where clause try the following Where (Isnull(@Handler,'') = '') or Handler = @Handler If the test for @handler = '' then no filter is applied, if @handler has a value then the filter is used. Caveat - many of these in a single query can reduce performance!
Never underestimate the power of human stupidity RAH
This example is based on the AdventureWorks database;
UPDATE HumanResources.Employee
SET Title = 'updateFromView'
WHERE EmployeeID IN (SELECT EmployeeID FROM HumanResources.vEmployee)
The select statement gets a list of ID's in the view. You can then update all the records in the table that have this particular ID. You'll need something to identify each record individually for this to work. If there isn't, then try to add the primary key to the view. If there is no primary key defined in the base-table, add an identity to fullfill this role. Good luck :)
I are troll :)
Thank you for all of your replies, it seems that I have lost all of the data and as you said I have learnt the hard way that we should keep on top of ALL our backups. Thankfully it shouldn't take too long to recreate the tasks, just means by busy couple of months just got a whole lot busier. Thanks again David
your not summing anything to only make one record. It will insert all the records that match your where clause so if it matches more then one will insert more then one record. and please put your code into a code block it makes it easier to read!
You asked this question 2 days ago - did you try what was listed?
Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison
Well, that's entirely up to you, when do you want the query to run ? A button is easiest, as someone else said.
Christian Graus Driven to the arms of OSX by Vista.
Yeah, it would create a connection, but your design is going to cause you problems down the road.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
I guess the web development forum may be the right one. This has nothing to do with the .NET framework ( and I don't know the answer )
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Wat do you mean by VB form, you have a browser control in a VB program ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )