Microsoft KB Archive/247312: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 51: | Line 51: | ||
If you try to change the length of a column inside '''BeginAlter''' and '''DoAlter''' like this: | If you try to change the length of a column inside '''BeginAlter''' and '''DoAlter''' like this: | ||
<pre class="codesample">table1.BeginAlter | <pre class="codesample">table1.BeginAlter | ||
Set column1 = t.Columns( | Set column1 = t.Columns("city") | ||
column1.Length = 70 | column1.Length = 70 | ||
table1.DoAlter | table1.DoAlter | ||
Line 71: | Line 71: | ||
<pre class="codesample">Dim server1 As New SQLDMO.SQLServer | <pre class="codesample">Dim server1 As New SQLDMO.SQLServer | ||
Dim db1 As SQLDMO.Database | Dim db1 As SQLDMO.Database | ||
server1.Connect | server1.Connect "(local)", "sa", "" | ||
Set db1 = server1.Databases( | Set db1 = server1.Databases("pubs") | ||
db1.ExecuteImmediate ( | db1.ExecuteImmediate ("Alter table publishers Alter column city varchar(50) ") | ||
server1.DisConnect | server1.DisConnect | ||
</pre> | </pre> |
Latest revision as of 13:50, 21 July 2020
Article ID: 247312
Article Last Modified on 3/14/2006
APPLIES TO
- Microsoft SQL Server 7.0 Standard Edition
This article was previously published under Q247312
BUG #: 54796 (SQLBUG_70)
SYMPTOMS
If you try to change the length of a column inside BeginAlter and DoAlter like this:
table1.BeginAlter Set column1 = t.Columns("city") column1.Length = 70 table1.DoAlter
this error message occurs:
RESOLUTION
Use ExecuteImmediate to execute the ALTER TABLE ALTER COLUMN. For example:
Dim server1 As New SQLDMO.SQLServer Dim db1 As SQLDMO.Database server1.Connect "(local)", "sa", "" Set db1 = server1.Databases("pubs") db1.ExecuteImmediate ("Alter table publishers Alter column city varchar(50) ") server1.DisConnect
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.
Keywords: kbbug kbfix KB247312