问题标签 [sql-data-warehouse]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
azure - 使用 Azure 数据仓库调用批处理文件
我正在尝试运行
在 SQL Azure 数据仓库中,但我发现 xp_CMDShell 在 Azure 中不受支持,您能否提供从 Azure 数据仓库调用 exe 的替代方法?
在批处理文件中,我打算将 CSV 从一个位置复制到另一个位置,但这应该在我的条件在存储的过程逻辑中被评估为 true 之后发生。这个逻辑位于存储过程代码的中间,因此我不希望这是一个独立的活动(不想要 Azure Batch 作业或时间触发器)
sql - Cast binary column to string in Azure SQL Data Warehouse
I currently have functions in Postgres and Redshift that take a randomly generated string, hash it, then uses part of the hash to generate a random number between 0-99. I am trying to replicate this functionality in Azure SQL Data Warehouse such that I get the same value in SQL DW as I do in Postgres and Redshift.
The issue I'm running into is when I cast the result to a VARCHAR or use a string function the result is a much different string. I'd like to get the result of the md5 function as an identical VARCHAR
.
To illustrate, here is a query in Azure SQL DW:
This yields
As you can see, the resulting varchar is much different from the output of the md5 function. Is there a way to convert the result of md5 into an identical string?
In Postgres and Redshift the result of the md5
function is a VARCHAR so it is simple to do transformations on it.
Here are the queries in Redshift and Postgres:
Both functions return the value 87
.
sql - 在 Azure SQL 数据仓库中聚合字符串
有没有办法在 Azure SQL 数据仓库中聚合字符串,类似于string_agg
SQL Server 中的函数?
我有带有要连接成单个字符串的字符串的记录。
SELECT string_agg(string_col, ',') FROM table1
https://docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql
sql - 在 Azure SQL 数据仓库中转换时区
我有一个来自US/Pacific
时区的 DATETIME 列,但它不是这样编码的。如何UTC
在 Azure SQL 数据仓库中将此转换为时区?
AT DATETIME
T-SQL 函数似乎最合适,但 Azure SQL 数据仓库不支持它
。https://docs.microsoft.com/en-us/sql/t-sql/queries/at-time-zone-transact-sql
例如,一条记录的 DATETIME 为2013-04-02 08:02:47.000000
。转换后应该是2013-04-02 15:02:47.000000
。
sql - 如何在 Azure SQL 数据仓库中解析 JSON 格式的字符串?
T-SQL 有几个函数可以解析 JSON 数据,但它们都不适用于 Azure SQL 数据仓库。
我在 VARCHAR 列中有 JSON 格式的数据,如下所示:
我可以使用以下JSON_VALUE
函数提取 SQL Server 中的“Purpose”字段:
但这在 SQL 数据仓库中不受支持。有没有办法在 SQL 数据仓库中做到这一点?
https://docs.microsoft.com/en-us/sql/t-sql/functions/json-functions-transact-sql
java - 如何使用 java sdk 在 Azure SQL DW 中禁用地理备份策略
我创建了 Azure SQL 数据仓库并使用Java SDK完成了暂停和恢复操作
现在我想在创建 Azure SQL 数据仓库时禁用地理备份策略。
我怎样才能使用 Java SDK 做到这一点?
有关 Azure SQL 数据仓库中的地理备份策略,请参阅下图。
sql - Azure SQL 数据仓库上的数据库备份
有什么方法可以备份数据库说“ABC”,然后在Azure SQL 数据仓库上使用名称“ABC_Old”进行恢复?
任何帮助表示赞赏。谢谢!
sql - Azure 数据仓库中的表变量
在 SQL Server 数据库中,可以像这样使用表变量:
在 Azure 数据仓库中,这会引发错误。
第 1 行解析错误,第 19 列:“表”附近的语法不正确
在 Azure 数据仓库中,可以使用临时表:
但不是内部功能。
消息 2772,级别 16,状态 1,第 6 行无法从函数内访问临时表。
微软的这份文件说,
◦必须分两步声明(而不是内联):◾CREATE TYPE my_type AS TABLE ...;,然后◾DECLARE @mytablevariable my_type;。
但是当我尝试这个时:
我明白了:
消息 103010,级别 16,状态 1,第 1 行解析错误:第 1 行,第 8 列:“类型”附近的语法不正确。
我的目标是在使用临时表的 Azure 数据仓库中拥有一个功能。它可以实现吗?
编辑从这里开始
请注意,我不是在寻找其他方法来创建一个特定的功能。我实际上已经做到了并继续前进。我是一名资深程序员,但也是一名 Azure 数据仓库新手。我想知道是否可以在 Azure 数据仓库函数中加入一些临时表的概念。
azure - Azure 数据湖 - HDInsight 与数据仓库
我处于使用 Azure 数据仓库中的外部表从 Azure 数据湖中读取数据的位置。
这使我们能够使用众所周知的 SQL 从数据湖中读取数据。
但是,另一种选择是使用 Data Lake Analytics 或 HDInsight 的某些变体。
性能方面,我没有看到太大的差异。我假设 Data Warehouse 在后台运行某种形式的分布式查询,转换为 U-SQL(?),那么为什么我们要使用与 U-SQL 语法略有不同的 Data Lake Analytics?
由于 SQL 中也提供了 python 脚本,我觉得我错过了 Data Lake Analytics 的一个关键目的,而不是成本(按批处理作业付费,而不是数据库的恒定运行时间)。
azure - 调试 sql 数据库范围凭据失败
我在 Azure SQL Datawarehouse 数据库中创建了一个范围凭据,以在 Azure Data Lake Store 中的某些文件上创建一个外部表。
当我尝试创建外部表时,我收到了消息。
消息 105061,级别 16,状态 1,第 35 行找不到与指定数据源关联的任何有效凭据。连接到 Azure Data Lake Store 需要凭据。
我该如何解决这个问题?我的 AzureAD 应用程序可以访问存储。我对 Azure 数据工厂管道使用相同的 AD 应用程序(具有不同的密钥),该管道将文件存储在 Azure Data Lake Store 中。
我还没有找到任何命令可以让您测试您的凭据并查看数据库尝试使用的凭据或失败的原因。有任何想法吗?
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-database-scoped-credential-transact-sql