Showing posts with label warning. Show all posts
Showing posts with label warning. Show all posts

Sunday, March 11, 2012

Alter table

Need some help with the following
My goal is to create a unique field by Concatenating two columns.
I am getting the following error
"Warning: The table 'Copy_AFS' has been created but its maximum row size
(928267) exceeds the maximum number of bytes per row (8060). INSERT or UPDAT
E
of a row in this table will fail if the resulting row length exceeds 8060
bytes.
Warning! The maximum key length is 900 bytes. The index 'ak1_some_key' has
maximum length of 16000 bytes. For some combination of large values, the
insert/update operation will fail."
Please let me know if I have the correct statement
ALTER TABLE Copy_AFS
ADD CONSTRAINT Key_TDM
UNIQUE ([CORP-NUM],[REFERENCE-NUMBER]);
Thanks"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:56E90F9A-EF19-4879-9930-A5229C3F1BFF@.microsoft.com...
> Need some help with the following
> My goal is to create a unique field by Concatenating two columns.
> I am getting the following error
> "Warning: The table 'Copy_AFS' has been created but its maximum row size
> (928267) exceeds the maximum number of bytes per row (8060). INSERT or
> UPDATE
> of a row in this table will fail if the resulting row length exceeds 8060
> bytes.
> Warning! The maximum key length is 900 bytes. The index 'ak1_some_key' has
> maximum length of 16000 bytes. For some combination of large values, the
> insert/update operation will fail."
>
> Please let me know if I have the correct statement
>
> ALTER TABLE Copy_AFS
> ADD CONSTRAINT Key_TDM
> UNIQUE ([CORP-NUM],[REFERENCE-NUMBER]);
>
> Thanks
>
That's not an error, it's a warning. Your table and index allow data that is
larger than the supported maximum. That means you'll receive an error if you
try to populate those columns with data that is too large. You can ignore
the message and continue but the more prudent course of action would be to
change your table design.
There are some solutions but first it would help if you could state what
version and edition of SQL Server you are using.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Alter Table

Warning: The table 'top32_kan_g2_nb' has been created but its maximum row size (14199) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.

This is the message I am getting, when i have altered the table definition(i.e. copy the table and pasted in Query Analyzer) using alter.My requirement is to delete some fields from the table at EOD daily. The query is executed but the above warning message appears and the fields I required has been deleted.
Is the above message important or can I use the same method again.As you are removing some of the fields using alter it can work for you provided that it follows the mentioned condition in the warning.

Contact your DBA regarding the warning message .|||

Quote:

Originally Posted by balasach82

Warning: The table 'top32_kan_g2_nb' has been created but its maximum row size (14199) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.

This is the message I am getting, when i have altered the table definition(i.e. copy the table and pasted in Query Analyzer) using alter.My requirement is to delete some fields from the table at EOD daily. The query is executed but the above warning message appears and the fields I required has been deleted.
Is the above message important or can I use the same method again.


try doing a

SELECT only, selected, fields, here INTO NEWTABLE from DAILYTABLE..