-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update SqlFacetAttribute.xml to indicate possible usage on input parameters #4477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Document implies SqlFacets can only be used with return types. But they can also be used with input parameters.
@stevestein Can you review this please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allmhuran - this attribute is intended to be used for the return type.
An optional attribute on a user-defined type (UDT) return type, used to annotate the returned result with additional information that can be used in Transact-SQL.
SqlFacetAttribute is used only to derive information about the return type, and is not intended to be a constraint specification on what can be stored in the type. Thus, if a field has a SqlFacetAttribute indicating its size to be 2 characters, then the SQL Server type of the field access expression is of size 2, but assignments into the field are not restricted by this facet.
So while you may be able to apply the SqlFacetAttribute to an input parameter, what is the actual scenario?
@stevestein When publishing a SQLCLR UDF via Visual Studio, the user in the stackoverflow thread (below) found that the deployed object treated the input parameter numeric as (18,0). The attribute was able to be used to inform the deployment such that the input parameter was not necessarily treated as (18,0). The user was given the impression that the facet could only be used on return, as I believe is implied by the existing documentation. Solomon Rutzky indicated that, regarding input or output, the facet "is definitely intended for both, even if the examples are lacking". Perhaps there is a more comprehensive way to indicate this in the documentation than my proposed edit. https://stackoverflow.com/questions/62773147/set-decimal-precision-in-sql-clr-function-in-c-sharp |
Ping @stevestein - can you please follow up? |
ping @carlossanlop @stevestein to follow up. |
Tagging subscribers to this area: @cheenamalhotra, @David-Engel Issue DetailsDocument implies SqlFacets can only be used with return types. But they can also be used with input parameters. SummaryDescribe your changes here. Fixes #Issue_Number (if available)
|
Learn Build status updates of commit 1a791af: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
@dotnet-policy-service agree |
Document implies SqlFacets can only be used with return types. But they can also be used with input parameters.
Summary
Describe your changes here.
Fixes #Issue_Number (if available)