Viewing 15 posts - 14,446 through 14,460 (of 15,381 total)
kramaswamy (7/12/2011)
SELECT @Result1 = (SELECT ROUND(MAX(Value),1)
FROM History
WHERE TagName = @Tag_Name
AND DateTime >= @StartDate
AND DateTime <= @EndDate);
Also, your query is dangerously constructed. There's no guarantee that you will have only one...
July 12, 2011 at 7:23 am
Well there is no way on this planet i would try to upgrade sql server versions at the same time I have to restructure anything. It does sound like the...
July 11, 2011 at 9:01 am
Presumably all of these other procedures are returning results you want? Just create a temp table and insert you exec statements.
create table #blah
(
...columns...
)
insert #blah
exec MyProc
insert #blah
exec MyOtherProc
That...
July 11, 2011 at 8:42 am
And nobody mentioned....AWESOME JOB providing details, ddl, sample data...all the things required to make it easy for everybody to help. We all say it until we are blue in the...
July 1, 2011 at 1:11 pm
Feel free to post back if you get into a bind. There are a zillion things you can do that will truly shock you for a set based solution. Often...
July 1, 2011 at 10:12 am
The point that Dixie and Jeff are trying to make is that loops and cursors can almost always be avoided and replaced with a MUCH MUCH MUCH faster set based...
July 1, 2011 at 9:40 am
Well...This is pretty much what I always thought it originated from.
July 1, 2011 at 7:32 am
Good point Elliot. It certainly a train wreck and the rewrite would not only be legible, it would be functional too.
June 30, 2011 at 2:06 pm
The problem is that this will never work for an insert. This is checking if @actionType <> @ACTIONTYPEUPDATE. @ACTIONTYPEUPDATE is declared as a bit but is never set. Thus it...
June 30, 2011 at 1:50 pm
June 30, 2011 at 10:05 am
forgot to mention that his assumes only a single schema. If you have multiple schemas you will need to tweak this a bit to accomodate.
June 30, 2011 at 9:49 am
You commented out the line that set @sSQL. You also commented out the the so.type = 'U' in the cursor declaration. This second one won't actually cause any problems but...
June 30, 2011 at 9:45 am
If you want to search every column without a filter just remove the "where sc.name like @ColName" in the cursor defintion. With the way you have it you are only...
June 30, 2011 at 8:58 am
Here is some code that I wrote several years ago to search every field in every table on a given database. It is not pretty and it is NOT FAST!!!!...
June 30, 2011 at 8:29 am
Viewing 15 posts - 14,446 through 14,460 (of 15,381 total)