我正在开发一个WCF服务,我希望能够在我在本地运行时获取它所做的所有SQL查询的转储.
目前它正在执行的sprocs通过众多的传播,SqlCommand所以我想得到一个运行的每个查询的列表.
我可以设置任何类型的工具或配置来记录此信息吗?通常我会使用类似SQL Profiler的东西,但我正在寻找从WCF角度运行的东西,因为我正在访问Azure数据库,而SQL Profilier将不能与Azure一起工作(afaik)
我正在尝试从Ubuntu 12.04连接到SQL-Azure.
我用openssl和libiconf编译了freeTds-0.91
tsql -H XXXXXXXX.database.windows.net -U Username -D DatabaseName -p 1433 -P Password
Run Code Online (Sandbox Code Playgroud)
我尝试使用上面的语句连接,我收到此错误:
locale is "en_ZA.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Default database being set to DatabaseName
Error 20004 (severity 9):
Read from the server failed
OS error 104, "Connection reset by peer"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
Run Code Online (Sandbox Code Playgroud)
我的tsql -C输出:
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /usr/local/etc
MS …Run Code Online (Sandbox Code Playgroud) 我有三个存储过程A,B,C
和A的定义是一样的
StoredProcedure A
As
Begin
--Some Stuff
Exec DBO.B [Derived Conitions]
Exec DBO.C [Derived Conitions]
END
Run Code Online (Sandbox Code Playgroud)
但每当我尝试执行存储过程A时,在解析时它会给出警告;
模块"A"取决于丢失的对象"B".该模块仍将创建; 但是,在对象存在之前,它无法成功运行.
模块"A"取决于缺失的对象"C".该模块仍将创建; 但是,在对象存在之前,它无法成功运行.
在执行时它会抛出异常
找不到存储过程'dbo.B'.
找不到存储过程'dbo.C'.
我在存储过程中调用存储过程找到了很多答案,但是没有一个能为我工作.
我一直在使用我的应用程序使用Azure移动服务没有太多问题,但是今天当我尝试从服务中提取时出现此错误:
Exception = System.Data.SqlClient.SqlException(0x80131904):无法打开登录请求的数据库"master".登录失败.用户'JVlSvKwDpdLogin_ ***** ' 登录失败.
我以前从来没有遇到过这个问题,我只是用这样的代码连接到我的移动服务:
public static MobileServiceClient MobileService = new MobileServiceClient(
"https://<webservicename>.azure-mobile.net/",
"<YOUR-API-KEY-HERE>"
);
Run Code Online (Sandbox Code Playgroud)
在发生此错误之前,我从未提供用户名或密码.我已经看到了一些解决方案,他们为数据库创建了一个用户,但我现在不想创建一个用户,因为我们还在测试中,而现在我宁愿能够使用该服务.这是移动服务的问题,还是数据库的问题?
UPDATE
正如下面Matt的回答所示,我在Azure门户中找到了MS_ConnectionString.然后,我连接到Azure SQL服务器上的"主"数据库,并搜索上面的登录信息.我将密码更改为使用连接字符串中找到的密码
ALTER LOGIN <login> WITH password='<password-found-in-connection-string>';
Run Code Online (Sandbox Code Playgroud)
但是现在我收到了这个错误:
Exception = System.Data.Entity.Core.ProviderIncompatibleException:访问数据库时出错.这通常意味着与数据库的连接失败.检查连接字符串是否正确,以及是否使用了相应的DbContext构造函数来指定它或在应用程序的配置文件中找到它.有关DbContext和连接的信息,请参阅http://go.microsoft.com/fwlink/?LinkId=386386.有关失败的详细信息,请参阅内部异常.---> System.Data.Entity.Core.ProviderIncompatibleException:提供程序未返回ProviderManifestToken字符串.---> System.Data.SqlClient.SqlException:用户'JVlSvKwDpdLogin_ ******* ' 登录失败.
我没有使用连接字符串或AzureMobileService项目的web.config文件进行任何更改.
web.config中:
<connectionStrings>
<add name="MS_TableConnectionString" connectionString="Data Source= (localdb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-CoverageTool.AzureMobileService-20140910083006.mdf;Initial Catalog=aspnet-CoverageTool.AzureMobileService-20140910083006;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
Run Code Online (Sandbox Code Playgroud)
MobileContext:
private const string connectionStringName = "Name=MS_TableConnectionString";
public MobileServiceContext()
: base(connectionStringName)
{
}
Run Code Online (Sandbox Code Playgroud)
连接字符串
数据源= ***** .database.windows.net;初始目录= sbpconsulting_db;用户ID = *******Login_sbpconsulting;密码=************** ;异步加工= TRUE; TrustServerCertificate = FALSE;
c# sql-server azure azure-mobile-services azure-sql-database
在OS X Yosemite 10.10.3上安装pymssql时收到以下错误 - 有没有人得到以下错误?我使用FreeTDS(v0.91.112)版本7.1和Python 2.7.6 - tsql实用程序连接到SQL数据库没有问题.
sudo pip install pymssql
错误:
Command "/usr/bin/python -c "import setuptools, tokenize;
__file__='/private/tmp/pip-build-T5Usla/pymssql/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record /tmp/pip-uZGqK4-record/install-
record.txt --single-version-externally-managed --compile" failed with error
code 1 in /private/tmp/pip-build-T5Usla/pymssql
Run Code Online (Sandbox Code Playgroud) 在将我们的SQL Azure计算机更新到v12之后,我们得到了一些我们在尝试对它运行命令时没有遇到过的奇怪异常.
Inner exception information (level 1):
Exception type: System.Data.SqlClient.SqlException
Exception message: Client disconnected during login
A severe error occurred on the current command. The results, if any, should be discarded.
Run Code Online (Sandbox Code Playgroud)
这是你的其他任何人得到的东西,你是如何解决它的?
编辑:我们在欧盟,美国和亚洲有三个地区.但是,我们只是在亚洲面临这个问题.
我正在尝试使用Azure ML中的"执行python脚本"模块创建一个" 读取器 "替代方法来从Azure SQL数据库中读取数据.在这样做时,我正在尝试使用pyodbc库连接到Azure Sql.这是我的代码:
def azureml_main(dataframe1 = None, dataframe2 = None):
import pyodbc
import pandas as pd
conn = pyodbc.connect('DRIVER={SQL Server}; SERVER=server.database.windows.net; DATABASE=db_name; UID=user; PWD=Password')
SQLCommand = ('''select * from table1 ''')
data_frame = pd.read_sql(SQLCommand, conn)
return data_frame,
Run Code Online (Sandbox Code Playgroud)
还试图使用不同的驱动程序名称:{SQL Server Native Client 11.0}
这是我得到的错误:
Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
Run Code Online (Sandbox Code Playgroud)
有谁知道我应该使用哪个驱动程序?
只是为了确保,我尝试了"{SQL Server}","{SQL Server Native Client 11.0}"和"{SQL Server Native Client 10.0}"并得到了同样的错误
我也尝试了不同的格式:
conn = …Run Code Online (Sandbox Code Playgroud) python pyodbc azure-machine-learning-studio azure-sql-database cortana-intelligence
我有一个数据工厂,其管道复制活动如下:
{
"type": "Copy",
"name": "Copy from storage to SQL",
"inputs": [
{
"name": "storageDatasetName"
}
],
"outputs": [
{
"name": "sqlOutputDatasetName"
}
],
"typeProperties": {
"source": {
"type": "BlobSource"
},
"sink": {
"type": "SqlSink"
}
},
"policy": {
"concurrency": 1,
"retry": 3
},
"scheduler": {
"frequency": "Month",
"interval": 1
}
}
Run Code Online (Sandbox Code Playgroud)
输入数据大小约为90MB,大约150万行,分为约.Azure存储中的20 x 4.5MB块blob文件.以下是数据示例(CSV):
A81001,1,1,1,2,600,3.0,0.47236654,141.70996,0.70854986 A81001,4,11,0,25,588,243.0,5.904582,138.87576,57.392536 A81001,7,4,1,32,1342,278.0,7.5578647,316.95795, 65.65895
接收器是S2类型的Azure SQL Server,其额定值为50 DTU.我创建了一个简单的表,其中包含合理的数据类型,没有键,索引或任何花哨的东西,只有列:
CREATE TABLE [dbo].[Prescriptions](
[Practice] [char](6) NOT NULL,
[BnfChapter] [tinyint] NOT NULL,
[BnfSection] [tinyint] NOT NULL,
[BnfParagraph] [tinyint] …Run Code Online (Sandbox Code Playgroud) performance azure azure-storage-blobs azure-data-factory azure-sql-database
我从Azure中托管的Web应用程序收到此错误。它可以正常运行几天,然后突然停止工作。
连接是否有问题?哪个对象引用没有实例?
YYYY-MM-DD hh:mm:ss [Error] An exception occurred in the database while iterating the results of a query.
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<BufferAllAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.EntityFrameworkCore.Query.RelationalQueryContext.<RegisterValueBufferCursorAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<BufferlessMoveNext>d__9.MoveNext()
--- End of …Run Code Online (Sandbox Code Playgroud) asp.net-web-api azure-web-sites entity-framework-core azure-sql-database
目前我们有一个Azure SQL Server,每次创建新的Web应用程序时,我们都使用EF Core Code First来生成数据库.但是,在创建数据库之后,我们手动转到Azure门户并将新创建的数据库添加到Azure SQL Server内的弹性池中.有可能以某种方式自动化进程,以便通过门户网站或使用EF或其他任何方式生成每个新创建的数据库,它将自动添加到池中吗?
azure azure-elastic-scale azure-sql-database azure-sql-server
azure ×4
c# ×2
python ×2
azure-machine-learning-studio ×1
freetds ×1
osx-yosemite ×1
performance ×1
pymssql ×1
pyodbc ×1
sql ×1
sql-server ×1
wcf ×1