I have created a database using a SPDatabase class.
How can i add a table to it?
and how to execute SQL queries in this database?
Thanx....
Create a seperate, additional database for your custom data to use in SharePoint and just connect it like you do with any ASP.NET database.
Related
What are the best ways to Back up and restore Azure SQL Database schema in Azure cloud?
I have tried creating bacpac files, but problem with that is, it will be imported as a new database. I want to back up and restore specific schema only within the same database.
Another way i am looking at is creating a sql script file which contains data and schema using SSMS. But here size of the sql script is huge.
Any help is greatly appreciated
We can use bcp Utility for exporting and importing the data in a fast way.
I want to back up and restore specific schema only within the same
database.
There is no native tool for Azure SQL Database that can do backup/restore of some certain schema.
The closest one to the requirements is a bacpac, however it can restore data into the empty or in a new database.
Therefore, a possible option is to move data out and then in using ETL tools like:
SSIS
ADF
Databricks
I have to querying two tables from two different databases in Azure SQL. Is there any option available in azure?
If your database are Azure single databases, maybe you can use OPENROWSET (Transact-SQL). It now support Azure SQL database.
Includes all connection information that is required to access remote data from an OLE DB data source. This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. For more frequent references to OLE DB data sources, use linked servers instead. For more information, see Linked Servers (Database Engine). The OPENROWSET function can be referenced in the FROM clause of a query as if it were a table name. The OPENROWSET function can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement, subject to the capabilities of the OLE DB provider. Although the query might return multiple result sets, OPENROWSET returns only the first one.
Hope this helps.
I have an Azure database (using SQL Database), and also a separate device that measures floats (not relevant to the question).
As and when the data is being updated, say once every 5 minutes, I wish to update the database so that a new row is being formed with this data. I then intend to connect to PowerBI using the Azure database to form graphs etc.
As mentioned in the title, what would be the best practice? I have done my due diligence and it seems that the best way would just be to update the Azure database. Or should I consider updating a CSV file, then connect the CSV file to the Azure database and update it from there?
Reason why I'm considering to go the CSV file route is because I see that Excel has in-built refresh function, but I couldn't find anything from the Azure side.
https://support.office.com/en-ie/article/refresh-an-external-data-connection-in-excel-1524175f-777a-48fc-8fc7-c8514b984440
If you want to use Excel, you can see this Azure official document: Connect Excel to a single database in Azure SQL database and create a report.
Connect Excel to a single database in Azure SQL Database and import data and create tables and charts based on values in the database. In this tutorial you will set up the connection between Excel and a database table, save the file that stores data and the connection information for Excel, and then create a pivot chart from the database values.
Then, you can use the "Refresh Data" and try the tutorial you have found.
Hope this helps.
I created an SQL database using ASP.NET Core 1.1 Migrations.
After I created the database I added some data to the database.
What options do I have to upload this database to Azure?
I need to send the Scheme and the initial data.
Is it possible to run Entity Framework migrations on Azure?
This article describes the possibilities to migrate an existing database to SQL Azure.
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate
However, in your scenario, this might be overkill to go through the steps of realy doing a migration.
If your number of tables and data is rather small, why not create a SQL script to create the tables & insert the data?
Connect to your SQL Azure using SQL Server Management Studio and execute the script.
As for the Entity Framework, yes, you can run those on SQL Azure as well.
I created SQL Azure Database and made connection with database using SSMS. When I create a table I have to save it somewhere and no matter where I save it I can't see a table in Object Explorer and cannot link to it with Query. Am I missing something?
It was my problem, I never runed query just tried to save table on my laptop..