sql-docs icon indicating copy to clipboard operation
sql-docs copied to clipboard

Update sp-executesql-transact-sql.md

Open bpd0018 opened this issue 1 year ago • 4 comments

There are way more than 12 statements generated. You get one statement for each year and month combination for each language where the first 3 characters of the month name are different.

Personally, I think you would be better off using a table naming scheme that is not locale dependent like 'Sales_' + cast(datepart(yy, @PrmOrderDate) as char(4)) + '_' + cast(datepart(mm, @PrmOrderDate) as char(2))

To see the table names that you get now, run the following ...

DECLARE @PrmOrderDate DATETIME; SET LANGUAGE N'us_english'; SET @PrmOrderDate = '01/31/2021'; -- set date here because the date literal format also depends on LANGUAGE SELECT SUBSTRING(DATENAME(mm, @PrmOrderDate), 1, 3) + CAST(DATEPART(yy, @PrmOrderDate) AS CHAR(4)) + 'Sales'; SET LANGUAGE N'Español'; SELECT SUBSTRING(DATENAME(mm, @PrmOrderDate), 1, 3) + CAST(DATEPART(yy, @PrmOrderDate) AS CHAR(4)) + 'Sales'; SET LANGUAGE N'ελληνικά'; SELECT SUBSTRING(DATENAME(mm, @PrmOrderDate), 1, 3) + CAST(DATEPART(yy, @PrmOrderDate) AS CHAR(4)) + 'Sales';

bpd0018 avatar Jun 20 '24 18:06 bpd0018

@bpd0018 : Thanks for your contribution! The author(s) have been notified to review your proposed change.

prmerger-automator[bot] avatar Jun 20 '24 18:06 prmerger-automator[bot]

Learn Build status updates of commit c7ad5bc:

:white_check_mark: Validation status: passed

File Status Preview URL Details
docs/relational-databases/system-stored-procedures/sp-executesql-transact-sql.md :white_check_mark:Succeeded

For more details, please refer to the build report.

For any questions, please:

@markingmyname

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged" @MicrosoftDocs/public-repo-pr-review-team

Court72 avatar Jun 20 '24 21:06 Court72

Learn Build status updates of commit ae47f79:

:white_check_mark: Validation status: passed

File Status Preview URL Details
docs/relational-databases/system-stored-procedures/sp-executesql-transact-sql.md :white_check_mark:Succeeded

For more details, please refer to the build report.

For any questions, please:

After discussion with the product group, we are revising that paragraph further in an internal PR, which will be published in the next day or so. Thank you for your feedback.

rwestMSFT avatar Sep 16 '24 21:09 rwestMSFT