azure-sql-database

Performance tuning on INNER JOIN with BETWEEN Condition

可紊 提交于 2019-12-17 21:11:16
问题 I have two table's namely tbl_Small and tbl_Large . Both the table's I have stored in Microsoft Azure and querying from Microsoft SQL Server . --Table 1: Tbl_Small CREATE TABLE tbl_Small ( cola int ); INSERT INTO tbl_Small VALUES(1234),(123),(34); --1000 rows --Table 2: tbl_Large CREATE TABLE tbl_Large ( ID bigint identity(1,1), cola int, colb int, colc varchar(100) ); INSERT INTO tbl_Large(cola,colb,colc) VALUES(0,140,'A'),(150,200,'C'),(1000,15000,'D'); --30 million rows I want to get large

ODBC Driver 13 for SQL Server can't open lib on pyodbc while connecting on AWS E2 ubuntu instance

半城伤御伤魂 提交于 2019-12-17 19:21:48
问题 Background: i have been at it for about a week but still no luck. the same driver (13.0) on my system (Ubuntu 16.04.1 LTS) works just fine with my pyodbc python (Python 2.7.12 :: Anaconda 4.1.1 (64-bit)) library. i tried setting up a virtual machine on AWS E2 but it does not work there as described below. Objective: Connect to Azure SQL Server using Python 2.7.12 :: Anaconda 4.2.0 (64-bit) with official ODBC Driver from Microsoft on Amazon Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-53-generic x86_64

How to reset identity seed in Sql Azure

坚强是说给别人听的谎言 提交于 2019-12-17 16:55:24
问题 I have tried the following in order to reset my Identity Seed of a column: DBCC CHECKIDENT ('dbo.Stuff', RESEED, 0) This does not work in sql azure, I was wondering what would be the best way to go about doing this. Drop and recreate table? 回答1: As you have seen, DBCC CHECKIDENT is not currently supported in Windows Azure SQL Database. The most complete way to reseed the identity would be to create a new table with the same structure, and set the identity to the Reseed value IDENTITY

Can't query between databases in SQL Azure

家住魔仙堡 提交于 2019-12-17 16:27:14
问题 I have a SQL Azure Database Server and I need to query between the Databases but can't figure out how to accomplish this. Here is the structure of my databases: Server.X Database.A Database.B Database.C In Database.A I have a Stored Procedure that needs to retrieve data from Database.B . Normally, I would reference the database like SELECT * FROM [Database.B].[dbo].[MyTable] but this does not appear to be allowed in SQL Azure. Msg 40515, Level 15, State 1, Line 16 Reference to database and/or

I need to add a linked server to a MS Azure SQL Server

末鹿安然 提交于 2019-12-17 09:39:55
问题 I have tried and tried, and can not get linked. I can connect to the server using SSMS, but can not link to it from a local server. Here is my script (replacing things in brackets with pertainent information): EXEC master.dbo.sp_addlinkedserver @server = N'[servername].database.windows.net', @srvproduct = N'Any', @provider = N'MSDASQL', @datasrc = N'Azure_ODBC1' GO EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'[servername]', @useself = N'False', @locallogin = NULL, @rmtuser = N'

Azure Data Factory mapping 2 columns in one column

China☆狼群 提交于 2019-12-17 06:55:49
问题 Can somebody help me solving the error am getting in concatenating the two columns i.e first name and last name from my text file and merging the two columns into one name column in my Azure SQL database as a sink in Azure Data Factory and another question is that I want to choose the first letter of the column gender that is M or F for male and female respectively from the source text file and changing it to one letter M or F in my gender column in the Azure data factory pipeline enter image

Optimal way to concatenate/aggregate strings

做~自己de王妃 提交于 2019-12-16 20:05:28
问题 I'm finding a way to aggregate strings from different rows into a single row. I'm looking to do this in many different places, so having a function to facilitate this would be nice. I've tried solutions using COALESCE and FOR XML , but they just don't cut it for me. String aggregation would do something like this: id | Name Result: id | Names -- - ---- -- - ----- 1 | Matt 1 | Matt, Rocks 1 | Rocks 2 | Stylus 2 | Stylus I've taken a look at CLR-defined aggregate functions as a replacement for

Java, count rows in azure database table

廉价感情. 提交于 2019-12-14 03:54:05
问题 I am trying to count the number of rows in an Azure database table and display that number on my android app. I have read Azure's documentation on retrieving data from tables here: https://azure.microsoft.com/en-us/documentation/articles/mobile-services-android-how-to-use-client-library/#querying But it doesn't mention a built-in COUNT function. Does the Azure library have a COUNT function? 回答1: As @AlexChen-Wx said, you can use the method includeTotalCount of Object MobileServiceTable on the

Problems changing PK datatype using EntityFramework CodeFirst migrations on Azure

白昼怎懂夜的黑 提交于 2019-12-14 02:32:40
问题 I have a code-first EntityFramework project hosted on Azure. Currently I handle migrations by Run Add-Migration from Package Manager Console Run Update-Database -script from Package Manager Console getting me an .sql script Manually run the script on Azure after testing on my dev environment This has been working pretty smoothly so far. But I am running into some serious issues trying to change a primary key of one of my tables from an int to a long. Here is the migration script that got

Azure PowerShell script does not work when change to a different Azure Subscription

流过昼夜 提交于 2019-12-14 02:25:19
问题 I am experiencing a very strange problem. I recently switched Azure subscription from free trial to pay-as-you-go . The PowerShell script i wrote to create Azure Resource Group , Azure Data Factory , Azure Active Directory App Azure SQL Server , Azure SQL Database does not work. below is the sample code from script and error messages New-AzResourceGroup Test2ResourceGroupName2 -location 'westeurope' $AzADAppName = "TestADApp1" $AzADAppUri = "https://test.com/active-directory-app"