I worked on many tables and all had this thing:
CREATE TABLE Persons(
[id] [int] IDENTITY(1,1) NOT NULL,
[modified_on] [datetime] NULL,
[modified_by] [varchar](200) NULL,
)
ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
What is TEXTIMAGE_ON [PRIMARY]
in SQL Server/Transact-SQL?
Best Answer
Given that the format is:
TEXTIMAGE
refers to all big/unlimited-size field types: text, ntext, image, xml, varchar(max), nvarchar(max), varbinary(max), and CLR user-defined type columns (including geometry and geography).Then, you need to know what Files and FileGroups are. From the MSDN entry on Database Files and Filegroups:
So,
Would appear to be somewhat redundant, as it is saying that the mentioned large-text-value columns should be stored within the primary filegroup, which is actually the default action.
Assuming the existence of a custom filegroup called CUSTOM, you would probably write something like this:
You would create a custom filegroup to store large binary or text, and in this case the 'normal' fields info would sit in a data file in the primary filegroup, while the associated 'large' fields would be stored in a physically distinct data file (in the secondary custom filegroup).
You would do this so that you could separate the core relational datamodel (which would presumably be relatively small in terms of disk space) from the large fields (which will require proportionally more disk space) - in order to allow distinct archiving or replication strategies to be applied to each filegroup.