Cannot Select a table through a query even though it is fully available - sql-server

I am using MSSMS to try and look at a new db for work. My coworker is having no problem querying the db and its tables, and we have tried refreshing object explorer, deleting and recreating the db, refreshing the cache on intelliSense and dragging the table directly into the query but it is saying that the table name is an invalid object name. I can view whats in the table if I right click and select the top 1000 but I cannot query anything. I have also tried selecting it by doing the "dbo." before the table name. Any ideas on why this would be happening and what to try is much appreciated.
Here is the proof that it is in the db
Here is my simple query

Related

Right click to query temporal tables not working

I have SQL Server Management Studio 2016 loaded with Microsoft's test database (WideWorldImporters) but for some reason, any table that is a temporal table does not give me the option of right clicking and selecting the last 1000 rows as all other non-temporal tables allow.
Am I missing something which needs to be installed or is there an alternative way of querying the table for data?
Right Clicking does not work. But in the session that created the table you can do any kind of query that can be done against any other table.

EntityFramework wants to delete a table from my data model that is very clearly in the database. Any ideas why?

I am attempting to update my EntityFramework data model from a SQL 2008 database to add a couple new tables. There are at least 100 other tables in the model and they are all fine and slated to be refreshed, but EF keeps insisting that this one table does not exist in the database, even though I am looking right at it and can select from it, and adds it to the "Delete" list. The connection string is correct and the columns inside the table match what is currently there. Any idea why this might be happening and how I can fix it?

Update Model From Database doesn't add new table from database

I have an ADO.NET Entity Data Model created. Everything worked fine, until I added new table in my database. So I wanted to add that table to my data model. I followed these steps: Right click on my model -> Update From Database. Than the wizard opens where I chose what I want to add. When I expand tables tree, my table which I have added to my database is there. I check it and click finish. No errors, everything is successfully done, but there is no any changes on my model. The table is not added to my model. Does anyone know why is this happening?
When EF complains about certain things (i.e. missing pk) after adding tables to your model trough the "update database" wizard, it does not produce an error or a warning but a message in the error list window. make sure have have checked that. in my case EF was complaining about tables with no primary key defined.
Try saving the updated model and then reopening it. I added two tables and although the designer view had a * on it (indicating it was changed), I couldn't see my new tables. On a hunch I closed and reopened the model and the tables were there. This is in VS 2017.

Dynamic Data website only displays rows that it inserted to DB

I'm pretty new to creating dynamic data websites - I created one a year ago that is working fine but now I'm trying a 2nd one and having a strange problem.
I'm using VS2010, VB.net & followed MS's waltkthrough for creating a web site using Linq to SQL. Things seem to be working with one MAJOR exception. I've pointed it to a SQL server in my domain but it won't display rows from the DB that were not created through the website. Records that I manually enter through SSMS do not show in the DD List for the table, but rows I inserted thru the website do appear.
I have cleared the table and refreshed the list view and all rows disappear. Then if I add rows via SSMS they do NOT show up but website added ones do. This is important because I'm going to be importing data from an old (non SQL) DB that I'm converting.
I really don't know where to look to resolve this - Does anyone have any ideas?
Thanks!
The records I entered thru ssms had bad values for a foreign key and evidently DD is doing inner joins instead of left outer. I don't know if that is a bug or a feature.

Visual Studio DataSet Designer Refresh Tables

In visual studio datasource designer is there any way to refresh a table and its relations/foreign key constraints while keeping the custom queries?
The way I am doing it at the moment is removing the table and adding it again. This adds all the relations and refreshes all fields.
Also if I change a fields data type, is there a way to automatically refresh all the fields in the datasource? Again without deleting the table and adding it again.
Reason for this is because some of my TableAdapters have quite a number of complex queries attached to them and when I remove the table the adapter gets removed as well including all its queries.
I am using Visual Studio 2008 and connecting to a MySQL database.
Any1 have an idea?
Each table has a default query (The one on top with the check on it). When you dragged your tables in to the dataset to create the query, it wrote a SQL statement which it uses to schema your table. Keep that query simple, you might not actually use it in code, and you can always edit that query to update the table schema.
Every time you open the default query it connects to your datasource and allows you to select new columns that weren't in there before. If you want to update your existing columns, delete all the columns out of the table before you attempt to open the query. When you save the query, your updated columns get added back.
Make sure your connection string has permissions to view column information.
I reported this to MSFT but no response. The designer hangs all the time on the simplest of SQL statements. What I found that works for me is.
Add a new table to the designer.
Save it.
Shut down visual studio 2010.
Start VS 2010.
Add one or two more SQL statements and follow steps 2-4 again.
This is a pain in the neck but the only thing that stops Visual Studio dataset designer from hanging. I experienced in this same issue in VS 2008. I am connecting to Oracle but still shutting down VS and starting it back up works, but really, this is nonsense.
You can add/change/remove fields and relation ships, but i would suggest looking into NHibernate.
You should be able to right-click the dataset in solution explorer and select "Run Custom Tool" to refresh the table and it's query/relationships.
If that command is not there, check that the dataset properties has "MSDataSetGenerator" in the Custom Tool field.
Right click on your DataSet name and select Dataset Properties
Below the Query box you will see a button for Refresh Fields.
Click on Query Designer and the new field should show in your table list.

Resources