Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: alter table...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 11170 of 11517
Post > Topic >>

Re: alter table query not working after working at least once. MS SQL

by quincy451@[EMAIL PROTECTED] Jun 26, 2008 at 01:29 PM

On Jun 24, 3:55=A0pm, Erland Sommarskog <esq...@[EMAIL PROTECTED]
> wrote:
> =A0(quincy...@[EMAIL PROTECTED]
) writes:
> > Ok I think we are on to something here...not sure what...I get back
> > one cell with begin_call in it for this query.
> > The application when it works does the following:
> > We have a table begin_call we want to modify it in some arbitrary
> > way. =A0So we do this.
> > We create begin_call_temp with the structure we want.
> > Then we transfer existing data from begin_call to begin_call_temp
> > using inerrt into.
> > Then we drop begin_call. .
> > Then we do a sp_rename begin_call_temp begin_call.
>
> > This entire sequence has worked at least once. =A0
>
> Yes, it works the first time. It does not work the second time, because
> apparently you forgot to rename the primary key when you renamed the
> table.
Yes I added
EXEC sp_rename 'begin_call_temp.PK_begin_call_temp',
'PK_begin_call','index';
Before
EXEC sp_rename 'begin_call_temp','begin_call';

And it all seems to work.
Thank you,
David
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@[EMAIL PROTECTED]
>
> Books Online for SQL Server 2005
athttp://www.microsoft.com/technet/prodt=
echnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000
athttp://www.microsoft.com/sql/prodinfo/=
previousversions/books.mspx
 




 8 Posts in Topic:
alter table query not working after working at least once. MS SQ
quincy451@[EMAIL PROTECTE  2008-06-23 14:07:59 
Re: alter table query not working after working at least once. M
Erland Sommarskog <esq  2008-06-23 21:47:48 
Re: alter table query not working after working at least once. M
quincy451@[EMAIL PROTECTE  2008-06-23 21:00:57 
Re: alter table query not working after working at least once. M
Hugo Kornelis <hugo@[E  2008-06-24 23:01:58 
Re: alter table query not working after working at least once. M
Erland Sommarskog <esq  2008-06-24 20:55:47 
Re: alter table query not working after working at least once. M
quincy451@[EMAIL PROTECTE  2008-06-24 02:19:03 
Re: alter table query not working after working at least once. M
"Andrew Morton"  2008-06-24 11:20:53 
Re: alter table query not working after working at least once. M
quincy451@[EMAIL PROTECTE  2008-06-26 13:29:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 0:56:16 CST 2008.