column accept hyphen or dot

Bilal H. Bhatt 136 Reputation points
2024-08-19T05:38:47.89+00:00

Hi,

We have requirement - the column should accept the hyphen(-) or dot.

The column data type is nvarchar.

Please let me know if it is possible.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
0 comments No comments
{count} votes

Accepted answer
  1. LiHongMSFT-4306 31,391 Reputation points
    2024-08-19T05:47:48.49+00:00

    Hi @Bilal H. Bhatt

    Yes, it is possible.

    Check this sample:

    DECLARE @TBL TABLE (COL NVARCHAR(20))
    INSERT INTO @TBL VALUES(N'AAA-BBB.CCC')
    SELECT * FROM @TBL
    

    Best regards,

    Cosmog


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.