December 3, 2013 at 11:27 pm
Hi
I want to add a filed in my table , but I receive an error , this is : save as text file !!!!
and I have to delete all my DB and create it again, would you please help me?
December 3, 2013 at 11:37 pm
What exactly are you trying to do, what is the exact error you're getting?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 3, 2013 at 11:44 pm
I think u r trying to add column from designer ?
Add column by using sql script
Ex:
ALTER TABLE Table_Name ADD COLUMN_NAME INT
If u want add column from designer , before adding do this changes ,
Tools---> Options--->Designers-->
Un-check this check box: Prevent Saving changes that require table recreation and click ok
December 4, 2013 at 12:50 am
Yes, Exactlty , I want to add a column , of course I have created my table before , an it has data , but now I want to add a column to my table an it does not permit me, it said : save as text file.
December 4, 2013 at 1:04 am
'Save as text file' is not an error. It's very hard to help you without knowing exactly what you're doing and having a description of the error you're getting.
Are you using the GUI designer to add a column?
If so, what is the error you are getting ('save as text file isn't an error')
Have you tried using T-SQL to add the column?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 4, 2013 at 1:21 am
Yes, in design mode I want to add a column, I said it is error because it does not add a column really, It wants to save my table as a text in my hard , without changing my table , I think it is because of permission , do u think so?
December 4, 2013 at 1:29 am
I don't know if it's due to permission because you still haven't posted the error. If there's an error, it would have been displayed in a dialog.
Have you tried using the T-SQL command instead of the designer?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 4, 2013 at 1:43 am
Sounds like you're trying to add a column mid-table which is causing a table rebuild and hence it won't automatically do this unless you de-select the option from => Tools => Options => Designer = Untick 'Prevent saving changes that require table re-creation'.
You really shouldn't be adding columns mid-table however, an ALTER TABLE statement is better. Imagine trying this with a billion row production table. The DBA's wouldn't allow it for starters 😉
December 4, 2013 at 3:46 am
Yes,try to do that
Options => Designer = Untick 'Prevent saving changes that require table re-creation'. it will work.!!
December 4, 2013 at 5:49 am
Or you could skip the GUI completely and use the following, changing integer to the data type you need.
ALTER TABLE table_name ADD column_name integer;
http://msdn.microsoft.com/en-us/library/ms190273%28v=sql.100%29.aspx
December 4, 2013 at 5:58 am
Ed Wagner (12/4/2013)
Or you could skip the GUI completely and use the following, changing integer to the data type you need.
ALTER TABLE table_name ADD column_name integer;
http://msdn.microsoft.com/en-us/library/ms190273%28v=sql.100%29.aspx
+1 , its way better this way.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply