How to log/trace data export in SQL Server 2012 - sql-server

Is it possible to log/trace data exports in SQL Server?
I'm trying to demo that our environment is safe and everything is logged. But when I try to trace (standard template) the data export it doesn't really show in the trace. I can see the query but nothing really shows that the data was exported.
We don't have a dedicated DBA yet so this kind of fell on me.

Related

Cannot Open user default database. Login Failed Visual Studio 2019 for SQL Server

First of all, I am new to SQL Server, I always use PostgreSQL as a database, but now I am doing some maintenance of an application that persists on SQL Server, so here I am. I am trying to debug a very large stored procedured. First I tried on SSMS v18, but according to this I have to use Visual Studio, in which I am also new. I follow the instructions and try to connect to the database, but after I hit a new query I get this modal window:
I find it weird that I can see the database tables, views and stored procedures, but am unabled to create queries. So I am thinking it is a silly configuration thing I am missing.
I would appreciate the help, I have spent the whole day reading tutorials, but nothing works.

BACPAC backups seem to be stuck

I'm trying to export my databases and they seem to be "stuck". I tried to create the first backup but when I went download it, I noticed the file size was 0MB. So I went and tried again and got the error below:
Database export error
Failed to export the database: xxxxx-db.
ErrorCode: 409
ErrorMessage: There is an import or export operation in progress on the database 'xxxxx-db'.
I then tried copying the database into a new database and backing THAT one up. When I checked the database server's "Import/Export History", it shows the following.
It looks like the first backup got stuck at 90% and now it won't even try the second one. And in order to file a support ticket with Microsoft it wants me to pay for a monthly plan. Anyone have any ideas?
When the export operation exceeds 20 hours there is a good chance the export has been cancelled. In this case, scale up the tier of the database before beginning the export. Make sure there is no read/write activity on the database. Make sure all large tables have clustered indexes.
Are you trying to export a database of 200 GB or greater? If that is the case export to local storage.
You may have better experience exporting to premium storage.
Sometimes many users exporting databases on the same region may cause some export operations to take more time. Take a look at this Microsoft Support article.
A workaround that may work in your case, use SQL Server Management Studio (SSMS) to export the database instead of the portal. If you were using SSMS then switch to the portal to perform the export.
1.Open SQL Server Management Studio
Connect to the Azure SQL Server
Right click on the required database, choose "Tasks" and "Export Data-tier Application"

How do I convert Microsoft Access file into SQL Server database?

I want to know how to convert an Access database file into a SQL Server (.mdf file) database?
The MS Access "Upsize Wizard" was discontinued with Access 2012. SQL Server Migration Assistant (SSMA) is now recommended. Reference: https://accessexperts.com/blog/2013/01/30/access-2013-is-here-but-wheres-the-sql-server-upsizing-wizard/
However, as Johnny Bones noted, I found it relatively easy to create a new empty SQL Server (2012) database and then import:
SQL Server Management Studio, R-click on the newly created Database | Tasks | Import Data -> SQL Server Import Wizard
I used "Access Database Engine" instead of "Jet Database Engine" for
no reason other than I GUESSED Jet was older. Mine is a throw-away
project you may want to research the difference.
I 'weeded out' the
Access queries (views) and just imported the tables.
So far it looks
like everything was imported OK.
The simple answer is; you can not "convert" an Access database to a SQL database. You can, however, import the Access database (tables only) into SQL. Remember that SQL is a true database, and, as such, contains no front end or GUI creation mechanisms. You will still need Access (or C# or VB or another front-end builder) to create the interface.
You may already know this, but in SQL Server a Query is called a View, and Modules are called Stored Procedures. You will need to convert your Access queries and modules accordingly if you're planning on having that all reside server-side.
It's actually pretty easy to import Access tables into SQL Server, you would just create a database on a server, right-click on the database name and choose Tasks --> Import Data. There you will choose Microsoft Access as your Data Source. The rest should be pretty self-explanatory.
JonnyBones wrote a good full answer. Other have made suggestions for tools which may work. However, the SSMA (SQL Server Migration Assistant) is likely to be the best option now. (See this youtube video for help with understanding some of the issues to overcome and an explaination of how to use SSMA.
Befre you consider using other tools, which may do more, you should find out why to use them instead of SSMA. Check out the youtube video as a starting point.
Be aware that the MS Access Upsizing wizard was great but is now discontinued, and there was a bit of a gap before MS created a decent version of SSMA, which is when&why these other tools came into existence.
SSMA should do what you need.
There are some access things that do not get moved to SQLServer and some that do.
eg Access triggers do not. Access tables constraints do, Access boolean datatypes so - of sorts - but you need to do some work. The video will explain most issues well.
Harvey
You can try with the Upsize Wizard or copy content of the table from SHOW TABLE DATA and paste to the target table with the same structure as the source.

SSMS reports - using a different Datasource than the server being reported against?

I'd like to build a report in SSMS so that you can click on an object, choose the report, and it queries a data source (not the server you're looking at itself) to return information about that object.
All the SSMS reports I've seen use an empty data source (Data Source=.), so that SSMS runs it against whichever database/server/object you're clicking on. I'm saving historical info on a different server.
I know it's possible; according to http://sqlbg.wordpress.com/2011/03/06/how-to-create-custom-reports-for-sql-server-management-studio/ there are 6 parameters passed. I'd like to run a query against my data source, ideally passing those 6 parameters to an SP on my repository data source.
I took the code in the link above and created an RDL, then imported it into my project (SSDT and BIDS 2005 both; same issue). It works in the Preview mode, returning a dataset from an Embedded Datasource in the report - but when I open the RDL in SSMS, I get "invalid object name "mytablename"' (where mytablename is the name of the table in my query). So it looks like it's not properly using the data source. Profiler confirms this - there's no login to the server at that time.
I have successfully reproduced the problem in SSDT and BIDS 2005 (8.0.50727.4039, Microsoft Visual Studio 2005 Tools for Applications)
Many thanks!
It appears that SSMS will ONLY use the SQL Server you're clicking on as the data source, no matter what you actually use. This is probably for security, but it makes cross-server reports more difficult.
To work around this, I created a linked server (RPC OUT on, collation compatible = true), using a specific user who only had read permissions.
If anyone knows of any cross-server reports that work in SSMS, please let me know - I'd love to know how they did it.

How should I go about transferring data from an ODBC app to SQL on an hourly basis?

I'm trying to pull data from an ODBC app to SQL2005(dev ed) DB on an hourly basis. When I run SSIS the option to import all tables and views is grayed out and forces your to write a query. How would I go about setting up a SSIS integration service to update ALL 250 some tables on an hourly basis.
What kind of database is your ODBC data source pointing to? SSIS might not give you a GUI for selecting tables/views for all DB types.
perhaps you could rephrase your question a little, I am not 100% sure what you are asking here. Are you trying to get data into SQL Server from an application via SSIS with the Data Transform task using an ODBC connection to the Application?
Anyhoo, the simple answer to the MS Access part of your question is "hell no" MS Access is never, ever the answer to anything ;-)
I would be inclined to find out why the tables and views are greyed out and fix that issue. (not enough info in this question to determine why they are greyed out)
You might be better off using the Import and Export Wizard. Go into SQL Server Management Studio, right click on the Database you want to import the data into, and select Tasks -> Import Data. It will launch the wizard which will walk you through defining the import process.
At the end of the wizard you can choose to execute the import, and even save it as an SSIS package which you can tweak later.

Resources