03. April 2010 · Comments Off on Bearing Clearances and Dry Sumps · Categories: T-SQL
We have built a race engine. It’s a 2jz-gte supra 3 liters engine and we have applied a dry sump kit.
We are actually using a peterson gerotor 3 stages pump rated at 18/20gpm (at how many rpms?)
We have a 5 gal tank in the trunk and a -16an line going to the pump and -12an line pumping oil inside the engine.
2 scavenging lines keeps the tank always at at least 2/3 of the level.
Here is the problem:
hot oil, idle 1600rpms, 28psi of oil pressure.
everything is ok so far.
Increasing the engine rpms we see an incease in flow and pressure. We are actually using evne a flow meter gauge.
Everything is ok up to about 6k rpms engine speed where we have about 117psi of pressure and 16gpm of oil flow.
At this point we have problems:
keeping the engine STEADY at 6k rpms we start to see a drop of oil pressure BUT NOT a drop in flow and this could be caused MAYBE by the increasing of oil temperature and loss of oil viscosity.
If we increase the engine rpms we have an even more accentuated loss of oil pressure but still absolutely no loss of oil flow.
03. April 2010 · Comments Off on Paging Data with a webservice · Categories: T-SQL · Tags: ,
What I found was that it took lots of searching till I found this page of various implementations.
http://databases.aspfaq.com/database/how-do-i-page-through-a-recordset.html
Turns out the rowcount one works perfect for my need to access a 6.5 compatibility mode database. (no top functionality).
Here is how I implemented that in the stored procedure (Webservice implementation perhaps later):
CREATE    PROCEDURE spimCounts_FetchRowsByGun_xxx (@gunid char(10), @iPageNum int = 1, @iPerPage int = 10)

AS

begin
set nocount on
DECLARE @ubound INT, @lbound INT, @pages INT, @rows INT
declare @iGunId char(10), @PageNum int, @PerPage int
declare @entrytime datetime
-- Reassign passed parameters to
-- help prevent parameter sniffing performance issues.
select @iGunID = @gunID
select @PageNum = @iPageNum, @PerPage = @iPerPage
-- Find the number of rows to work with and number of pages
SELECT
@rows = COUNT(*),
@pages = COUNT(*) / @perpage
FROM
timItemCounts_csi WITH (NOLOCK)
where gunid = @gunid
IF @rows % @perpage != 0 SET @pages = @pages + 1
IF @pagenum  @pages SET @pagenum = @pages
SET @ubound = @perpage * @pagenum
SET @lbound = @ubound - (@perpage - 1)
SELECT
CurrentPage = @pagenum,
TotalPages = @pages,
TotalRows = @rows
SET ROWCOUNT @lbound
SELECT
@entrytime = entrytime
FROM
timItemCounts_csi WITH (NOLOCK)
where gunid = @gunid
ORDER BY
entrytime desc
SET ROWCOUNT @perPage
SELECT  entryid, LocationID as 'LocID', ItemID, UPCID, Qty, EntryTime as 'Entry'
FROM timItemCounts_csi WITH (NOLOCK)
WHERE gunid = @gunid
and entrytime
end

What I found was that it took lots of searching till I found this page of various implementations.http://databases.aspfaq.com/database/how-do-i-page-through-a-recordset.html

Turns out the rowcount one works perfect for my need to access a 6.5 compatibility mode database. (no top functionality).
Here is how I implemented that in the stored procedure (Webservice implementation perhaps later):
CREATE    PROCEDURE spimCounts_FetchRowsByGun_xxx (@gunid char(10), @iPageNum int = 1, @iPerPage int = 10)ASbegin set nocount on
DECLARE @ubound INT, @lbound INT, @pages INT, @rows INT  declare @iGunId char(10), @PageNum int, @PerPage int declare @entrytime datetime
-- Reassign passed parameters to  -- help prevent parameter sniffing performance issues. select @iGunID = @gunID select @PageNum = @iPageNum, @PerPage = @iPerPage

-- Find the number of rows to work with and number of pages    SELECT         @rows = COUNT(*),         @pages = COUNT(*) / @perpage     FROM         timItemCounts_csi WITH (NOLOCK) where gunid = @gunid
IF @rows % @perpage != 0 SET @pages = @pages + 1     IF @pagenum  @pages SET @pagenum = @pages      SET @ubound = @perpage * @pagenum      SET @lbound = @ubound - (@perpage - 1)       SELECT         CurrentPage = @pagenum,         TotalPages = @pages,         TotalRows = @rows
SET ROWCOUNT @lbound
SELECT         @entrytime = entrytime    FROM         timItemCounts_csi WITH (NOLOCK)  where gunid = @gunid    ORDER BY  entrytime desc     SET ROWCOUNT @perPage      SELECT  entryid, LocationID as 'LocID', ItemID, UPCID, Qty, EntryTime as 'Entry'    FROM timItemCounts_csi WITH (NOLOCK)     WHERE gunid = @gunid and entrytime end