October 6, 2010 at 12:21 am
Comments posted to this topic are about the item Fix Default Constraint Naming
October 6, 2010 at 7:34 am
Michael,
I get
Warning! The maximum key length is 900 bytes. The index 'PK_AliasRules' has maximum length of 1025 bytes. For some combination of large values, the insert/update operation will fail.
for your script at http://files.soendergaard.info/Install_spFixColumnDefaultNaming_V2005-2008.sql. Running the 2008 studio on a SQl2005 db.
It worked perfectly, BTW - awesome piece of code - I'll need to tweak it to do the same for PKs, FKs, IX and UKs ...
Great standards technique,
Doug
October 6, 2010 at 10:47 am
Don't worry about the warning it only matters if you alias rows are larger than 900 bytes. And if you are not using any aliases it doesn't matter at all
Actually you don't need to tweak spFixColumnDefaultNaming for handling PK, FK, IX and UK. My other stored procedures are scheduled for publication the next couple of days. But if you can't wait. just check my site. http://sql.soendergaard.info
October 6, 2010 at 11:07 am
Awesome - now these are the kind of articles we need.
Doug
October 6, 2010 at 11:46 am
BTW for all future readers.
I have noticed two errors in the publication.
1. I am showing the source code for spFixColumnCheckNaming instead of spFixColumnDefaultNaming. However they are 99% identical in structure and feature. If you want to look at the right source code, check for install script, that is still correct.
2. A copy / paste error have occurred in the result output for example 2. Please ignore the first line
November 29, 2011 at 2:04 pm
I am using AliasRules table. I need clarity regarding this warning:
"Warning! The maximum key length is 900 bytes. The index 'PK_AliasRules' has maximum length of 1025 bytes. For some combination of large values, the insert/update operation will fail."
How can you tell if your key length will approach 900 bytes? What combination of large values will fail?
February 24, 2012 at 1:32 pm
It means that if all columns making up the primary key is larger than 900 bytes combined, you would be able to add that to the alias table. In practice it shouldn't have an affect, unless your schema, table and column names are very long
May 18, 2016 at 7:03 am
Thanks for the script.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply