Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Schema differences for scalar-valued function

Đang mở
#85 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
sql
Lĩnh vực
databases, tooling

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ả

bug
  • 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/SqlScriptDOM

Tất cả issue của microsoft/SqlScriptDOM

Issue tương tự

Thêm issue về Databases

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.