Windows Azure SQL Database Collation - azure

How can I change the collation of my Azure SQL Database? I need to change it to Latin1_General_CI_AS
Thank you!

SQL Azure v12 supports altering the data collation of the database.However the catalog collation is fixed and cannot be altered

You cannot change the collation of a SQL Azure Database at the server level:
http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx#sscs
You can change it when creating the database initially.

Here is how I went about changing the default collation.
1) Create New Database Instance from the Portal with the proper Collation
2) Export Schema from Source and Apply To Destination
3) Disable all constraints
4) Using SSMS Import Wizard, copy all data from the old instance to the new instance. This was extremely fast for me, as both instances were on the same server.
5) Re-enable all constraints
All columns picked up the new default Collation. I went from CI to CS.
You can then rename the databases or just reference the new instance.
To check your columns, you can run this cmd before and after.
SELECT c.name, c.collation_name FROM SYS.COLUMNS c JOIN SYS.TABLES t ON t.object_id = c.object_id
Note: The import wizard doesn't copy everything; e.g., Users.
and this might not work for you if you specified a column level collation.

Related

Azure SDK - Copy Azure SQL database Schema only through code

Currently use the Microsoft.Azure.Management.Fluent libraries in our solution to create copies of Azure SQL databases - works well:
await server.Databases.Define(databaseName).WithExistingElasticPool(elasticPoolName).WithSourceDatabase(source).WithMode(CreateMode.Copy).CreateAsync();
Is there a way to do the same thing but only copy the schema - no data rows?
I was hoping for a WithMode option but nothing stands out in the documentation.
Thanks much in advance

Manual Azure Backup Cosmos DB

Tried to export data in CosmosDB but it was not successful. According to https://learn.microsoft.com/en-us/azure/cosmos-db/storage-explorer, by using this tool I can export the data inside the cosmosdb, but no option to export. Tried to do the instructions here https://azure.microsoft.com/en-us/updates/documentdb-data-migration-tool/ and https://learn.microsoft.com/en-us/azure/cosmos-db/import-data#JSON, but error is being encountered.
Can you help me how to do this in Data Factory or any steps just to manual backup cosmos DB?
i tried doing the backup through azure data factory but data factory can't seem to connect to cosmos db, it's so weird 'cause the primary string/secondary string that I used is in the details of the cosmos db
Thank you.
Can you help me how to do this in Data Factory
According to your description,it seems you have trouble with export data,not import data. You could use Copy activity in ADF which supports cosmos db connector.For you needs,cosmos db is source dataset and please add one more sink dataset(destination). Such as some json files in the blob storage.Just make sure you configure right authentication information with your cosmos db account.
ADF is more suitable for the batch back up or daily back up.
or any steps just to manual backup cosmos DB
Yes,Storage Explorer is not for exporting data from cosmos db,Data migration tool is the suitable option.Please install the tool and refer to some details from this link:https://learn.microsoft.com/en-us/azure/cosmos-db/import-data#export-to-json-file
DMT is more suitable for single back up.Surely,it also supports execution in the batch if you use command line to execute it.
Cosmos DB Data Migration tool can be used to export data from Cosmos DB.
Refer https://learn.microsoft.com/en-us/azure/cosmos-db/import-data#export-to-json-file
this one worked for me... since my SSL in my Macbook did not work, I did these steps from the Azure VM that I created.
Steps:
Download MongoDB Community Server Client tool as per your OS version and MongoDB compatible version.
(Or you can download [v3.2.22 for Windows X64] directly at here, please don’t download the version beyond 4.2 as it’s incompatible)
After installing the MongoDB client tools, go to the installation directory -> go to the subfolder “bin” containing the mongoexport.exe, then issue below command to export your data:
mongoexport --host=: -u= -p= --db= --collection= --ssl --sslAllowInvalidCertificates --out=
Note 1: You can find the , , and in Cosmos DB Portal – “Connection String”

Cannot connect to Azure SQL Data Warehouse database-error "Incorrect syntax near 'ANSI_NULLS'"

I could successfully deliver the new Azure SQL Data Warehouse database.
If Í try to connect to the SQL Data Warehouse Database, I receive following error message:
"Parse error at line: 1 ,column: 5: Incorrect syntax near 'ANSI_NULLS'".
This happens in VS 2013 and VS 2015! The data load process with BCP to the SQL Data Warehouse database was successfully!
Thanks, Herbert
Azure SQL Data Warehouse does not currently support setting ANSI_NULLS on (SET ANSI_NULL ON). You can simply remove that statement from your query and you should have success.
Additionally, make sure that you are running the June 2015 Preview of SSDT (http://blogs.msdn.com/b/ssdt/archive/2015/06/24/ssdt-june-2015-preview.aspx). This has the supported SSDT capabilities for SQL Data Warehouse.
I had the same error, when tried to Use Visual Studio to query Azure SQL Data Warehouse 
 and selected my database.
The Workaround was to select master database, connect to it, then in top drop-down for the query change to my database.
I think your connection isn't actually recognised as a SQL DW connection. I bet your query window is a .sql file, not a .dsql as it needs to be. If you connect as a .sql query, it will try to set various settings that aren't supported.
Go back into the Azure portal and use the link to connect using SSDT from there. You should get a connection in the SQL Server Explorer pane which looks different, and when you start a New Query based on it, you should get a .dsql window, not a .sql one.

change collation of DB SQL Server 2008

I have created some new databases in SQL Server 2008 Express (10.0.1600.22) and I have also restored one from SQL Server 2005 Express (9.00.1399.06).
The collations for these are different and I cannot execute queries across them as a result. So I am trying to change the restored database collation
from: SQL_Latin1_Genral_CP1_CI_AS
to: Latin1_General_CI_AS
However the new collation does not appear in the list of options. Not sure if this is possible.
BTW - workarounds that are not options:
I cannot script the data from sql server 2005 express (it seems - I may be missing something)
I cannot script the DB on 2K8 server as I get an out of memory exception when doing that :-(
If the collation is visible for other databases on your instance but not this specific one restored from a 2005 instance I wonder if the list displayed is dependent upon the databases compatibility model.
Maybe try changing the compatibility mode of the restored database to 100 to see if it appears in the list of options.
Note changing the database collation will not affect existing columns. Here's a script that may help with that.

How do I change the database provider in Orchard?

After doing a test install of Orchard 1.0, I've decided I want to use regular SQL Server instead of SQLCE. How do I change the provider? And, how do I re-run the database setup?
Best thing to do is to delete all files from under your App_Data folder in Orchard.Web, this way you can start fresh :)
Edit app_data\default\settings.txt.
You should change the settings.txt, located in App_Data\Sites\Default.
In this file, the connectionstring and provider is stored as plain text, like so:
Name: Default
DataProvider: SqlServer
DataConnectionString: Data Source=server;Initial Catalog=dbname;User Id=username;Password=password;
If you are using the SqlCe DataProvider, the connectionstring will be null.
Change it to the appropriate connectionstring and change the DataProvider to SqlServer. Once this is changed correctly, you'll be able to use the supplied SQL Server.
To migrate the data from SQL CE, I've used this VS2010 plugin as you can't connect to those DB's yet out of the box: http://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1/
Hope it'll be of any use to you as deleting the App_Data folder will give you a lot more work.

Resources