2012年2月9日星期四

ansi padding issues 64 bit vs 32 bit

Hi all.

I'm using the SQL 2005 partitioning schemes to keep 5 weeks worth of data in a table, swapping in a new week and getting rid of the old week. It works fantastic in a 32 bit environment, when I try it in a 64 bit Itanium cluster, I start having issues with the schema's (specifically the ANSI PADDING) being different between my partitioned table and my "Archive" table, the one that I'm switching the old data out to.

When I created the partitioned table originally, I didn't specify ansi padding at all, so my assumption would be that it would take the default of the database, which is "false". However, when you execute a script in Mgt Studio, the default setting is to have ANSI Padding ON. That's fine, so now my tables are all set to ANSI Padding On when I created them, but the database setting is Off, I can live with that. So how come when I run my SSIS Package in a 32 bit environment, which calls 2 stored procedures to do the partitions switching (inside the 2 stored procedures I have dynamic "Create Table" statements for both the New Week and Archive tables, in order to get them on the proper file groups), these Create table statements apparently create the tables with ANSI Padding set to ON as well, because I don't have a problem. But when I use the exact same SSIS Package with the exact same Stored Procedures in the 64 bit environment, I get the following error?

Error: ALTER TABLE SWITCH statement failed because column 'VendorNum' does not have the same ansi trimming semantics in tables 'ODSTJM.dbo.WeeklyActivityCumulative' and 'ODSTJM.dbo.WeeklyActivityCumulativeArchive'.(42000,50000) Procedure(usp_WACPartitionForArchive), Batch 10 Line 188

If I right click either the New or Archive tables (that are dynamically generated) in Mgt Studio and generate script, these 2 tables both Have the ANSI PADDING set to OFF? Every other table is set to ON. Again, this issue doesn't happen in 32 bit, only 64 bit. Any ideas?

Please help.

Andy

This actually ended up being an issue with DBArtisan. By default, dbArtisan has ansi padding set to off, while SQL 2005 has it set to on in Mgt Studio, which was causing the problem. Lesson learned, don't run from dbArtisan.

没有评论:

发表评论