From davidmcafee at gmail.com Wed Apr 3 12:14:45 2013 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 3 Apr 2013 10:14:45 -0700 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 Message-ID: Have any of you come across this error? I am running a local instance of SQL 2012 on my box. I created a few tables and I am now creating a stored procedure. In the procedure, I get a red underline under one of the table names. When I mouse over the red underline, it displays: "Invalid object name 'tblTerritoryRsmJunct'" The select statement DOES work and return the correct values. SELECT R.RegionDesc, GSM.Fullname AS GSM, RSM.Fullname AS RSM, T.Territory, T.TerrID AS TerritoryID FROM tblRegion R (NOLOCK) INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate FROM tblTerritoryRsmJunct (NOLOCK) WHERE entryDate < @AsOfDate GROUP BY TerritoryID) AS RJ1 ON T.TerrID = RJ1.territoryid INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) ON RJ1.territoryID = RJ2.TerritoryID AND RJ1.MaxDate = RJ2.entryDate INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid I've even dragged in the table name from the Object explorer so it reads: [dbo].[tblRouteSellerJunct] but it still underlines it in red. The file name is 20 characters long. I've named tables with longer names before. Any ideas? Thanks, David From paul.hartland at googlemail.com Wed Apr 3 12:46:43 2013 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 3 Apr 2013 18:46:43 +0100 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: Message-ID: David, Never had this happen in a stored procedure unless the table wasn't in the database that I was creating the SP or I opened the query window and hadn't got the correct database selected. However I have only used upto version 2008, if you do find out what's happening then would like to know. Paul On 3 April 2013 18:14, David McAfee wrote: > Have any of you come across this error? > > I am running a local instance of SQL 2012 on my box. > I created a few tables and I am now creating a stored procedure. > > In the procedure, I get a red underline under one of the table names. > > When I mouse over the red underline, it displays: "Invalid object name > 'tblTerritoryRsmJunct'" > > The select statement DOES work and return the correct values. > > > SELECT > R.RegionDesc, > GSM.Fullname AS GSM, > RSM.Fullname AS RSM, > T.Territory, > T.TerrID AS TerritoryID > FROM tblRegion R (NOLOCK) > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > FROM tblTerritoryRsmJunct (NOLOCK) > WHERE entryDate < @AsOfDate > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > RJ1.territoryid > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > ON RJ1.territoryID = RJ2.TerritoryID > AND RJ1.MaxDate = RJ2.entryDate > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > I've even dragged in the table name from the Object explorer so it reads: > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > The file name is 20 characters long. I've named tables with longer names > before. > > Any ideas? > > Thanks, > David > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From james at fcidms.com Wed Apr 3 12:52:27 2013 From: james at fcidms.com (James Barash) Date: Wed, 3 Apr 2013 17:52:27 +0000 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: Message-ID: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> David: I see that all the time. It's some sort of bug in Management Studio. If you create a table and then create a stored procedure without closing Management Studio, you will get the Invalid Object message. As long as the query runs, there won't be any problems. Once you close and reopen Management Studio, everything will be fine. At least that has been my experience. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Wednesday, April 03, 2013 1:15 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] Invalid Object name, SQL 2012 Have any of you come across this error? I am running a local instance of SQL 2012 on my box. I created a few tables and I am now creating a stored procedure. In the procedure, I get a red underline under one of the table names. When I mouse over the red underline, it displays: "Invalid object name 'tblTerritoryRsmJunct'" The select statement DOES work and return the correct values. SELECT R.RegionDesc, GSM.Fullname AS GSM, RSM.Fullname AS RSM, T.Territory, T.TerrID AS TerritoryID FROM tblRegion R (NOLOCK) INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate FROM tblTerritoryRsmJunct (NOLOCK) WHERE entryDate < @AsOfDate GROUP BY TerritoryID) AS RJ1 ON T.TerrID = RJ1.territoryid INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) ON RJ1.territoryID = RJ2.TerritoryID AND RJ1.MaxDate = RJ2.entryDate INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid I've even dragged in the table name from the Object explorer so it reads: [dbo].[tblRouteSellerJunct] but it still underlines it in red. The file name is 20 characters long. I've named tables with longer names before. Any ideas? Thanks, David _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From paul.hartland at googlemail.com Wed Apr 3 12:59:18 2013 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 3 Apr 2013 18:59:18 +0100 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: ahhh I remember now, I would sometimes get a red line when referenced a newly created table, would either have to close management studio or right click and select refresh on the table group On 3 April 2013 18:52, James Barash wrote: > David: > > I see that all the time. It's some sort of bug in Management Studio. If > you create a table and then create a stored procedure without closing > Management Studio, you will get the Invalid Object message. As long as the > query runs, there won't be any problems. > Once you close and reopen Management Studio, everything will be fine. At > least that has been my experience. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David McAfee > Sent: Wednesday, April 03, 2013 1:15 PM > To: Discussion concerning MS SQL Server > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > Have any of you come across this error? > > I am running a local instance of SQL 2012 on my box. > I created a few tables and I am now creating a stored procedure. > > In the procedure, I get a red underline under one of the table names. > > When I mouse over the red underline, it displays: "Invalid object name > 'tblTerritoryRsmJunct'" > > The select statement DOES work and return the correct values. > > > SELECT > R.RegionDesc, > GSM.Fullname AS GSM, > RSM.Fullname AS RSM, > T.Territory, > T.TerrID AS TerritoryID > FROM tblRegion R (NOLOCK) > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > FROM tblTerritoryRsmJunct (NOLOCK) > WHERE entryDate < @AsOfDate > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > RJ1.territoryid > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > ON RJ1.territoryID = RJ2.TerritoryID > AND RJ1.MaxDate = RJ2.entryDate > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > I've even dragged in the table name from the Object explorer so it reads: > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > The file name is 20 characters long. I've named tables with longer names > before. > > Any ideas? > > Thanks, > David > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From davidmcafee at gmail.com Wed Apr 3 13:23:22 2013 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 3 Apr 2013 11:23:22 -0700 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: Yup that was it. I closed the stp and reopened it and I was still seeing the red lines. I closed all of my SSMS windows and reopened SSMS and it was opened. How weird that only one table was giving me the false error. Thanks, David On Wed, Apr 3, 2013 at 10:52 AM, James Barash wrote: > David: > > I see that all the time. It's some sort of bug in Management Studio. If > you create a table and then create a stored procedure without closing > Management Studio, you will get the Invalid Object message. As long as the > query runs, there won't be any problems. > Once you close and reopen Management Studio, everything will be fine. At > least that has been my experience. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David McAfee > Sent: Wednesday, April 03, 2013 1:15 PM > To: Discussion concerning MS SQL Server > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > Have any of you come across this error? > > I am running a local instance of SQL 2012 on my box. > I created a few tables and I am now creating a stored procedure. > > In the procedure, I get a red underline under one of the table names. > > When I mouse over the red underline, it displays: "Invalid object name > 'tblTerritoryRsmJunct'" > > The select statement DOES work and return the correct values. > > > SELECT > R.RegionDesc, > GSM.Fullname AS GSM, > RSM.Fullname AS RSM, > T.Territory, > T.TerrID AS TerritoryID > FROM tblRegion R (NOLOCK) > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > FROM tblTerritoryRsmJunct (NOLOCK) > WHERE entryDate < @AsOfDate > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > RJ1.territoryid > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > ON RJ1.territoryID = RJ2.TerritoryID > AND RJ1.MaxDate = RJ2.entryDate > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > I've even dragged in the table name from the Object explorer so it reads: > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > The file name is 20 characters long. I've named tables with longer names > before. > > Any ideas? > > Thanks, > David > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Wed Apr 3 13:36:34 2013 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 3 Apr 2013 19:36:34 +0100 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: I would assume that that table was the last one you created On 3 April 2013 19:23, David McAfee wrote: > Yup that was it. I closed the stp and reopened it and I was still seeing > the red lines. > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > How weird that only one table was giving me the false error. > > Thanks, > David > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash wrote: > > > David: > > > > I see that all the time. It's some sort of bug in Management Studio. If > > you create a table and then create a stored procedure without closing > > Management Studio, you will get the Invalid Object message. As long as > the > > query runs, there won't be any problems. > > Once you close and reopen Management Studio, everything will be fine. At > > least that has been my experience. > > > > James Barash > > > > -----Original Message----- > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David McAfee > > Sent: Wednesday, April 03, 2013 1:15 PM > > To: Discussion concerning MS SQL Server > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > Have any of you come across this error? > > > > I am running a local instance of SQL 2012 on my box. > > I created a few tables and I am now creating a stored procedure. > > > > In the procedure, I get a red underline under one of the table names. > > > > When I mouse over the red underline, it displays: "Invalid object name > > 'tblTerritoryRsmJunct'" > > > > The select statement DOES work and return the correct values. > > > > > > SELECT > > R.RegionDesc, > > GSM.Fullname AS GSM, > > RSM.Fullname AS RSM, > > T.Territory, > > T.TerrID AS TerritoryID > > FROM tblRegion R (NOLOCK) > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > FROM tblTerritoryRsmJunct (NOLOCK) > > WHERE entryDate < @AsOfDate > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > RJ1.territoryid > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > ON RJ1.territoryID = RJ2.TerritoryID > > AND RJ1.MaxDate = RJ2.entryDate > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > I've even dragged in the table name from the Object explorer so it reads: > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > The file name is 20 characters long. I've named tables with longer names > > before. > > > > Any ideas? > > > > Thanks, > > David > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From davidmcafee at gmail.com Wed Apr 3 13:49:31 2013 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 3 Apr 2013 11:49:31 -0700 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: Yes, it was. On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland wrote: > I would assume that that table was the last one you created > > > On 3 April 2013 19:23, David McAfee wrote: > > > Yup that was it. I closed the stp and reopened it and I was still seeing > > the red lines. > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > How weird that only one table was giving me the false error. > > > > Thanks, > > David > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash wrote: > > > > > David: > > > > > > I see that all the time. It's some sort of bug in Management Studio. If > > > you create a table and then create a stored procedure without closing > > > Management Studio, you will get the Invalid Object message. As long as > > the > > > query runs, there won't be any problems. > > > Once you close and reopen Management Studio, everything will be fine. > At > > > least that has been my experience. > > > > > > James Barash > > > > > > -----Original Message----- > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David McAfee > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > To: Discussion concerning MS SQL Server > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > Have any of you come across this error? > > > > > > I am running a local instance of SQL 2012 on my box. > > > I created a few tables and I am now creating a stored procedure. > > > > > > In the procedure, I get a red underline under one of the table names. > > > > > > When I mouse over the red underline, it displays: "Invalid object name > > > 'tblTerritoryRsmJunct'" > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > SELECT > > > R.RegionDesc, > > > GSM.Fullname AS GSM, > > > RSM.Fullname AS RSM, > > > T.Territory, > > > T.TerrID AS TerritoryID > > > FROM tblRegion R (NOLOCK) > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > WHERE entryDate < @AsOfDate > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > RJ1.territoryid > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > ON RJ1.territoryID = RJ2.TerritoryID > > > AND RJ1.MaxDate = RJ2.entryDate > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > I've even dragged in the table name from the Object explorer so it > reads: > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > The file name is 20 characters long. I've named tables with longer > names > > > before. > > > > > > Any ideas? > > > > > > Thanks, > > > David > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From paul.hartland at googlemail.com Wed Apr 3 13:54:28 2013 From: paul.hartland at googlemail.com (Paul Hartland) Date: Wed, 3 Apr 2013 19:54:28 +0100 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: Ah it just needed refreshing then, what I got into the habit of was if I created a new table in a database, before I done anything else I would right click the tables branch (as I call it) under my database and click refresh to refresh all tables. On 3 April 2013 19:49, David McAfee wrote: > Yes, it was. > > > On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland < > paul.hartland at googlemail.com > > wrote: > > > I would assume that that table was the last one you created > > > > > > On 3 April 2013 19:23, David McAfee wrote: > > > > > Yup that was it. I closed the stp and reopened it and I was still > seeing > > > the red lines. > > > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > > > How weird that only one table was giving me the false error. > > > > > > Thanks, > > > David > > > > > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash > wrote: > > > > > > > David: > > > > > > > > I see that all the time. It's some sort of bug in Management Studio. > If > > > > you create a table and then create a stored procedure without closing > > > > Management Studio, you will get the Invalid Object message. As long > as > > > the > > > > query runs, there won't be any problems. > > > > Once you close and reopen Management Studio, everything will be fine. > > At > > > > least that has been my experience. > > > > > > > > James Barash > > > > > > > > -----Original Message----- > > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > McAfee > > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > > To: Discussion concerning MS SQL Server > > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > > > Have any of you come across this error? > > > > > > > > I am running a local instance of SQL 2012 on my box. > > > > I created a few tables and I am now creating a stored procedure. > > > > > > > > In the procedure, I get a red underline under one of the table names. > > > > > > > > When I mouse over the red underline, it displays: "Invalid object > name > > > > 'tblTerritoryRsmJunct'" > > > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > > > > SELECT > > > > R.RegionDesc, > > > > GSM.Fullname AS GSM, > > > > RSM.Fullname AS RSM, > > > > T.Territory, > > > > T.TerrID AS TerritoryID > > > > FROM tblRegion R (NOLOCK) > > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > > WHERE entryDate < @AsOfDate > > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > > RJ1.territoryid > > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > > ON RJ1.territoryID = RJ2.TerritoryID > > > > AND RJ1.MaxDate = RJ2.entryDate > > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > > > > I've even dragged in the table name from the Object explorer so it > > reads: > > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > > > The file name is 20 characters long. I've named tables with longer > > names > > > > before. > > > > > > > > Any ideas? > > > > > > > > Thanks, > > > > David > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > -- > > Paul Hartland > > paul.hartland at googlemail.com > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From Elizabeth.J.Doering at wellsfargo.com Wed Apr 3 18:48:01 2013 From: Elizabeth.J.Doering at wellsfargo.com (Elizabeth.J.Doering at wellsfargo.com) Date: Wed, 3 Apr 2013 23:48:01 +0000 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> In SSMS Edit-->Intellisense-->Refresh Local Cache Should fix it right up. Maddening however, that it doesn't just refresh itself at intervals. Liz This message may contain confidential and/or privileged information.? If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein.? If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message.? Thank you for your cooperation. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Wednesday, April 03, 2013 1:54 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 Ah it just needed refreshing then, what I got into the habit of was if I created a new table in a database, before I done anything else I would right click the tables branch (as I call it) under my database and click refresh to refresh all tables. On 3 April 2013 19:49, David McAfee wrote: > Yes, it was. > > > On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland < > paul.hartland at googlemail.com > > wrote: > > > I would assume that that table was the last one you created > > > > > > On 3 April 2013 19:23, David McAfee wrote: > > > > > Yup that was it. I closed the stp and reopened it and I was still > seeing > > > the red lines. > > > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > > > How weird that only one table was giving me the false error. > > > > > > Thanks, > > > David > > > > > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash > wrote: > > > > > > > David: > > > > > > > > I see that all the time. It's some sort of bug in Management Studio. > If > > > > you create a table and then create a stored procedure without > > > > closing Management Studio, you will get the Invalid Object > > > > message. As long > as > > > the > > > > query runs, there won't be any problems. > > > > Once you close and reopen Management Studio, everything will be fine. > > At > > > > least that has been my experience. > > > > > > > > James Barash > > > > > > > > -----Original Message----- > > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > McAfee > > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > > To: Discussion concerning MS SQL Server > > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > > > Have any of you come across this error? > > > > > > > > I am running a local instance of SQL 2012 on my box. > > > > I created a few tables and I am now creating a stored procedure. > > > > > > > > In the procedure, I get a red underline under one of the table names. > > > > > > > > When I mouse over the red underline, it displays: "Invalid > > > > object > name > > > > 'tblTerritoryRsmJunct'" > > > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > > > > SELECT > > > > R.RegionDesc, > > > > GSM.Fullname AS GSM, > > > > RSM.Fullname AS RSM, > > > > T.Territory, > > > > T.TerrID AS TerritoryID > > > > FROM tblRegion R (NOLOCK) > > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > > WHERE entryDate < @AsOfDate > > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > > RJ1.territoryid > > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > > ON RJ1.territoryID = RJ2.TerritoryID > > > > AND RJ1.MaxDate = RJ2.entryDate > > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > > > > I've even dragged in the table name from the Object explorer so > > > > it > > reads: > > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > > > The file name is 20 characters long. I've named tables with > > > > longer > > names > > > > before. > > > > > > > > Any ideas? > > > > > > > > Thanks, > > > > David > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > -- > > Paul Hartland > > paul.hartland at googlemail.com > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Apr 4 17:29:38 2013 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 4 Apr 2013 15:29:38 -0700 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> Message-ID: You learn something new every day. Thanks for that! David On Wed, Apr 3, 2013 at 4:48 PM, wrote: > In SSMS > Edit-->Intellisense-->Refresh Local Cache > > Should fix it right up. > > Maddening however, that it doesn't just refresh itself at intervals. > > Liz > > This message may contain confidential and/or privileged information. If > you are not the addressee or authorized to receive this for the addressee, > you must not use, copy, disclose, or take any action based on this message > or any information herein. If you have received this message in error, > please advise the sender immediately by reply e-mail and delete this > message. Thank you for your cooperation. > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Wednesday, April 03, 2013 1:54 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 > > Ah it just needed refreshing then, what I got into the habit of was if I > created a new table in a database, before I done anything else I would > right click the tables branch (as I call it) under my database and click > refresh to refresh all tables. > > > On 3 April 2013 19:49, David McAfee wrote: > > > Yes, it was. > > > > > > On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland < > > paul.hartland at googlemail.com > > > wrote: > > > > > I would assume that that table was the last one you created > > > > > > > > > On 3 April 2013 19:23, David McAfee wrote: > > > > > > > Yup that was it. I closed the stp and reopened it and I was still > > seeing > > > > the red lines. > > > > > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > > > > > How weird that only one table was giving me the false error. > > > > > > > > Thanks, > > > > David > > > > > > > > > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash > > wrote: > > > > > > > > > David: > > > > > > > > > > I see that all the time. It's some sort of bug in Management > Studio. > > If > > > > > you create a table and then create a stored procedure without > > > > > closing Management Studio, you will get the Invalid Object > > > > > message. As long > > as > > > > the > > > > > query runs, there won't be any problems. > > > > > Once you close and reopen Management Studio, everything will be > fine. > > > At > > > > > least that has been my experience. > > > > > > > > > > James Barash > > > > > > > > > > -----Original Message----- > > > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > > McAfee > > > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > > > To: Discussion concerning MS SQL Server > > > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > > > > > Have any of you come across this error? > > > > > > > > > > I am running a local instance of SQL 2012 on my box. > > > > > I created a few tables and I am now creating a stored procedure. > > > > > > > > > > In the procedure, I get a red underline under one of the table > names. > > > > > > > > > > When I mouse over the red underline, it displays: "Invalid > > > > > object > > name > > > > > 'tblTerritoryRsmJunct'" > > > > > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > > > > > > > SELECT > > > > > R.RegionDesc, > > > > > GSM.Fullname AS GSM, > > > > > RSM.Fullname AS RSM, > > > > > T.Territory, > > > > > T.TerrID AS TerritoryID > > > > > FROM tblRegion R (NOLOCK) > > > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > > > WHERE entryDate < @AsOfDate > > > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > > > RJ1.territoryid > > > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > > > ON RJ1.territoryID = RJ2.TerritoryID > > > > > AND RJ1.MaxDate = RJ2.entryDate > > > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > > > > > > > I've even dragged in the table name from the Object explorer so > > > > > it > > > reads: > > > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > > > > > The file name is 20 characters long. I've named tables with > > > > > longer > > > names > > > > > before. > > > > > > > > > > Any ideas? > > > > > > > > > > Thanks, > > > > > David > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > -- > > > Paul Hartland > > > paul.hartland at googlemail.com > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From james at fcidms.com Fri Apr 5 08:25:21 2013 From: james at fcidms.com (James Barash) Date: Fri, 5 Apr 2013 13:25:21 +0000 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> Message-ID: <94AAC5416CCCB449AE330D33976AFD7F48AAD2EB@BLUPRD0411MB436.namprd04.prod.outlook.com> Liz: Thanks, I never knew that. I just refreshed the tables and assumed that would update the Intellisense. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Elizabeth.J.Doering at wellsfargo.com Sent: Wednesday, April 03, 2013 7:48 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 In SSMS Edit-->Intellisense-->Refresh Local Cache Should fix it right up. Maddening however, that it doesn't just refresh itself at intervals. Liz This message may contain confidential and/or privileged information.? If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein.? If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message.? Thank you for your cooperation. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Wednesday, April 03, 2013 1:54 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 Ah it just needed refreshing then, what I got into the habit of was if I created a new table in a database, before I done anything else I would right click the tables branch (as I call it) under my database and click refresh to refresh all tables. On 3 April 2013 19:49, David McAfee wrote: > Yes, it was. > > > On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland < > paul.hartland at googlemail.com > > wrote: > > > I would assume that that table was the last one you created > > > > > > On 3 April 2013 19:23, David McAfee wrote: > > > > > Yup that was it. I closed the stp and reopened it and I was still > seeing > > > the red lines. > > > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > > > How weird that only one table was giving me the false error. > > > > > > Thanks, > > > David > > > > > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash > wrote: > > > > > > > David: > > > > > > > > I see that all the time. It's some sort of bug in Management Studio. > If > > > > you create a table and then create a stored procedure without > > > > closing Management Studio, you will get the Invalid Object > > > > message. As long > as > > > the > > > > query runs, there won't be any problems. > > > > Once you close and reopen Management Studio, everything will be fine. > > At > > > > least that has been my experience. > > > > > > > > James Barash > > > > > > > > -----Original Message----- > > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > McAfee > > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > > To: Discussion concerning MS SQL Server > > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > > > Have any of you come across this error? > > > > > > > > I am running a local instance of SQL 2012 on my box. > > > > I created a few tables and I am now creating a stored procedure. > > > > > > > > In the procedure, I get a red underline under one of the table names. > > > > > > > > When I mouse over the red underline, it displays: "Invalid > > > > object > name > > > > 'tblTerritoryRsmJunct'" > > > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > > > > SELECT > > > > R.RegionDesc, > > > > GSM.Fullname AS GSM, > > > > RSM.Fullname AS RSM, > > > > T.Territory, > > > > T.TerrID AS TerritoryID > > > > FROM tblRegion R (NOLOCK) > > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > > WHERE entryDate < @AsOfDate > > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > > RJ1.territoryid > > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > > ON RJ1.territoryID = RJ2.TerritoryID > > > > AND RJ1.MaxDate = RJ2.entryDate > > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > > > > I've even dragged in the table name from the Object explorer so > > > > it > > reads: > > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > > > The file name is 20 characters long. I've named tables with > > > > longer > > names > > > > before. > > > > > > > > Any ideas? > > > > > > > > Thanks, > > > > David > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > > > > > -- > > Paul Hartland > > paul.hartland at googlemail.com > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Apr 5 17:03:37 2013 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 5 Apr 2013 15:03:37 -0700 Subject: [dba-SQLServer] Invalid Object name, SQL 2012 In-Reply-To: <94AAC5416CCCB449AE330D33976AFD7F48AAD2EB@BLUPRD0411MB436.namprd04.prod.outlook.com> References: <94AAC5416CCCB449AE330D33976AFD7F48AA7BB9@BLUPRD0411MB436.namprd04.prod.outlook.com> <074E01FF8433644D823218D61A1D4C5802E07A@MSGEXSV21103.ent.wfb.bank.corp> <94AAC5416CCCB449AE330D33976AFD7F48AAD2EB@BLUPRD0411MB436.namprd04.prod.outlook.com> Message-ID: Ahhh, Ctrl+Shirt+R is my new friend (even though I think this should automatically be done every so often) On Fri, Apr 5, 2013 at 6:25 AM, James Barash wrote: > Liz: > > Thanks, I never knew that. I just refreshed the tables and assumed that > would update the Intellisense. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Elizabeth.J.Doering at wellsfargo.com > Sent: Wednesday, April 03, 2013 7:48 PM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 > > In SSMS > Edit-->Intellisense-->Refresh Local Cache > > Should fix it right up. > > Maddening however, that it doesn't just refresh itself at intervals. > > Liz > > This message may contain confidential and/or privileged information. If > you are not the addressee or authorized to receive this for the addressee, > you must not use, copy, disclose, or take any action based on this message > or any information herein. If you have received this message in error, > please advise the sender immediately by reply e-mail and delete this > message. Thank you for your cooperation. > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland > Sent: Wednesday, April 03, 2013 1:54 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Invalid Object name, SQL 2012 > > Ah it just needed refreshing then, what I got into the habit of was if I > created a new table in a database, before I done anything else I would > right click the tables branch (as I call it) under my database and click > refresh to refresh all tables. > > > On 3 April 2013 19:49, David McAfee wrote: > > > Yes, it was. > > > > > > On Wed, Apr 3, 2013 at 11:36 AM, Paul Hartland < > > paul.hartland at googlemail.com > > > wrote: > > > > > I would assume that that table was the last one you created > > > > > > > > > On 3 April 2013 19:23, David McAfee wrote: > > > > > > > Yup that was it. I closed the stp and reopened it and I was still > > seeing > > > > the red lines. > > > > > > > > I closed all of my SSMS windows and reopened SSMS and it was opened. > > > > > > > > How weird that only one table was giving me the false error. > > > > > > > > Thanks, > > > > David > > > > > > > > > > > > > > > > On Wed, Apr 3, 2013 at 10:52 AM, James Barash > > wrote: > > > > > > > > > David: > > > > > > > > > > I see that all the time. It's some sort of bug in Management > Studio. > > If > > > > > you create a table and then create a stored procedure without > > > > > closing Management Studio, you will get the Invalid Object > > > > > message. As long > > as > > > > the > > > > > query runs, there won't be any problems. > > > > > Once you close and reopen Management Studio, everything will be > fine. > > > At > > > > > least that has been my experience. > > > > > > > > > > James Barash > > > > > > > > > > -----Original Message----- > > > > > From: dba-sqlserver-bounces at databaseadvisors.com [mailto: > > > > > dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > > McAfee > > > > > Sent: Wednesday, April 03, 2013 1:15 PM > > > > > To: Discussion concerning MS SQL Server > > > > > Subject: [dba-SQLServer] Invalid Object name, SQL 2012 > > > > > > > > > > Have any of you come across this error? > > > > > > > > > > I am running a local instance of SQL 2012 on my box. > > > > > I created a few tables and I am now creating a stored procedure. > > > > > > > > > > In the procedure, I get a red underline under one of the table > names. > > > > > > > > > > When I mouse over the red underline, it displays: "Invalid > > > > > object > > name > > > > > 'tblTerritoryRsmJunct'" > > > > > > > > > > The select statement DOES work and return the correct values. > > > > > > > > > > > > > > > SELECT > > > > > R.RegionDesc, > > > > > GSM.Fullname AS GSM, > > > > > RSM.Fullname AS RSM, > > > > > T.Territory, > > > > > T.TerrID AS TerritoryID > > > > > FROM tblRegion R (NOLOCK) > > > > > INNER JOIN tblUser GSM (NOLOCK) ON R.GsmUserGuid = GSM.UserGuid > > > > > INNER JOIN tblTerritory T (NOLOCK) ON T.RegionID = R.RegionID > > > > > INNER JOIN (SELECT TerritoryID, MAX(entryDate) as MaxDate > > > > > FROM tblTerritoryRsmJunct (NOLOCK) > > > > > WHERE entryDate < @AsOfDate > > > > > GROUP BY TerritoryID) AS RJ1 ON T.TerrID = > > > > > RJ1.territoryid > > > > > INNER JOIN tblRouteSellerJunct AS RJ2 (NOLOCK) > > > > > ON RJ1.territoryID = RJ2.TerritoryID > > > > > AND RJ1.MaxDate = RJ2.entryDate > > > > > INNER JOIN tblUser RSM (NOLOCK) ON RSM.UserGuid = RJ2.RsmGuid > > > > > > > > > > > > > > > I've even dragged in the table name from the Object explorer so > > > > > it > > > reads: > > > > > [dbo].[tblRouteSellerJunct] but it still underlines it in red. > > > > > > > > > > The file name is 20 characters long. I've named tables with > > > > > longer > > > names > > > > > before. > > > > > > > > > > Any ideas? > > > > > > > > > > Thanks, > > > > > David > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > dba-SQLServer mailing list > > > > > dba-SQLServer at databaseadvisors.com > > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > _______________________________________________ > > > > dba-SQLServer mailing list > > > > dba-SQLServer at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > > http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > -- > > > Paul Hartland > > > paul.hartland at googlemail.com > > > _______________________________________________ > > > dba-SQLServer mailing list > > > dba-SQLServer at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > > http://www.databaseadvisors.com > > > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > > > -- > Paul Hartland > paul.hartland at googlemail.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From mcp2004 at mail.ru Wed Apr 24 02:20:19 2013 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 24 Apr 2013 11:20:19 +0400 Subject: [dba-SQLServer] =?utf-8?q?SQL_Server_does_not_exist_or_access_den?= =?utf-8?q?ied=2E?= Message-ID: <1366788019.899735719@f208.mail.ru> Hi All -- I'm trying to create an ODBC connection on a Win7 Hyper-V VM for an MS SQL database handled by a default MS SQL Server 2012 instance running on Win8 on a real PC hosting Hyper-V, and I'm getting the following error messages: Connection failed: SQLState: '01000' SQL Server Error: 10060 [Micorsoft][ODBC Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()). Connection failed: SQLState: '08001' SQL Server Error: 17 [Micorsoft][ODBC Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied. MS SQL Server 2012 has mixed security mode. I'm using Homegroup MS Windows network type. Win7 Hyper-V VM has also MS SQL 2008 R2 SQLExpress named instance: when I'm using MS SQL Server Management Studio from this Win-7 Hyper-V VM's MS SQL 2008 R2 Express instance I *can* connect to MS SQL Server 2012 instance using the same MS SQL Server standard/mixed security mode User Id and Password. I know about?http://support.microsoft.com/kb/328306, I fif read it (but I can't say that I read it all), I have checked that MS SQL Server connection over TCP/IP uses 1433 port. I have had expected that ODBC connection would have been created as flawlessly as I can connect another MS SQL Server instance using MS SQL Server Management Studio. The issue is that I do no see clearly stated reasons while connection fails. Do you know about any (tracing) tools, which will give me more information to find the cause(s) and to fix the subject issue? Thank you. -- Shamil From gustav at cactus.dk Wed Apr 24 03:55:52 2013 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 24 Apr 2013 10:55:52 +0200 Subject: [dba-SQLServer] SQL Server does not exist or access denied. Message-ID: <009901ce40c9$866da5a0$9348f0e0$@cactus.dk> Hi Shamil It sounds as if the TCP/IP port for the SQL Server instance is disabled. Open Sql Server Configuration Manager and check if the protocol is marked as "Enabled". /gustav -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Salakhetdinov Shamil Sendt: 24. april 2013 09:20 Til: Discussion concerning MS SQL Ser Emne: [dba-SQLServer] SQL Server does not exist or access denied. Hi All -- I'm trying to create an ODBC connection on a Win7 Hyper-V VM for an MS SQL database handled by a default MS SQL Server 2012 instance running on Win8 on a real PC hosting Hyper-V, and I'm getting the following error messages: Connection failed: SQLState: '01000' SQL Server Error: 10060 [Micorsoft][ODBC Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()). Connection failed: SQLState: '08001' SQL Server Error: 17 [Micorsoft][ODBC Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied. MS SQL Server 2012 has mixed security mode. I'm using Homegroup MS Windows network type. Win7 Hyper-V VM has also MS SQL 2008 R2 SQLExpress named instance: when I'm using MS SQL Server Management Studio from this Win-7 Hyper-V VM's MS SQL 2008 R2 Express instance I *can* connect to MS SQL Server 2012 instance using the same MS SQL Server standard/mixed security mode User Id and Password. I know about http://support.microsoft.com/kb/328306, I fif read it (but I can't say that I read it all), I have checked that MS SQL Server connection over TCP/IP uses 1433 port. I have had expected that ODBC connection would have been created as flawlessly as I can connect another MS SQL Server instance using MS SQL Server Management Studio. The issue is that I do no see clearly stated reasons while connection fails. Do you know about any (tracing) tools, which will give me more information to find the cause(s) and to fix the subject issue? Thank you. -- Shamil From mcp2004 at mail.ru Wed Apr 24 07:53:47 2013 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 24 Apr 2013 16:53:47 +0400 Subject: [dba-SQLServer] =?utf-8?q?SQL_Server_does_not_exist_or_access_den?= =?utf-8?q?ied=2E?= In-Reply-To: <009901ce40c9$866da5a0$9348f0e0$@cactus.dk> References: <009901ce40c9$866da5a0$9348f0e0$@cactus.dk> Message-ID: <1366808027.523615289@f351.mail.ru> Hi Gustav -- It was firewall, which was blocking port# 1433 Thank you. -- Shamil ?????, 24 ?????? 2013, 10:55 +02:00 ?? "Gustav Brock" : >Hi Shamil > >It sounds as if the TCP/IP port for the SQL Server instance is disabled. >Open Sql Server Configuration Manager and check if the protocol is marked as "Enabled". > >/gustav > >-----Oprindelig meddelelse----- >Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Salakhetdinov Shamil >Sendt: 24. april 2013 09:20 >Til: Discussion concerning MS SQL Ser >Emne: [dba-SQLServer] SQL Server does not exist or access denied. > >?Hi All -- > >I'm trying to create an ODBC connection on a Win7 Hyper-V VM for an MS SQL database handled by a default MS SQL Server 2012 instance running on Win8 on a real PC hosting Hyper-V, and I'm getting the following error messages: > >Connection failed: >SQLState: '01000' >SQL Server Error: 10060 >[Micorsoft][ODBC Server Driver][TCP/IP Sockets]ConnectionOpen (Connect()). >Connection failed: >SQLState: '08001' >SQL Server Error: 17 >[Micorsoft][ODBC Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied. > >MS SQL Server 2012 has mixed security mode. I'm using Homegroup MS Windows network type. > >Win7 Hyper-V VM has also MS SQL 2008 R2 SQLExpress named instance: when I'm using MS SQL Server Management Studio from this Win-7 Hyper-V VM's MS SQL 2008 R2 Express instance I *can* connect to MS SQL Server 2012 instance using the same MS SQL Server standard/mixed security mode User Id and Password. > >I know about http://support.microsoft.com/kb/328306 , I fif read it (but I can't say that I read it all), I have checked that MS SQL Server connection over TCP/IP uses 1433 port. > >I have had expected that ODBC connection would have been created as flawlessly as I can connect another MS SQL Server instance using MS SQL Server Management Studio. The issue is that I do no see clearly stated reasons while connection fails. Do you know about any (tracing) tools, which will give me more information to find the cause(s) and to fix the subject issue? > >Thank you. > >-- Shamil > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com >