我可以在无服务器SQL池中创建一个存储过程吗

发布于 2025-02-08 02:02:17 字数 183 浏览 1 评论 0 原文

根据Microsoft的官方文档,可以在Azure Synapse无服务器SQL池中创建一个存储过程。我设法执行以下脚本

Create proc Test
as
Select 1 as X

,但是,我在无服务器SQL池中看不到测试存储过程。 我也没有在无服务器SQL池中看到可编程性文件夹

Following the official documentation from Microsoft, it is possible to create a stored procedure in Azure Synapse Serverless SQL pool. I manage to execute the following script

Create proc Test
as
Select 1 as X

However, I Don't see the Test stored procedure in the Serverless SQL pool.
I don't also see the programmability folder in the Serverless SQL pool

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

余生再见 2025-02-15 02:02:18

我发现在Synapse Studio或Azure Data Studio中查看存储过程的唯一方法是查询系统模式表。但是,如果您通过此处使用ssms使用SSM,则可以看到SPS, https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/get-started-smsms

Synapse Studio中的

SELECT definition, uses_ansi_nulls, uses_quoted_identifier, is_schema_bound  
FROM sys.sql_modules  
WHERE object_id = OBJECT_ID('dbo.Test');   
GO   

” //i.sstatic.net/wqktp.png“ rel =” nofollow noreferrer“>

ssms

”在此处输入图像说明”

The only way I've found to view the Stored Procedure in Synapse Studio or Azure Data Studio is to query the sys schema tables. However SPs are visible if you use SSMS via steps here https://learn.microsoft.com/en-us/azure/synapse-analytics/sql/get-started-ssms

Query in Synapse Studio

SELECT definition, uses_ansi_nulls, uses_quoted_identifier, is_schema_bound  
FROM sys.sql_modules  
WHERE object_id = OBJECT_ID('dbo.Test');   
GO   

enter image description here

SSMS

enter image description here

还如梦归 2025-02-15 02:02:18

是的,可以使用T-SQL命令在Synapse Analytics中的无服务器SQL中创建存储过程。我实际上是使用SSMS进行的,并连接到Synapse Analytics工作区中的SQL数据库 - 使用无服务器SQL Endpoint 链接,在Azure的概述窗口中提供:

net/2fynkqym.png“ rel =“ nofollow noreferrer”> 创建过程脚本之前创建一个模式。

第二个警告是我必须做两次。我第一次执行创建过程即使SSMS报告了成功,也没有发生任何事情。只有在我再次执行它之后,存储的过程才出现在Object Explorer中。但是我在之前又有连接问题,它可能与之链接,而与无服务器SQL无关。

PS。我的SQL DB实际上是Deltalake,表是Parquet文件。不确定它在此答案中扮演任何角色,但我包括在内,以防万一。

Yes, it is possible to create Stored procedure in Serverless SQL in Synapse Analytics, using T-SQL commands. I actually did that using SSMS and connecting to a SQL database in Synapse Analytics Workspace - using Serverless SQL endpoint link, provided in Overview window in Azure:

enter image description here

But for me there were caveats - schema [dbo] is explicitly prohibited, so I had to create a schema before executing CREATE PROCEDURE script.

Second caveat was that I had to do it twice. First time I executed the CREATE PROCEDURE nothing happened, even though SSMS reported success. Only after I executed it again, stored procedure showed up in Object Explorer. But I had connection issues prior and after, it may be linked to that, and nothing related to Serverless SQL.

PS. My SQL DB is actually DeltaLake, and tables are parquet files. Not sure it plays any role in this answer, but I include it, just in case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文