Set ANSI_PADDING on a specific column (ANSI_PADDING ON and OFF in different columns of the same table)
问题 Is it possible - using a single CREATE TABLE script - to set specific varbinary columns ANSI_PADDING = ON but others to ANSI_PADDING = OFF ? e.g. CREATE TABLE PaddingX ( ... ColumnA varbinary(max), ... ColumnB varbinary(50) ) I would like ColumnA to trim (padding OFF ), but ColumnB to contain the full (padded) value - padding ON . 回答1: You hace to do it in two steps: SET ANSI_PADDING OFF -- create the table without the columns that need ANSI padding SET ANSI_PADDING ON -- alter the table to