SSMS new data is not showing - sql

I am using SSMS 2012 express and I have got into some case, maybe you can help me.
I am running a simple script like:
select * from table.
The table gets new data every day by some service. But I can see the new data only if I would reconnect to the database or refresh the tables.
Otherwise I don't see the new data.
What could be the issue

Related

Adding new data to the end of a table using power query

I've got my query that pulls data from sql server 2012 into excel using power query. However, when I change the date range in my query I'd like to pull the new data into my table and store it below the previously pulled data without deleting it. So far all I've found is the refresh button, which will rerun my query with the new dates but replace the old. Is there a way to accomplish this? I'm using it to build an automated QA testing program that will compare this period to last. Thank you.
This sounds like incremental load. If your table doesn't exceed 1,1 Mio rows, you can use the technique described here: http://www.thebiccountant.com/2016/02/09/how-to-create-a-load-history-or-load-log-in-power-query-or-power-bi/

"Select data source" popping-up when executing a SQL writed query

I try to create a pretty complex database on ms Access 2013, so I wanted to type it directly in SQL. It has no errors, as other DBMS can fully build the database from the script I wrote (for example, phpmyadmin imports it with no difficulty).
On this tutorial, it is showed how to write a SQL query in order to build tables. I thought this way matched well with my goal as I could copy-paste my script in the query and run it to create the whole thing.
But when I tried to open/double-click on the query a pop-up appears saying "Select data source", waiting for me to select an ODBC, either from a file or a host, before continuing and executing the query.
I tried other types of queries (creating only one table at time, trying on a blank file, or even SELECT * FROM *), bt this message keeps showing up and I really don't know how to deal with it as I don't want to connect to anything but the infile database.
Does anyone got a hint about what to do in this case?
Or, even better, how could Access import my SQL script in order to create the database?
You should configure the database connection in the ODBC and check whether the connection is established or not. Once the connection is established, you can run the query to fetch the data or create tables as per your requirement.

Vb sql Accept Changes

I have made a SQL table within Visual Basic 2012.
I then made my dataset for inserting data.
I made a form and linked it to the table adapter and when the program is running it allows the data to be added to the table but when I reopen the application that data is not there.
I have tried two acceptchanges but they don't work. So it is not saving it the data that is in the "temporary table".
Me.TableTableAdapter1.InsertQuery(TextBox1.Text, TextBox2.Text, Dropdownseats.Text, dropdriver.Text)
BusesDataSet1.Table.AcceptChanges()
BusesDataSet1.AcceptChanges()
Does anyone one know why this is happening?????
*Changed the database to MS Access and I am still having problems. *

SQL View displaying incorrect data while the same sql code run in a query window gives correct data

One of my SQL view when opened and run in a design window gives incorrect data while the same underlying SQL code is run in a new Query window gives correct data. To be more specific, this view is pointing to a table where data changes on a daily basis. Why am I getting stale data in the design view while the same (same view underlying sql) code run in a Query Window gives current data. This has never happened before. There is a excel sheet that connects to this view to pull data into reports and this is getting the stale data into the report.
What should I be looking at to fix this issue.
And the server is SQL Server 2008 R2 (SP1)
Any help is appreciated. Thanks in advance.
You probably use * in your view to select all columns from some table
select * from table
when you add a new column to that table you'll need to re-run the view, then it'll work... select *, especially in view is generally considered a bad practice. In the case of a * metadata is not automatically updated when the tables (or schema for that matter) used in view are modified, therefore you'll need to alter the view
another way of refreshing it is running system stored proc:
EXEC sp_RefreshView vw_ViewName

Duplicate table on 2 different servers (MS SQL 2000/2008)

Ok here is the thing:
I have an old MS SQL 2000 server, and this one will keep running.
however for a new website i have a SQL 2008 server.
I need 3 tables from the old server (lets call it www.oldserver.com) to be on the new server too. the data on the old server still changes daily.
I would like to update the tables immediately when something changes on the old server.
how do you do this. i looked at mirroring but that doesnt seem to be the way to go, now i've checked Import function in SQL Server management studio, but i dont want to import the data all the time. 1 import, then updated like daily are ok. so i guess i need to 'write a query to specify the data to transfer' but i have no idea how that query should look.
the import will go to a SSIS package so it can be scheduled.
what is the best practice here? how should i do it?
You could set up the old server as a Linked Server in the new server.
Then, you could create the tables on the new server not as tables, but as views, directly selecting from the tables on the old server.
Like this (on the new server):
create view OldTableOnNewServer as
select * from OldServer.OldDatabase.dbo.OldTable
Advantages:
no replication/updating necessary -
the data comes directly from the tables on the old server
Disadvantages:
Network traffic: each time someone
selects from the view, the new
server will access the oldserver
over the network
Availability: if the
old server is not available, the
views on the new server won't work at all