Showing posts with label previous. Show all posts
Showing posts with label previous. 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...

Monday, March 12, 2012

Invalid column name from c# sql query

Hi

I have the following problem. I am trying to get some data from a database which matches the name in a session from a previous page:

e.g.


SqlCommand menubar = new SqlCommand("Select pernme from Person where pernme = " + (string)Session["tbname"], sqlConn);
SqlDataAdapter dataAdapter5 = new SqlDataAdapter();
dataAdapter5.SelectCommand = menubar;
DataSet dataSet5 = new DataSet();
dataAdapter5.Fill(dataSet5);
DataTable selcartest4 = dataSet5.Tables["table"];
if (selcartest4.Rows.Count != 0)

The session is called tbname and in that session is a users name

however insetad of doing the nornal thing and retrieving the data in the sql database table matching that name it comes up with the following error message:

System.Data.SqlClient.SqlException: Invalid column name 'jamie'

this is weird as the 'jamie' is the name in the session from the previous page and in fact not a column name at all the column name is pernme

I am totally stuck any help would eb great thanks

J

Change


SqlCommand menubar = new SqlCommand("Select pernme from Person where pernme = " + (string)Session["tbname"], sqlConn);

To


SqlCommand menubar = new SqlCommand("Select pernme from Person where pernme = '" + (string)Session["tbname"] + "'", sqlConn);

You need to put single quote around string.

|||

Thankyou that work

appreciated!

cheers

Friday, March 9, 2012

Invalid Class String

Hi
This is sort of a repost of my previous posting, but I think the
problem is better explained in this one.
I have a windows 2003 cluster with two machines, SKADB01 and SKADB02.
There are two clusternames that both contain these two machines:
SKABIZCLU (For Microsoft BizTalk Server) and SKADBCLU for SQL Server.
Both are Active/Passive clusters. Usually, the SQL Server cluster runs
on one machine and the BizTalk cluster runs on the other machine.
If SQL Server runs on SKADB02, then everything runs just fine nomatter
which machine BizTalk runs on. There is only one MSDTC ressource and
it is in the BizTalk cluster group. "Enable Network DTC Access" is
installed on both machines.
If SQL Server runs on SKADB01, on the other hand, I seem to be getting
an "Invalid Class String" error when the BizTalk Adapter for SQL
Server is trying to put data into tables.
All I have been able to find on the big Net is that some DTS package
isn't installed, so I should install SQL Server client tools on both
machines. But, as you might have understood, the client tools as well
as the server are installed on both machines. So it must be something
else.
Can anyone help me?
Thanks in advance!
Jan Eliasen, MCP, MVP, MSDN Universal and TechNet
Jan Eliasen, representing himself and not the company he works for.
Hi
This is yet another repost, because I found out that if I signed up
for managed newsgroups at the MSDN site, I am guaranteed an answer
within two businessdays... Quite clever, actually.
So, to Microsoft: If you have any ideas about my below mentioned
problem, please let me know.
Jan Eliasen
On Fri, 27 Aug 2004 11:08:10 +0200, Jan Eliasen <spam@.eliasen.dk>
wrote:

>Hi
>This is sort of a repost of my previous posting, but I think the
>problem is better explained in this one.
>I have a windows 2003 cluster with two machines, SKADB01 and SKADB02.
>There are two clusternames that both contain these two machines:
>SKABIZCLU (For Microsoft BizTalk Server) and SKADBCLU for SQL Server.
>Both are Active/Passive clusters. Usually, the SQL Server cluster runs
>on one machine and the BizTalk cluster runs on the other machine.
>If SQL Server runs on SKADB02, then everything runs just fine nomatter
>which machine BizTalk runs on. There is only one MSDTC ressource and
>it is in the BizTalk cluster group. "Enable Network DTC Access" is
>installed on both machines.
>If SQL Server runs on SKADB01, on the other hand, I seem to be getting
>an "Invalid Class String" error when the BizTalk Adapter for SQL
>Server is trying to put data into tables.
>All I have been able to find on the big Net is that some DTS package
>isn't installed, so I should install SQL Server client tools on both
>machines. But, as you might have understood, the client tools as well
>as the server are installed on both machines. So it must be something
>else.
>Can anyone help me?
>Thanks in advance!
>Jan Eliasen, MCP, MVP, MSDN Universal and TechNet
Jan Eliasen, representing himself and not the company he works for.
|||Except that I don't think that this is a managed newsgroup. I don't see this
one listed under Enterprise Development/SQL Server on
http://msdn.microsoft.com/newsgroups/managed/. In addition to that, I
believe that the first post in the thread has to come from an MSDN
registered email address so even if there were MSDN engineers in here, they
probably wouldn't find this thread.
And finally, I'm sorry but I don't know the answer to your question. Please
email your MVP Lead and ask John to open a support case for you.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jan Eliasen" <eliasen@.nospam.nospam> wrote in message
news:t2n5j0ll6s8en07jv0h6arbjq2m9j4jjgd@.4ax.com...
> Hi
> This is yet another repost, because I found out that if I signed up
> for managed newsgroups at the MSDN site, I am guaranteed an answer
> within two businessdays... Quite clever, actually.
> So, to Microsoft: If you have any ideas about my below mentioned
> problem, please let me know.
> Jan Eliasen
> On Fri, 27 Aug 2004 11:08:10 +0200, Jan Eliasen <spam@.eliasen.dk>
> wrote:
>
> --
> Jan Eliasen, representing himself and not the company he works for.
|||Hi
Thank you for your answer.
I have failed to find a list of managed newsgroups - the link you
provided seems to be to a page where I can search in the managed
newsgroups?!?
Jan Eliasen
On Mon, 30 Aug 2004 09:11:54 -0700, "Stephen Dybing [MSFT]"
<stephd@.online.microsoft.com> wrote:

>Except that I don't think that this is a managed newsgroup. I don't see this
>one listed under Enterprise Development/SQL Server on
>http://msdn.microsoft.com/newsgroups/managed/. In addition to that, I
>believe that the first post in the thread has to come from an MSDN
>registered email address so even if there were MSDN engineers in here, they
>probably wouldn't find this thread.
>And finally, I'm sorry but I don't know the answer to your question. Please
>email your MVP Lead and ask John to open a support case for you.
Jan Eliasen, representing himself and not the company he works for.
|||Not sure whether this is off-track..
I followed the link to the managed news groups provided by Steven and
searched for "Invalid Class String" against ALL categories. If found this
series of posts! It therefore appears that the "managed" newsgroups are
probably super-sets made up of news groups such as
"microsoft.public.sqlserver.clustering".
Griff
|||I don't know if there is a simple list of the managed newsgroups. I seem to
recall one at some point, but I can't find it either. However, that page
that I sent you, http://msdn.microsoft.com/newsgroups/managed/, has all the
SQL Server managed newsgroups listed. Hover over Enterprise Development in
the left navigation pane, then hover over SQL Server when it expands. The
resultant list shows the 13 SQL Server managed newsgroups. I don't see
..clustering listed. I'll go check with the MSDN folks to make sure, but I
think that's all there is. We're in the process of adding .reportingsvcs to
that list, but it's not finalized yet.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jan Eliasen" <eliasen@.nospam.nospam> wrote in message
news:0um8j0p66ns38fvabkrcak7p59b83re17c@.4ax.com...
> Hi
> Thank you for your answer.
> I have failed to find a list of managed newsgroups - the link you
> provided seems to be to a page where I can search in the managed
> newsgroups?!?
> Jan Eliasen
> On Mon, 30 Aug 2004 09:11:54 -0700, "Stephen Dybing [MSFT]"
> <stephd@.online.microsoft.com> wrote:
>
> --
> Jan Eliasen, representing himself and not the company he works for.
|||I suspect that the web interface simply isn't smart enough to not query the
unmanaged newsgroups as well, but I'll go check.
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Griff" <Howling@.The.Moon> wrote in message
news:OFAS3b1jEHA.2764@.TK2MSFTNGP11.phx.gbl...
> Not sure whether this is off-track..
> I followed the link to the managed news groups provided by Steven and
> searched for "Invalid Class String" against ALL categories. If found this
> series of posts! It therefore appears that the "managed" newsgroups are
> probably super-sets made up of news groups such as
> "microsoft.public.sqlserver.clustering".
> Griff
>
|||OK, I've confirmed that this is an unmanaged newsgroup. Here is the list of
all SQL Server managed newsgroups:
microsoft.public.sqlserver.clients
microsoft.public.sqlserver.connect
microsoft.public.sqlserver.datawarehouse
microsoft.public.sqlserver.dts
microsoft.public.sqlserver.mseq
microsoft.public.sqlserver.odbc
microsoft.public.sqlserver.olap
microsoft.public.sqlserver.programming
microsoft.public.sqlserver.replication
microsoft.public.sqlserver.security
microsoft.public.sqlserver.server
microsoft.public.sqlserver.setup
microsoft.public.sqlserver.tools
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
news:uyHBr52jEHA.3884@.TK2MSFTNGP10.phx.gbl...
>I don't know if there is a simple list of the managed newsgroups. I seem to
>recall one at some point, but I can't find it either. However, that page
>that I sent you, http://msdn.microsoft.com/newsgroups/managed/, has all the
>SQL Server managed newsgroups listed. Hover over Enterprise Development in
>the left navigation pane, then hover over SQL Server when it expands. The
>resultant list shows the 13 SQL Server managed newsgroups. I don't see
>.clustering listed. I'll go check with the MSDN folks to make sure, but I
>think that's all there is. We're in the process of adding .reportingsvcs to
>that list, but it's not finalized yet.
> --
> Sincerely,
> Stephen Dybing
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Jan Eliasen" <eliasen@.nospam.nospam> wrote in message
> news:0um8j0p66ns38fvabkrcak7p59b83re17c@.4ax.com...
>
|||Yep, we've filed a bug on the fact that even though you specify to search in
the managed newsgroups it searches all of them. Oops...
Sincerely,
Stephen Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Dybing [MSFT]" <stephd@.online.microsoft.com> wrote in message
news:Oi7YB62jEHA.632@.TK2MSFTNGP12.phx.gbl...
>I suspect that the web interface simply isn't smart enough to not query the
>unmanaged newsgroups as well, but I'll go check.
> --
> Sincerely,
> Stephen Dybing
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Griff" <Howling@.The.Moon> wrote in message
> news:OFAS3b1jEHA.2764@.TK2MSFTNGP11.phx.gbl...
>