Schema differences for scalar-valued function
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Tái hiện sự cố bằng định nghĩa hàm SSMS được cung cấp, lệnh SqlPackage Extract và phép so sánh Microsoft.SqlServer.DacFx bằng phiên bản 162.2.111. Kiểm tra cách hàm trả về giá trị vô hướng được phân tích cú pháp và biểu diễn sau khi trích xuất, sau đó xác minh rằng DeployReport không còn báo cáo các thao tác drop/create đối với hàm UETrim giống hệt và quá trình trích xuất hoàn tất mà không có lỗi xác thực TRIM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- SqlPackage or DacFx Version: 162.2.111
- .NET Framework (Windows-only) or .NET Core: net8.0
- Environment (local platform and source/target platforms): Win11&Server 2019
Steps to Reproduce:
-- SSMS>
USE MASTER;
GO
CREATE DATABASE dacFxRepro;
GO
USE dacFxRepro;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[UETrim] (@text NVARCHAR(MAX)) RETURNS NVARCHAR(MAX) WITH SCHEMABINDING AS
BEGIN
RETURN (TRIM(NCHAR(0x09) + NCHAR(0x20) + NCHAR(0x0D) + NCHAR(0x0A) FROM @text))
END
GO
-- PS>
-- dotnet tool install --global microsoft.sqlpackage --ignore-failed-sources
-- $server = '.'
-- $database = 'dacFxRepro'
-- $connectionString = "server=$server;database=$database;Integrated Security=true;Connection Timeout=300;Trusted_Connection=True;Encrypt=False;Command Timeout=300"
-- $dacpacPath = '.\dacFxRepro.dacpac'
-- sqlpackage @('/Action:Extract', "/TargetFile:$dacpacPath", "/SourceConnectionString:$connectionString", "/p:IgnoreUserLoginMappings=true")
-- Output:
-- Connecting to database 'dacFxRepro' on server '.'.
-- Extracting schema
-- Extracting schema from database
-- *** Error validating element [dbo].[UETrim]: Incorrect syntax near TRIM.
-- Resolving references in schema model
-- Validating schema model for data package
-- Validating schema
-- Successfully extracted database and saved it to file '...\dacFxRepro.dacpac'.
When trying to compare the dacpac-file to a database using library Microsoft.SqlServer.DacFx, schema differences of function UETrim are reported, although the functions are identical in the database and in the dacpac file.
Same with sqlpackage:
-- PS>
-- $outputPath = 'report.xml'
-- sqlpackage @('/Action:DeployReport ', "/SourceFile:$dacpacPath", "/TargetConnectionString:$connectionString", "/OutputPath:$outputPath")
-- Output
--
--
--
--
--
-- <Item Value="[dbo].[UETrim]"
-- Type="SqlScalarFunction"/>
--
--
-- <Item Value="[dbo].[UETrim]"
-- Type="SqlScalarFunction"/>
--
--
--
Did this occur in prior versions? If not - which version(s) did it work in?
Yes.
(DacFx/SqlPackage/SSMS/Azure Data Studio)
- Ngôn ngữ chính
- GAP
- Star
- 277
- Fork
- 43
- Merge trung bình
- 6 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/SqlScriptDOM
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/SqlScriptDOM#228 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/SqlScriptDOM#183 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
microsoft/SqlScriptDOM#226 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/SqlScriptDOM#225 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
microsoft/SqlScriptDOM#224 ·
Tất cả issue của microsoft/SqlScriptDOM
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AstrBotDevs/AstrBot#10205 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OHDSI/Data2Evidence#3394 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100