I'm trying to set up a prediction service for my database, I'm using OPENQUERY to ask the SSAS for predictions on my datasets. So far everything has worked fine but when I tried to scale the service I ran into some problems.
My MSSQL database server is linked to my SSAS database server using a Linked Server construction. (Linked_AS)
I've run into the problem that I cannot seem to specify a specific SSAS database that I would like to select my mining structure from. The DMX syntax simply doesn't seem to support it.
For reference here is the select query.
SELECT * from OPENQUERY(Linked_AS, 'SELECT flattened top 1 timeindex FROM fillpercentageDaily.CASES
order by timeindex desc'));
This query runs fine but seems highly ambiguous as there is no way for me to determine which database it is selecting from.
Workaround I can think of:
Making sure that all of my mining structure names are unique across all databases.
However this does not seem practical. Is there anyone that has some insights?
Related
I have to connect multiple tables that are part of single or multiple databases. Approximately 10-15 tables in each query have to be connected to generate data for the analysis in SQL Server 2014.
I don't have access to the database diagram or architecture and these reports are to be sent out weekly. I want to understand the approach on how to begin writing these kind of queries which are of basic and advanced level and identify the relationship between tables and what kind of advanced level queries I can learn or utilize like CTE, Rank Partition, Subqueries etc.
Anybody who can provide a rough flow diagram or structure about the approach will be really helpful.
It's very unlikely that owners of those source systems want to be directly queried every time someone runs a report. Since you already have access to SQL Server, I would suggest building a data warehouse with that.
You haven't provided a whole lot of information to go on, but SSIS packages could be created to connect to the source systems and load into your data warehouse. And furthermore, those packages can be scheduled through Agent.
As for modeling... Again it is difficult with the lack of information, but generally the star model works great for reporting, which is a fact table surrounded by dimension (or attribute) tables.
As for figuring out relationships without a diagram, this will have to be done via experimentation and tieing to existing reports to make sure your joins aren't dropping records or cascading.
Good luck.
I have migrated an 2010 Access DB tables to SQL Server 2012 and linked them to the Access FE. I have pass through queries with return record set to no. I use the final result table which are linked in the FE of access for reporting purpose.
Each reports has no. of queries which are SQL pass through queries, which are run when the report selection Mass run is done.
I have tested each query individually and they work fine.
Scenario 1 :
If I keep the access local tables and use the linked source tables for loading the final table , it works fine but they take an enormous amount of time. This was one reason for migration.
Scenario 2:
When I use the approach I mentioned in the description , I get a error stating "ODBC_failed"
SQL Native Client 11.0 Each Group by expression must contain at least one column that is not an outer reference. I have gone through each query for checking the group by error. I have even removed the query referencing the group by , but I still get the same error.
I have been researching from almost a week , I tried a lot of suggestions and now I'm at the dead end, The error is not helping in any way.
I would really appreciate if someone could suggest me with some tips.
I have many SQL Server databases, each with a few tables containing important (from my point of view) information. I check the data (retrieving for example maximum or minimum value) within those tables using T-SQL queries.
Since I don't want to create views for each of the databases, I'm thinking about most convenient, easier and simply the best way to prepare summary which will be updating each time when opened.
The output file (or web page) will be used internally within technical team. All members can log into database using Windows authentication.
My idea was:
Excel + dynamic T-SQL --> I want to connect to database and execute T-SQL (cursor will go through all database names)
PowerShell (showing table using Out-GridView cmdlet)
PHP - first I will ask about all database names (executing select name fromsys.databases` and then execute query for each DB)
What is in your opinion best way? Do you have any better (from programmers point of view) way of getting such report/data?
You can use SSRS Reports .You have the options of exporting the report data to several formats such as pdf ,excel ,word .You can create a dataset for all your database .Since you are interested in showing aggregation and summation of values ,SSRS reports will be pretty useful in these cases .
I need to transfer certain information out of our SQL Server database into an MS Access database. I've already got the access table structure setup. I'm looking for a pure sql solution; something I could run straight from ssms and not have to code anything in c# or vb.
I know this is possible if I were to setup an odbc datasource first. I'm wondering if this is possible to do without the odbc datasource?
If you want a 'pure' SQL solution, my proposal would be to connect from your SQL server to your Access database making use of OPENDATASOURCE.
You can then write your INSERT instructions using T-SQL. It will look like:
INSERT INTO OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=myDatabaseName.mdb')...[myTableName] (insert instructions here)
The complexity of your INSERTs will depend on the differences between SQL and ACCESS databases. If tables and fields have the same names, it will be very easy. If models are different, you might have to build specific queries in order to 'shape' your data, before being able to insert it into your MS-Access tables and fields. But even if it gets complex, it can be treated through 'pure SQL'.
Consider setting up your Access db as a linked server in SQL Server. I found instructions and posted them in an answer to another SO question. I haven't tried them myself, so don't know what challenges you may encounter.
But if you can link the Access db, I think you may then be able to execute an insert statement from within SQL Server to add your selected SQL Server data to the Access table.
Here's a nice solution for ur question
http://www.codeproject.com/Articles/13128/Exporting-Data-from-SQL-to-Access-in-Mdb-File
I've inherited a clunky and horribly un-documented site from a bad developer and am trying to get a look at the database schema. Unfortunately the web host is the worst I've ever dealt with and has no control panel capability for viewing the db schema or even exporting tables.
Is there any way that I can get a look at the schema via a SQL query (this would be with ASP + SQL Server)? My end goal here is to see what tables exist, possibly get a SQL dump of the vital tables, and then recreate the whole thing the right way.
The INFORMATION_SCHEMA schema is a good place to start:
SELECT * FROM INFORMATION_SCHEMA.TABLES
SELECT * FROM INFORMATION_SCHEMA.VIEWS
...and so on.
You might also want to have a look at using SMO, an API to get at the metadata in SQL Server.
I'm not sure if simple queries like
SHOW TABLES;
DESCRIBE table_name;
SHOW TABLE STATUS from table_name;
are valid in MS SQL. They would also be useful
SchemaSpy http://schemaspy.sourceforge.net/ is a great tool for analyzing existing databases. It generates html lists of table and constraints as well as a graphical representation of relationships