I've been using SQL Server 2008 R2 for my web development for years and it's been working perfectly. But something strange happened last night that has stopped my development in my tracks.
Here's some steps in the process:
-- I create a new database from the Management Studio, named "BloggerTest" (dbo)
-- I open a query window and paste in a CREATE table sql script for many tables, such as [dbo].[Blog], etc., with the "use [BloggerTest] GO" at the top
-- I run the script and it runs without errors or messages, and I validate that the tables were created
-- I open another query window and paste in another script for INSERT statements into some of the tables
-- Before I run the script I notice that all the INSERT statement objects display the red squigglie lines under them. When I hover my cursor over the table name I get the message, "Invalid object name '[dbo].[Blog]'". The same squiggle is under all the column names also.
Now here's the part that makes my head explode. I have another table with the same tables and it's a working application, the database is named "BlogApp".
When I change the name of the "use" value from [BloggerTest] to [BlogApp] at the top of the INSERT sql script T-SQL query, all the red squigglie lines disappear!
What the heck is going on? The script that is creating the tables for BloggerTest is the same script that created the tables for BlogApp, so why is this a problem? I've also created the database the exact same way.
And to clarify some things so you don't have to ask questions about it:
-- this is my local development laptop
-- no one else is using this machine
-- the tables exist, in both databases
I've looked through these Forum posts for answers and have not found one. I've also scoured stackoverflow and other resources and haven't found and answer there either. Does anyone have an understanding of why this occurs, because at the moment, it's preventing me from creating new databases.
Any help is appreciated. Thanks.