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 2000 Forums
 SQL Server Administration (2000)
 ANSI Padding

Author  Topic 

MuadDBA

628 Posts

Posted - 2004-08-16 : 12:04:08
Is there any way to know for sure if a table created in SQL 7.0 was created with ANSI Padding on or off?

I have a db created by a vendor which makes heavy use of the CHAR datatype allowing NULLS. If he didn't specify ANSI Padding on, then these nulls aren't taking up a lot of needless space. If he did, well, in addition to shooting him with a shotgun full of rock salt, I will probably be converting these fields to varchar since they have a good percentage of nulls in them (some as much as 90%)

The problem is that I am running out of space on the server, and I'm about 6 months away from a full server upgrade, so they don't want to spend anymore on HW for this old server if they can avoid it.

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-08-16 : 13:25:04
SELECT OBJECTPROPERTY(OBJECT_ID('emc_clone_details'),'IsAnsiNullsOn')



MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

MuadDBA

628 Posts

Posted - 2004-08-16 : 13:29:10
quote:
Originally posted by derrickleggett

SELECT OBJECTPROPERTY(OBJECT_ID('emc_clone_details'),'IsAnsiNullsOn')



MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.



Thanks Derrick, but I was looking for ANSI Padding, which is not in the object properties.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-08-16 : 13:37:32
Sorry. I wasn't paying attention. The only way I know to test this is to run COLUMNPROPERTY against a char/text column on the table. If AnsiTrim or whatever it is = 1 then it was set to ON when you created it. It's in Books Online for the exact syntax, etc.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

MuadDBA

628 Posts

Posted - 2004-08-16 : 13:55:06
Thanks that was the ticket!
Go to Top of Page
   

- Advertisement -