If there is no text or ntext, check whether there is a bug in the textimage _ on clause or the image column in the script tool. The answer is yes, of course!

Source: Internet
Author: User
Tags table definition
Symptom

Even if the table does not contain any text, ntext, or image columns, when SQL Enterprise Manager runs the "generate SQL script" tool, SQL Server generates the textimage _ on clause (DDL) in the table and table definition) create a script. This makes the script execution impossible due to the following errors:

Server: Message 1709, level 16, status 1, Row 1

Textimage _ on cannot be used when the table does not have text, ntext, or image columns.


Cause

The text, ntext, or image Column exists once in the table. It can be used to delete an Enterprise Manager by using the altertable command or SQL.


Alternative Method

The solution is to delete this clause from the table definition and run the script.


Status

Microsoft has confirmed that this is an issue in this article listing Microsoft products.


More information


The following is a simple script to illustrate the problem:

Create Table mytable (
Myint int,
Mytext text
)
Go

Alter table mytable drop column mytext
Go

--- Running the "generate SQL scripts" tool will generate:

If exists (select * From sysobjects where id =
Object_id (n' [DBO]. [mytable] ') and objectproperty (ID, n'isusertable') = 1)
Drop table [DBO]. [mytable]
Go

Create Table [DBO]. [mytable] (
[Myint] [int] Null
) On [primary] textimage_on [primary]
Go

Textimage _ on primarykey] [It should not be part of the table definition. Delete it and execute the script.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.