July 10, 2013 at 9:38 am
Hello. I have an annoying problem and I can't find anything about it.
In scripts I have, that are templates created by my co-workers, the first occurance of a table name, ex: dbo.Exception_Ibank, is fine.
The third occurance has a red squiggly line under it as do all following occurances. If I move my mouse over the table name, it says that it can't find it. The script runs properly, though. Also, all of the field names of the columns in that table have red lines under them, too.
I've tried to clear the cache, which didn't do anything.
This isn't a performance issue. It's just annoying.
Any help would be greatly appreciated.
Bert
July 10, 2013 at 9:41 am
IntelliSense is not a strongest point of SSMS...
You will use to it.
BTW. SQL2012 adds more annoying features in to it eg. pinky UPDATE...
July 10, 2013 at 10:18 am
I think SQL parses things a batch at a time. All your code is in the same batch, and the table is created in that batch. That might be why SQL doesn't recognize that the table exists in the later SELECT statement(s).
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
July 10, 2013 at 10:26 am
You are correct! Thank you. I took out the create table statement and the following alter statement and all of the red lines went away.
It's no less annoying, but thank you for the answer.
Microsoft is so stupid sometimes.
July 10, 2013 at 11:57 am
You could also just add a "GO" after the ALTER TABLE; that will put the SELECTs in a separate batch, by which table SQL should "know" they already exist, having been created by a previous batch.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
July 10, 2013 at 12:09 pm
I tried that. Nothing. I also added BEGINs and ENDs. Nothing.
July 11, 2013 at 5:44 am
bert.hooks (7/10/2013)
You are correct! Thank you. I took out the create table statement and the following alter statement and all of the red lines went away.It's no less annoying, but thank you for the answer.
Microsoft is so stupid sometimes.
Users are so stupid sometimes. Those objects do not currently exist, as the red lines indicate. The script runs fine, as expected, and a refresh of the intelli-sense cache should reflect the new table.
July 11, 2013 at 6:02 am
Wow. Insults from an idiotic know-it-all.
As I indicated in my original post, the tables and column names do exist. I work with people who have used SQL for years and they get the red lines, too, even through the tables exist.
Ten Centuries was correct. You are not.
July 11, 2013 at 6:13 am
bert.hooks (7/11/2013)
Wow. Insults from an idiotic know-it-all.
Pot --> kettle --> black.
Excuse me for being defensive, but Microsoft products have been putting food on my table since 1996. I don't think you should be calling them stupid because of your OCD being offended by squiggly red lines.
July 11, 2013 at 6:18 am
I have my opinion and you have yours.
Have a great day.
July 11, 2013 at 8:54 am
Sean Pearce (7/11/2013)
bert.hooks (7/11/2013)
Wow. Insults from an idiotic know-it-all.Pot --> kettle --> black.
Excuse me for being defensive, but Microsoft products have been putting food on my table since 1996. I don't think you should be calling them stupid because of your OCD being offended by squiggly red lines.
You're not excused. I don't object per se to verbal fisticuffs when warranted, but it's not in this case. There's a huge difference between calling a product "stupid" and calling a person "stupid".
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
July 11, 2013 at 9:04 am
ScottPletcher (7/11/2013)
Sean Pearce (7/11/2013)
bert.hooks (7/11/2013)
Wow. Insults from an idiotic know-it-all.Pot --> kettle --> black.
Excuse me for being defensive, but Microsoft products have been putting food on my table since 1996. I don't think you should be calling them stupid because of your OCD being offended by squiggly red lines.
You're not excused. I don't object per se to verbal fisticuffs when warranted, but it's not in this case. There's a huge difference between calling a product "stupid" and calling a person "stupid".
I wasn't asking you.
July 11, 2013 at 9:09 am
Sean Pearce (7/11/2013)
ScottPletcher (7/11/2013)
Sean Pearce (7/11/2013)
bert.hooks (7/11/2013)
Wow. Insults from an idiotic know-it-all.Pot --> kettle --> black.
Excuse me for being defensive, but Microsoft products have been putting food on my table since 1996. I don't think you should be calling them stupid because of your OCD being offended by squiggly red lines.
You're not excused. I don't object per se to verbal fisticuffs when warranted, but it's not in this case. There's a huge difference between calling a product "stupid" and calling a person "stupid".
I wasn't asking you.
I never claimed you did.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply