alter table Errors

This section contains error messages for the alter table command.




Error 4951

Severity

16

Message text

Cannot create %d partitions on the table '%.*s' with clustered index because the maximum number of partitions allowed on a table with clustered index is %d.

Explanation

By default, Adaptive Server stores a heap table's data in one doubly linked chain of database pages. Adaptive Server inserts all new rows into the last page of the chain. A transaction holds an exclusive lock on the last page while inserting new rows, which can block other, concurrent transactions from being inserted into the table.

Partitioning creates additional page chains on the table, each with its own last page. This reduces page contention for concurrent inserts, and can also reduce I/O contention if the table is distributed over multiple physical devices.

The partition clause of the alter table command allows you to partition tables with or without a clustered index. However, after partitioning a clustered table, the entire page chain is placed in the first partition.

Error 4951 occurs when you attempt to partition a table with a clustered index, and exceed the maximum allowed partitions.

Action

Reenter your partition command using a value for number of partitions that does not exceed the specified maximum.

Additional information

Refer to the Reference Manual for information about the alter table command.

Versions in which this error is raised

All versions




Error 4953

Severity

16

Message text

Cannot partition table '%.*s' because it is already partitioned.

Explanation

The partition clause of the alter table command allows you to partition user tables that do not have a clustered index. You cannot partition a table that is already partitioned.

Error 4953 occurs when you try to partition a table that is already partitioned.

Action

If you want to change the number of partitions for the table, follow these steps:

  1. Concatenate all existing page chains:

    1> use database_name
    2> go
    

    1> alter table table_name unpartition
    2> go
    

  2. Repartition the table:

    1> alter table table_name partition
    2> number_of_partitions
    3> go
    

Additional information

Refer to the Reference Manual for information about the alter table command.

Versions in which this error is raised

All versions




Error 4954

Severity

16

Message text

Cannot unpartition table '%.*s' because it is not partitioned.

Explanation

The partition clause of the alter table command allows you to partition user tables that do not have a clustered index. The unpartition clause of the alter table command allows you to concatenate all existing page chains for these tables. You cannot unpartition a table that is not partitioned.

Error 4954 occurs when you try to unpartition a table that is not partitioned.

Action

No action is required.

If you want to determine whether a table is partitioned, use the following commands:

1> use database_name
2> go

1> sp_help table_name
2> go

Additional information

Refer to the Reference Manual for information about the alter table command.

Versions in which this error is raised

All versions




Error 4956

Severity

16

Message text

Cannot alter table if level 0 scans are active.

Explanation

Isolation level 0 allows transactions to read uncommitted data (“dirty reads”). You can specify isolation level 0 for your queries using the at isolation syntax or you can specify level 0 for your session as part of the transaction isolation level option of the set command. Adaptive Server's default transaction isolation level is 1.

Since alter table allows you to modify a table's schema, it would not be safe to allow the use of alter table when level 0 scans are active for that table. Error 4956 is raised if you enter an alter table command when the table in your command is currently being used for reading uncommitted data.

Action

Try your alter table command again later, after the process that is using level 0 scans on the table is no longer active.

Additional information

Refer to the Adaptive Server Enterprise Transact-SQL User's Guide for information about selecting an isolation mode for either a query or for your session.

Versions in which this error is raised

All versions




Error 4964

Severity

17

Message text

Lock scheme conversion failed due to insufficient SQL Server memory. Please retry later when there is less load/users on the SQL server, or ask your System Administrator to reconfigure SQL Server with more memory.

Explanation

Adaptive Server provides two data locking schemes:

Since neither scheme locks index pages, they are referred to together as the data-only locking scheme.

An additional locking scheme, known as allpages locking, locks the data and index pages affected by queries. It is the default locking scheme.

When you use the alter table command to change a table's locking scheme from allpages locking to data-only locking, Adaptive Server creates memory structures to build a new table with the desired locking scheme and transfers data from the existing table.

Error 4964 indicates that there is not enough memory available in Adaptive Server's data cache to effect the lock scheme change. The problem can occur at various stages of table conversion:

Action

Check the activity on your server and re-try the lock scheme conversion when there is less load on the system.

If the problem persists, check the memory allocation on your server. You may need to increase the memory allocated to the data cache.

Use sp_configure to view the current values of memory-related parameters on your system:

1> sp_configure "Memory Use"
2> go

Refer to "Configuring Memory" in the System Administration Guide for details on monitoring and adjusting memory allocation parameters.

Versions in which this error is raised

All versions