Monday, March 19, 2012

ALTER TABLE ALTER COLUMN

For some reason, the SQL Server I am accessing indicates the following
script executed just fine, but when I look at the database design in
Enterprise Manager, it indicates the design has not been modified at
all. Any suggestions as to why this is happening?
USE [dbaseName]
ALTER TABLE [tableName]
ALTER COLUMN [columnName] int NULL
go
Did you refresh EM?
"Mike London" <mikey@.email.unc.edu> wrote in message
news:eewGDcmJFHA.4012@.TK2MSFTNGP09.phx.gbl...
> For some reason, the SQL Server I am accessing indicates the following
> script executed just fine, but when I look at the database design in
> Enterprise Manager, it indicates the design has not been modified at
> all. Any suggestions as to why this is happening?
> USE [dbaseName]
> ALTER TABLE [tableName]
> ALTER COLUMN [columnName] int NULL
> go
|||Yep, even closed it out and loaded it again, no dice. Even checked to
make sure I was in the development version (where I was applying it).
ChrisR wrote:

> Did you refresh EM?
> "Mike London" <mikey@.email.unc.edu> wrote in message
> news:eewGDcmJFHA.4012@.TK2MSFTNGP09.phx.gbl...
>
>
|||What does Query Analyzer say when you say sp_help tablename?
(In other words, you shouldn't care what Enterprise Manager is "informing"
you with...)
http://www.aspfaq.com/2455
http://www.aspfaq.com/
(Reverse address to reply.)
"Mike London" <mikey@.email.unc.edu> wrote in message
news:u$Z2TpmJFHA.3336@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Yep, even closed it out and loaded it again, no dice. Even checked to
> make sure I was in the development version (where I was applying it).
> ChrisR wrote:
|||If you sp_who for the table, what does it say?
"Mike London" <mikey@.email.unc.edu> wrote in message
news:u$Z2TpmJFHA.3336@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Yep, even closed it out and loaded it again, no dice. Even checked to
> make sure I was in the development version (where I was applying it).
> ChrisR wrote:
|||It says Command executed successfully, the normal text .
Aaron [SQL Server MVP] wrote:
> What does Query Analyzer say when you say sp_help tablename?
> (In other words, you shouldn't care what Enterprise Manager is "informing"
> you with...)
> http://www.aspfaq.com/2455
>
|||WHOOPS, sorry lemme check...Ignore the last reply ;)
Aaron [SQL Server MVP] wrote:

> What does Query Analyzer say when you say sp_help tablename?
> (In other words, you shouldn't care what Enterprise Manager is "informing"
> you with...)
> http://www.aspfaq.com/2455
>
|||I assume that is sp_help. The sp_help seems to not show a column for
default values in it, unless it is named something else,.... either
way, it is not showing ANY default values in the display.
ChrisR wrote:
> If you sp_who for the table, what does it say?
>
> "Mike London" <mikey@.email.unc.edu> wrote in message
> news:u$Z2TpmJFHA.3336@.TK2MSFTNGP10.phx.gbl...
>
>
|||This is the first time you've mentioned that you added a default value. Go
back to your original post, it says you wrote:
USE [dbaseName]
ALTER TABLE [tableName]
ALTER COLUMN [columnName] int NULL
go
Where is the default value there?
Anyway, if you did something different than the above, then you need to look
elsewhere, as I don't think sp_help brings back defaults:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'tableName'
http://www.aspfaq.com/
(Reverse address to reply.)
"Mike London" <mikey@.email.unc.edu> wrote in message
news:O6r8j#mJFHA.3340@.TK2MSFTNGP14.phx.gbl...
> I assume that is sp_help. The sp_help seems to not show a column for
> default values in it, unless it is named something else,.... either
> way, it is not showing ANY default values in the display.
|||Sorry I was not clear. I am trying to REMOVE default value settings
that are currently in the Dbase, that is why they are not in the
original script.
I have a table in production (which I cannot modify the design directly,
the DBA needs to do that) which has defaults in it. I want to remove
those defaults from the column. I tried the script I posted originally
and it says it ran, but did NOT clear the defaults.
Does that clarify?
Sorry,
Mike
Aaron [SQL Server MVP] wrote:

> This is the first time you've mentioned that you added a default value. Go
> back to your original post, it says you wrote:
> USE [dbaseName]
> ALTER TABLE [tableName]
> ALTER COLUMN [columnName] int NULL
> go
> Where is the default value there?
> Anyway, if you did something different than the above, then you need to look
> elsewhere, as I don't think sp_help brings back defaults:
> SELECT * FROM INFORMATION_SCHEMA.COLUMNS
> WHERE TABLE_NAME = 'tableName'
>

No comments:

Post a Comment