Home > database >  SQL server via a data found in a group of data
SQL server via a data found in a group of data

Time:09-26

SQL server in a table using the text type selective store the primary code in the other table, use the find other data types?

CodePudding user response:

The text type is eliminated, should not use this type to store things,
Usually use nvarchar (Max)=& gt; Ntext, varchar (Max)=& gt; The text instead.

But you said the main code, is a primary key?
A primary key does not generally is very long, generally is int, bigint, guid, etc., the maximum length varchar (50) enough,
Length is too big, will lead to inefficiency,

CodePudding user response:

reference 1/f, gypsy song response:
text type is eliminated, should not use this type to store things,
Usually use nvarchar (Max)=& gt; Ntext, varchar (Max)=& gt; The text instead.

But you said the main code, is a primary key?
A primary key does not generally is very long, generally is int, bigint, guid, etc., the maximum length varchar (50) enough,
Length is too big, will lead to inefficiency,

Well, I use the varchar (Max),

That my varchar (Max) store such data
Foreign keys, foreign keys, foreign keys,,,

That how to find other data through the data types?

CodePudding user response:

Direct help you built the table:
 CREATE TABLE (t 
TableName VARCHAR (50),
PkName VARCHAR (50),
PkValue VARCHAR (50)
)

The compatibility and maneuverability is generally enough,
  • Related