July 21, 2011 at 1:28 pm
I am executing the below query, it is coming up with SQL inbound error. Can SQL gurus please help, what is wrong in this query
SELECT sep5.V_ALERTS.ALERT_IDX, V_SEM_COMPUTER.IP_ADDR1_TEXT, V_SEM_COMPUTER.COMPUTER_NAME, V_SEM_COMPUTER.COMPUTER_DOMAIN_NAME,
sep5.V_ALERTS.USER_NAME, sep5.V_ALERTS.SOURCE_COMPUTER_NAME, sep5.V_ALERTS.SOURCE_COMPUTER_IP_TEXT, sep5.V_ALERTS.SOURCE, sep5.V_ALERTS.VIRUSNAME_IDX,
sep5.V_ALERTS.ALERT_IDX, sep5.V_ALERTS.ACTUALACTION_IDX, sep5.V_ALERTS.REQUESTEDACTION_IDX AS REQUESTEDACTION, sep5.V_ALERTS.ALERTDATETIME,
sep5.V_ALERTS.ALERTINSERTTIME, sep5.V_ALERTS.ALERTENDDATETIME, sep5.V_ALERTS.NOOFVIRUSES, sep5.V_ALERTS.FILEPATH, sep5.V_ALERTS.DESCRIPTION
from sep5.V_ALERTS, sep5.V_SEM_COMPUTER
left outer join sep5.VIRUS on VIRUSNAME_IDX= sep5.V_ALERTS.VIRUSNAME_IDX
left outer join sep5.V_SEM_COMPUTER s4 on sep5.V_ALERTS.COMPUTER_IDX = s4.V_SEM_COMPUTER.COMPUTER_ID
left outer join sep5.ACTUALACTION S6 on sep5.V_ALERTS.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on sep5.V_ALERTS.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join ALERTMSG on sep5.V_ALERTS.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '07/01/2001'
July 21, 2011 at 1:31 pm
gopalchalla (7/21/2011)
I am executing the below query, it is coming up with SQL inbound error. Can SQL gurus please help, what is wrong in this querySELECT sep5.V_ALERTS.ALERT_IDX, V_SEM_COMPUTER.IP_ADDR1_TEXT, V_SEM_COMPUTER.COMPUTER_NAME, V_SEM_COMPUTER.COMPUTER_DOMAIN_NAME,
sep5.V_ALERTS.USER_NAME, sep5.V_ALERTS.SOURCE_COMPUTER_NAME, sep5.V_ALERTS.SOURCE_COMPUTER_IP_TEXT, sep5.V_ALERTS.SOURCE, sep5.V_ALERTS.VIRUSNAME_IDX,
sep5.V_ALERTS.ALERT_IDX, sep5.V_ALERTS.ACTUALACTION_IDX, sep5.V_ALERTS.REQUESTEDACTION_IDX AS REQUESTEDACTION, sep5.V_ALERTS.ALERTDATETIME,
sep5.V_ALERTS.ALERTINSERTTIME, sep5.V_ALERTS.ALERTENDDATETIME, sep5.V_ALERTS.NOOFVIRUSES, sep5.V_ALERTS.FILEPATH, sep5.V_ALERTS.DESCRIPTION
from sep5.V_ALERTS, sep5.V_SEM_COMPUTER
left outer join sep5.VIRUS on VIRUSNAME_IDX= sep5.V_ALERTS.VIRUSNAME_IDX
left outer join sep5.V_SEM_COMPUTER s4 on sep5.V_ALERTS.COMPUTER_IDX = s4.V_SEM_COMPUTER.COMPUTER_ID
left outer join sep5.ACTUALACTION S6 on sep5.V_ALERTS.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on sep5.V_ALERTS.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join ALERTMSG on sep5.V_ALERTS.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '07/01/2001'
Those upper case columns are easy on the eyes. 😀
Could you click on the first link below and post again?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 21, 2011 at 1:35 pm
you'll have to explain what the actual error message is...i cannot think of what an "inbound error" might be.
your query doesn't join sep5.V_ALERTS ti sep5,V_SEM_COMPUTER...so that's an ugly cross join that's not obvious due to teh syntax...you mixed old syle joins with new.
this should be the same query: is there a missing join between those two tables?
SELECT
sep5.V_ALERTS.ALERT_IDX,
V_SEM_COMPUTER.IP_ADDR1_TEXT,
V_SEM_COMPUTER.COMPUTER_NAME,
V_SEM_COMPUTER.COMPUTER_DOMAIN_NAME,
sep5.V_ALERTS.USER_NAME,
sep5.V_ALERTS.SOURCE_COMPUTER_NAME,
sep5.V_ALERTS.SOURCE_COMPUTER_IP_TEXT,
sep5.V_ALERTS.SOURCE,
sep5.V_ALERTS.VIRUSNAME_IDX,
sep5.V_ALERTS.ALERT_IDX,
sep5.V_ALERTS.ACTUALACTION_IDX,
sep5.V_ALERTS.REQUESTEDACTION_IDX AS REQUESTEDACTION,
sep5.V_ALERTS.ALERTDATETIME,
sep5.V_ALERTS.ALERTINSERTTIME,
sep5.V_ALERTS.ALERTENDDATETIME,
sep5.V_ALERTS.NOOFVIRUSES,
sep5.V_ALERTS.FILEPATH,
sep5.V_ALERTS.DESCRIPTION
from sep5.V_ALERTS
CROSS JOIN sep5.V_SEM_COMPUTER
left outer join sep5.VIRUS on VIRUSNAME_IDX = sep5.V_ALERTS.VIRUSNAME_IDX
left outer join sep5.V_SEM_COMPUTER s4 on sep5.V_ALERTS.COMPUTER_IDX = s4.V_SEM_COMPUTER.COMPUTER_ID
left outer join sep5.ACTUALACTION S6 on sep5.V_ALERTS.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on sep5.V_ALERTS.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join ALERTMSG on sep5.V_ALERTS.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '07/01/2001'
Lowell
July 21, 2011 at 1:41 pm
I agree that the all upper case makes reading this slightly less painful than removing your own eyeballs and wiping them off with sandpaper and vinegar.
There are two major problems i see in your code.
First you have a cross join on the first two tables.
from sep5.V_ALERTS, sep5.V_SEM_COMPUTER
Then in your where clause you are referencing a table that doesn't exist in the query.
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '07/01/2001'
I think you really want something like this.
WHERE sep5.V_ALERTS.ALERTENDDATETIME > '07/01/2001'
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 21, 2011 at 1:42 pm
I am getting the below error.
The multi-part identifier "sep5.V_ALERTS.VIRUSNAME_IDX" could not be bound.
Msg 4104, Level 16, State 1, Line 8
The multi-part identifier "sep5.V_ALERTS.COMPUTER_IDX" could not be bound.
Msg 207, Level 16, State 1, Line 8
Invalid column name 'V_SEM_COMPUTER'.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "sep5.V_ALERTS.ACTUALACTION_IDX" could not be bound.
Msg 4104, Level 16, State 1, Line 10
The multi-part identifier "sep5.V_ALERTS.REQUESTEDACTION_IDX" could not be bound.
July 21, 2011 at 1:45 pm
gopalchalla (7/21/2011)
I am getting the below error.The multi-part identifier "sep5.V_ALERTS.VIRUSNAME_IDX" could not be bound.
Msg 4104, Level 16, State 1, Line 8
The multi-part identifier "sep5.V_ALERTS.COMPUTER_IDX" could not be bound.
Msg 207, Level 16, State 1, Line 8
Invalid column name 'V_SEM_COMPUTER'.
Msg 4104, Level 16, State 1, Line 9
The multi-part identifier "sep5.V_ALERTS.ACTUALACTION_IDX" could not be bound.
Msg 4104, Level 16, State 1, Line 10
The multi-part identifier "sep5.V_ALERTS.REQUESTEDACTION_IDX" could not be bound.
Please post schema and sample data as specific in the link below.:-D
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 21, 2011 at 1:45 pm
it might be this section of the code:
left outer join sep5.V_SEM_COMPUTER s4 on sep5.V_ALERTS.COMPUTER_IDX = s4.V_SEM_COMPUTER.COMPUTER_ID
There is an alias on "s4" on sep5.V_SEM_COMPUTER but then then the alias is used as a schema name: s4.V_SEM_COMPUTER.COMPUTER_ID
You might want to try the following snippet instead:
left outer join sep5.V_SEM_COMPUTER s4 on sep5.V_ALERTS.COMPUTER_IDX = s4.COMPUTER_ID
July 21, 2011 at 1:46 pm
Lowell (7/21/2011)
you'll have to explain what the actual error message is...i cannot think of what an "inbound error" might be.
:hehe:
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 21, 2011 at 1:53 pm
or do you, by any chance, have table names with a period being part of the table name? :sick:
Meaning sep5.V_ALERTS is not referring to table (view?) V_ALERTS in schema sep5 but rather the whole table (view?) is called [sep5.V_ALERTS]?
July 21, 2011 at 2:09 pm
Here is the cleaner format of the SQL,
SELECT sep5.V_ALERTS.ALERT_IDX, COM.IP_ADDR1_TEXT, COM.COMPUTER_NAME, COM.COMPUTER_DOMAIN_NAME,
ALE.USER_NAME, ALE.SOURCE_COMPUTER_NAME, ALE.SOURCE_COMPUTER_IP_TEXT, ALE.SOURCE, ALE.ALERT_IDX, ALE.ACTUALACTION_IDX, ALE.REQUESTEDACTION_IDX AS REQUESTEDACTION, ALE.ALERTDATETIME,
ALE.ALERTINSERTTIME, ALE.ALERTENDDATETIME, ALE.NOOFVIRUSES, ALE.FILEPATH, ALE.DESCRIPTION
from sep5.V_ALERTS ALE
CROSS JOIN sep5.V_SEM_COMPUTER COM
-- left outer join on ALE.COMPUTER_IDX = COM.COMPUTER_ID
left outer join sep5.VIRUS S5 on s5.VIRUSNAME_IDX = ALE.VIRUSNAME_IDX
left outer join sep5.ACTUALACTION S6 on ALE.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on ALE.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join sep5.ALERTMSG on ALE.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '%TRACKING%'
sep5.V_ALERTS, sep5.V_SEM_COMPUTER are the views and COMPUTER_IDX, VIRUS, ALERMSG and ACTUALACTION are the tables
I am getting below error
The multi-part identifier "sep5.V_ALERTS.ALERT_IDX" could not be bound.
July 21, 2011 at 2:21 pm
gopalchalla (7/21/2011)
Here is the cleaner format of the SQL,SELECT sep5.V_ALERTS.ALERT_IDX, COM.IP_ADDR1_TEXT, COM.COMPUTER_NAME, COM.COMPUTER_DOMAIN_NAME,
ALE.USER_NAME, ALE.SOURCE_COMPUTER_NAME, ALE.SOURCE_COMPUTER_IP_TEXT, ALE.SOURCE, ALE.ALERT_IDX, ALE.ACTUALACTION_IDX, ALE.REQUESTEDACTION_IDX AS REQUESTEDACTION, ALE.ALERTDATETIME,
ALE.ALERTINSERTTIME, ALE.ALERTENDDATETIME, ALE.NOOFVIRUSES, ALE.FILEPATH, ALE.DESCRIPTION
from sep5.V_ALERTS ALE
CROSS JOIN sep5.V_SEM_COMPUTER COM
-- left outer join on ALE.COMPUTER_IDX = COM.COMPUTER_ID
left outer join sep5.VIRUS S5 on s5.VIRUSNAME_IDX = ALE.VIRUSNAME_IDX
left outer join sep5.ACTUALACTION S6 on ALE.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on ALE.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join sep5.ALERTMSG on ALE.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE [sep5.V_ALERTS].[ALERTENDDATETIME] > '%TRACKING%'
sep5.V_ALERTS, sep5.V_SEM_COMPUTER are the views and COMPUTER_IDX, VIRUS, ALERMSG and ACTUALACTION are the tables
I am getting below error
The multi-part identifier "sep5.V_ALERTS.ALERT_IDX" could not be bound.
You are still selecting from
sep5.V_ALERTS ALE
and filtering in your where clause with
[sep5.V_ALERTS]
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 21, 2011 at 2:23 pm
SELECT sep5.V_ALERTS.ALERT_IDX, COM.IP_ADDR1_TEXT, COM.COMPUTER_NAME, COM.COMPUTER_DOMAIN_NAME,
ALE.USER_NAME, ALE.SOURCE_COMPUTER_NAME, ALE.SOURCE_COMPUTER_IP_TEXT, ALE.SOURCE, ALE.ALERT_IDX,
ALE.ACTUALACTION_IDX, ALE.REQUESTEDACTION_IDX AS REQUESTEDACTION, ALE.ALERTDATETIME,
ALE.ALERTINSERTTIME, ALE.ALERTENDDATETIME, ALE.NOOFVIRUSES, ALE.FILEPATH, ALE.DESCRIPTION
from sep5.V_ALERTS ALE
CROSS JOIN sep5.V_SEM_COMPUTER COM
-- left outer join on ALE.COMPUTER_IDX = COM.COMPUTER_ID
left outer join sep5.VIRUS S5 on s5.VIRUSNAME_IDX = ALE.VIRUSNAME_IDX
left outer join sep5.ACTUALACTION S6 on ALE.ACTUALACTION_IDX = S6.ACTUALACTION_IDX
left outer join sep5.ACTUALACTION S7 on ALE.REQUESTEDACTION_IDX = S7.ACTUALACTION_IDX
left outer join sep5.ALERTMSG on ALE.ALERT_IDX = ALERTMSG.ALERT_IDX
WHERE sep5.V_ALERTS.ALERTENDDATETIME > '07/10/2011'
I am getting below errors
[font="Arial"]
The multi-part identifier "sep5.V_ALERTS.ALERTENDDATETIME" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "sep5.V_ALERTS.ALERT_IDX" could not be bound.
July 21, 2011 at 2:26 pm
If you assign an alias like "ALE" to sep5.V_ALERTS you'll actually have to use it in your join syntax.
Replace sep5.V_ALERTS with ALE
July 21, 2011 at 2:26 pm
Do those two columns belong to that table/view?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 21, 2011 at 2:33 pm
I saw an example where this issue is related to alias and I also believe that I saw an issue with the columns not in the schema.
Having the DDL would make it easier to make a determination as to the source of the problem.:-)
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply