Share via

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 | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

Answer accepted by question author

LiHongMSFT-4306 31,621 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".

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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