Equivalent to Linked Tables in MS Access on SQL Server - sql-server

After searching I did not find answer to my question.
If I have linked table in Microsoft Access I have table updates every time if data changed.
I am now using SQL server and I have a stored procedure collecting data from many tables. I want this procedure to be executed once and the results to be stored in a table, or update if the data has changed.
How can I achieve this in SQL Server?

Related

Using a SQL Server openquery to query a linked DB2 server table using conditions based on a SQL Server table

I have a result set I need to pull in from a linked DB2 server table into SQL Server. The table is huge, and I don't want or need to pull the whole thing, I only need the records for a handful of users. The problem is the User IDs are stored in a SQL Server table, not on the DB2 table. While I have select privileges on the DB2 server, I cannot create a table there, so as far as I'm aware I cannot upload the table with User IDs onto the DB2 server. Is there a way to limit the result set pulled from the DB2 server on the User IDs stored in the SQL Server table?

Execute stored procedure on multiple linked servers vs separate connections

I have to get some data from multiple databases using stored procedures. I am using SQL Server 2008 R2 and 2014.
I could have each stored procedure on his own server, or all procedures on a single server with linked servers to the rest of databases.
I am wondering on the pros and cons for each method in the terms on performance, as the returned data on a daily basis use will be around 2000 rows, but it could reach at a maximum ~30000 rows.
The best practice is that each stored procedure execute on his own server. Even you will call all procs from one server with linked server.
When you call a procedure that contains a linked server the data is load before the processes begin. But you call a procedure through the linked server the proc will process on the own server before answer you.

Run PostgreSQL stored procedure from SQL Server

I have a database in SQL Server which contains collected data during one day, and a database in PostgreSQL with OSM data. I need to modify collected data in order to create reports for my users.
Now, I imagined that somehow call PostgreSQL procedure from SQL Server, pass collected data to PostgreSQL, do something with that data, and return another result set to SQL Server for creating reports.
What is the 'most efficient' way for achieving this? OR, better question atm, what is the way for achieving this functionality?
My idea is to connect SQL Server and PostgreSQL with PostgreSQL ODBC driver, then copy data from SQL Server to PostgreSQL table, run that stored procedure on PostgreSQL, and return data to SQL Server result table. But, it is not scheduled task. Data to be transferred to PostgreSQL contains latitude, longitude and bearing for about 2-3 million of rows and function which analyses them requires one per one record, not all at once.
My way is using C# and npgsql to connect to postgres.
I create an app:
check SQL Server every min.
check Postgres for the last id inserted.
create a dataset from MSQL with the news ids
insert the new records into Postgres.
run postgres store procedure to generata new data
create separated webservice to consume the report generated on postgres.

update a column of table in sql server from ms access

I have a table in sql server, and another table in ms access. The two tables are different tables. but one column in sql server need fresh data from the table in ms access. Is that possible that when ms access have update or new record, the table in sql server will be updated automatically.
Absolutely yes! Just link the SQL Server table in Access via ODBC (after setting up a DSN). On ribbon, see External Data tab (ODBC).
Then, run an append and update query in the After Insert or After Update VBA trigger event on form from the local table into the linked table.

Join two different types of databases together

I have two databases, one MSSQL and the other in Access.
Right now, inside the access file, the mssql tables are set up as linked tables so queries can be written using tables from both databases. (e.g. "select * db1.table1 where db1.table1.somevalue not in db2.table1", or select into tables like that one)
These queries need to be moved into a VB.NET project, but still be linked to the access file.
I think what I am needing is a Database object that can have tables from 2 different connections, (ie the SqlClient and OleDb connections)
Is this possible? If so, how? Or do I need to rewrite the queries using loops or something?
What I would do is query your access database to get some result set and that pass that result set as a parameter to a stored procedure in your MS SQL database. You would just have to transform your results from access into XML to be passed as a xml variable as a parameter. And then in your stored procedure you can convert the XML to be a table variable and you can use it just like a regular table.
THere is no reason you can't create an MS Access .mdb with Links to your MS Access Database and your SQL Server database
Access Db #1 Contains Access Tables and Data.
SQL Db Contains your MS SQL Tables.
Access Db #2 contains links to the tables in Access DB #1 as well as links to the tables in your SQL Server Db. This .mdb files ALSO contains your query defs required by your vb.net project.
I'm pretty sure you can just connect to the Access database. All the internal objects--including the links to SQL Server tables--should be accessible to your vb.net project.

Resources