I have 3 types of access tokens that I need to store to SQL Server database : Google Access token, FB token, and my custom token which is GUID.

I wanted to put all 3 in same database column. If I choose datatype uniqueidentifier I cannot save for example google token in that column. Which datatype to choose to store all 3 token types ?

有帮助吗?

解决方案

If the type are really different use a regular NVARCHAR.

The casting will be tricky but its the only way if you want to store them in the same column

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top