Empty dataset when querying sql server VIEW from excel 2013 - sql-server

When querying sql server view data (it does work when I query a table), I receive only the header but no rows. In sql server profiler I can see that the sql statement looks correct (and I get data from the view when I execute the statement in sql server management studio) but the read and cpu counters are minimal compared to a direct query. There are no linked servers involved, username in profiler is the same for both access methods.

One of the subviews was filtering using for APP_NAME()... which is "Microsoft Office 2013" when one queries from Excel and "Microsoft SQL Server Management Studio" when using SSMS. This cleary explains why Excel did not get any rows...sorry for bothering.

Related

Visual Studio Community: how to view data or run SQL in the "SQL Server Object Explorer"

You can "explore" the schema etc. using the SQL Server Object Explorer in VS.
However, I can't find a way to view the data in a given table (at least the first page), or to run some arbitrary SQL.
Is this possible?
I also have the full blown Microsoft SQL Server Manager installed, but this can't "see" the databases created by Visual Studio in its built-in SQL Server Express instance. It can only connect to its own full blown SQL Server databases.
I have looked for a tool to view data in SQL Server Express, but have not found anything yet. There does not seem to be a version of Microsoft SQL Server Manager for SQL Server Express unfortunately.
You can do a "New Query" on any database node to run a query window:
And then you can do a "View Data" on any table, in SQL Server Object Explorer:
But you should also be able to load any "LocalDB" instance and view it from the full-fledged SQL Server Management Studio (at least since SSMS v17, where it's a separate, free download)....

Move MS Access tables to be used in SQL Server

I'm using MS Access 2013. I have a some tables which I would like to migrate to SQL Server 2012 (Management Studio). I want these tables to be used in SQL Server for addition etc., but I also want these tables to show as 'linked' in MS Access.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server?
The Migration tool in SQL Server did not give me my desired results.
I'm not sure why you want to move it to SQL server from Access. If you say it is just for addition purposes, that is a really bad idea to move from Access.
You will need to create a shell database in SQL Server.
From Access select > External Data > More > ODBC Database and follow the prompts to export the data into SQL Server.
After that select > External Data under Import and Link > ODBC Database
This will link the local Access table to the SQL Server table and you will be able to run queries you require.
Create Database in SQL Server https://msdn.microsoft.com/en-us/library/ms186312.aspx#SSMSProcedure
Migrate Data from Access to SQL Server. For Access 2013 you will need to use the SQL Server Import and Export Wizard. Search the start menu for "Import and Export Wizard". It comes installed with SQL Server. For the data source choose Microsoft Access and follow the steps.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server? Create a linked table via ODBC connection. https://support.office.com/en-us/article/Import-or-link-to-SQL-Server-data-a5a3b4eb-57b9-45a0-b732-77bc6089b84e

Want to have a SQL Server run query against a SQL Anywhere DB on another server

I have a SQL Server 2012 database on one server, and a SQL Anywhere 12 database on another server. I want to schedule a nightly select query that pulls data from the SQL Anywhere DB to the SQL Server DB.
This is all easily done between two SQL Server databases, even on different servers, but I have no option for "Microsoft OLE DB Provider for SQL Anywhere" and everything I find on the subject seems to assume that both the SQL Server and the SQL Anywhere DBMS are on the same server. That is not an option for me.
Is there some way I can get and install just what is needed on the SQL Server system to let me get the SQL Anywhere provider option? Legally and without involving additional licensing?
Microsoft OLE DB Provider for SQL Anywhere is exactly the right one.
This creates the necessary installer:
Start Menu\Programs\SQL Anywhere 16\Administration Tools\Deploy to Windows
Then just install it on the SQL server and you're ready to go.

Find all queries which returns a particular text in sql server

I am using sql server 2012. I want to search all the queries in all databases of a server which returns this text ("ca040"). I am using SQL Server Profiler with filtered TextData.
But it is not showing any results. Have I gone for the correct approach?

Using Linq to query linked server in Visual Studio

I'm trying to use Linq to run queries against a linked server on our SQL Server machine through Visual Studio.
On the SQL Server, I've successfully created the linked server and can run queries on it. In Visual Studio I've added a new data connection (under Server Explorer) to the SQL Server with success but the linked server tables are not available.
How can I get the linked server tables to show up? Or can I even do this?
I usually create a view in a local database for each table I access through a linked server. That allows me to change the links as needed without having to change any SQL. And you should be able to use the view in LINQ to SQL without issue.

Resources