Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Change SQL express table question!

Author  Topic 

Gopher
Yak Posting Veteran

83 Posts

Posted - 2007-04-03 : 11:29:38
Hi all

I have a problem with a user who had a sql express db on a laptop, basically they have a column(street) in a table(houses) which needs its length changing from Varchar(10) to a varchar(15).

Does anyone know how to do this via a script of some kind, the msde DB does not have query analyser but can you do it via the comand prompt?

Cheers in advance!

Gopher

ps: I have a similar post in the SQL 200 Admin forum!

X002548
Not Just a Number

15586 Posts

Posted - 2007-04-03 : 11:38:01
I would bcp out the data to a tab delimited file, drop the table, recreate it, then bcp the data in...does this table have a foreign key reference to it?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Gopher
Yak Posting Veteran

83 Posts

Posted - 2007-04-03 : 11:41:14
No it does'nt!

Do you have instructions on how to do this? bcp I mean?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-04-03 : 12:39:08
Something like


DECLARE @cmd varchar(8000)
SELECT @cmd = 'bcp Northwind.dbo.Orders OUT d:\orders.dat -Spaerscbvd0014 -T -c'
EXEC master..xp_cmdshell @cmd


Or just do it with osql is you can't connect with QA



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -