Showing posts with label basically. Show all posts
Showing posts with label basically. Show all posts

Friday, March 23, 2012

Invalid object name sp_totHotelDailyAdviceMASundays.

Please ignore my previous thread.
Basically I have 'sp_totHotelDailyAdviceMASundays' which calls 'sp_rptHotelMonthlyInvoiceSundays' which uses fn_rptHotelDailyDetailsMASundays.

I am now getting the following error when I run the top most sp; 'sp_totHotelDailyAdviceMASundays':

Server: Msg 208, Level 16, State 3, Procedure sp_rptHotelMonthlyInvoiceSundays, Line 3
Invalid object name 'sp_totHotelDailyAdviceMASundays'.

1) The top most sp is:
CREATE PROCEDURE dbo.sp_rptHotelMonthlyInvoiceSundays (@.aDate datetime) AS
SELECT Firms.FirmID, sp_totHotelDailyAdviceMASundays.AccountTypeID, AccountTypes.AccountType, Firms.CompanyTypeID,
Firms.InvoiceAddressee, Firms.InvoiceAddresseeEMailAdd,
Firms.CommissionAdviceAddressee, Firms.CommissionAdviceAddresseeEMailAdd, Firms.[Firm Name], Firms.Address,
Firms.Town, Firms.PostCode, sp_totHotelDailyAdviceMASundays.FirmID1,
sp_totHotelDailyAdviceMASundays.SumOfInvoiceSubTotal, sp_totHotelDailyAdviceMASundays.SumOfOrderDiscountAmount,
sp_totHotelDailyAdviceMASundays.SumOfInvoiceTotal, sp_totHotelDailyAdviceMASundays.SumOfInvoiceVatElement, sp_totHotelDailyAdviceMASundays.CustomerTypeID,
sp_totHotelDailyAdviceMASundays.SumOfNotFinalised
--vw_totHotelDailyAdviceMASundays.[Taken Date]
FROM Firms INNER JOIN (AccountTypes INNER JOIN sp_totHotelDailyAdviceMASundays (@.aDate) ON AccountTypes.AccountTypeID =
sp_totHotelDailyAdviceMASundays.AccountTypeID) ON
Firms.FirmID = sp_totHotelDailyAdviceMASundays.FirmID1
WHERE (((Firms.CompanyTypeID)=8))
GO

2) sp_totHotelDailyAdviceMASundays, which is used in (1), above:
CREATE PROCEDURE [dbo].[sp_totHotelDailyAdviceMASundays] (@.aDate DateTime) AS
SELECT FirmID1, OfficeSiteID,[Office Site Name], Sum(OrderDiscountAmount) AS SumOfOrderDiscountAmount, Sum(InvoiceTotal) AS SumOfInvoiceTotal,
Sum(InvoiceVatElement) AS SumOfInvoiceVatElement
FROM fn_rptHotelDailyDetailsMASundays (@.aDate)
GROUP BY FirmID1, OfficeSiteID,[Office Site Name]
GO

3) fn_rptHotelDailyDetailsMASundays, is a udf used in (2), above.
CREATE FUNCTION fn_rptHotelDailyDetailsMASundays ( @.aDate datetime)
RETURNS TABLE
AS
RETURN
( SELECT Firms.FirmID AS FirmID1, [Office Sites].OfficeSiteID, ......
FROM ((Firms INNER JOIN [Office Sites] ON .......
WHERE ( ((DATEPART(Month,[TakenDate]))=DATEPART(Month,@.aDate) ) AND ((DAtEPART(Year,[TakenDate]))=DATEPART(Year,@.aDate)) AND
(DATEPART(dw, [TakenDate])=1) AND .......

Both (2) and (3) work fine.

The above error occours when I execute (1) like so:
dbo.sp_rptHotelMonthlyInvoiceSundays '3/3/04'

Note that the date parameter, aDate, is passed on from (1) to (2) to (3), the udf and is
only used in the udf's where clause and is never used in (1) or (2).

Thank you in advance again.check my reply for the other post...

Sunday, February 19, 2012

Interpreting SQLIO Results... What Now?

Hi all, I ran SQLIO against my SAN and got back some discouraging results.
It basically seemns to point to optimal performance settings of 64KB I/O's
and 4096 KB Stripes. My question is this: how do I ensure that Windows and
SQL Server 2K use these settings? Is there something that needs to be set
in the registry or do I need to modify settings in SQL, or what?
Thanks
P.S. - We got even better results when we set the Buffering option to "All".
How can we make sure Windows, SQL, et al. are using the same options that
SQLIO used?
Thanks
"Michael C#" <xyz@.yomomma.com> wrote in message
news:ODOA5mMKFHA.3916@.TK2MSFTNGP14.phx.gbl...
> Hi all, I ran SQLIO against my SAN and got back some discouraging results.
> It basically seemns to point to optimal performance settings of 64KB I/O's
> and 4096 KB Stripes. My question is this: how do I ensure that Windows
> and SQL Server 2K use these settings? Is there something that needs to be
> set in the registry or do I need to modify settings in SQL, or what?
> Thanks
>