473,890 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change TrimTrailingBla nks from No to Yes

Hi I've got many tables that has columns definition TrimTrailingBla nks = NO to
all char and varchar columns.

How can I set TrimTrailingBla nks to Yes without re-creating the tables.

Jul 20 '05 #1
4 17310
UPDATE <TableName>
SET TrimTrailingBla nks = 'Yes'

Jul 20 '05 #2
I doubt a simple update is what Ted is asking for. Ted to my knowledge
TrimTrailingBla nks is set at table creation based on the Ansi_padding
setting at that time. Sorry don't think MS has provided a way to change the
setting on a table after the creation. :( Hope I'm wrong....


"DishanF" <di****@gmail.c om> wrote in message
news:11******** *************@c 13g2000cwb.goog legroups.com...
UPDATE <TableName>
SET TrimTrailingBla nks = 'Yes'

Jul 20 '05 #3
This is unsupported as it is manipulating system tables but here it is.

-- Set Allow updates to system tables ON
sp_configure 'allow',1
reconfigure with override

-- Turn on the "TrimTrailingBl anks" bit for tables listed....
-- Will SET TrimTrailingBla nks to YES for all columns in the table
-- you might want to be more selective by listing table and column name.

Update syscolumns
set typestat = typestat |2
where id in ( object_id('t1') )

-- TURN OFF allow updates
sp_configure 'allow',0

"Ted" <tx*@emia.com.a u> wrote in message
news:b5******** *************** ***@posting.goo gle.com...
Hi I've got many tables that has columns definition TrimTrailingBla nks =
NO to
all char and varchar columns.

How can I set TrimTrailingBla nks to Yes without re-creating the tables.


Jul 20 '05 #4
[posted and mailed, posted and mailed]

Ted (tx*@emia.com.a u) writes:
Hi I've got many tables that has columns definition TrimTrailingBla nks =
NO to all char and varchar columns.

How can I set TrimTrailingBla nks to Yes without re-creating the tables.

First, you should think twice before you take this path. TrimTrailingBla nks
= No, is the effect of the setting ANSI_PADDING being ON. ANSI_PADDING is
on by default for connection from most clients (DB-Library being the
exception.) Furthermore, ANSI_PADDING must be on when you are using
indexed views and indexed computer columns. There may be further situations
where ANSI_PADDING is needed in future versions of SQL Server.

That said, ALTER TABLE is what you can use:
CREATE TABLE trimtrailer(a varchar(12) NOT NULL)
INSERT trimtrailer(a) VALUES ('Trimmer ')
ALTER TABLE trimtrailer ALTER COLUMN a varchar(12) NOT NULL
INSERT trimtrailer(a) VALUES ('Trimmer ')
SELECT '<' + a + '>' FROM trimtrailer
DROP TABLE trimtrailer

Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: J.C. Flores | last post by:
Hello all, First of all, I must state that I'm new to SQL Server, but have been a long-time software guy for quite some time. Please excuse the potential simplicity of the solution to my problem. I create a blank database (TestDB) under my server machine (SQL Server 2000 Standard)... I then create a new table (Run_Number) with only one record in it.
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u click on image 1a u change" image x" to image 1a when u click on image 2a u change" image x" to image 2a when u click on image 3a u change" image x" to image 3a
by: beanweed | last post by:
BACKGROUND ---------- I have an ASP.NET application having two panels. In one panel, an XML document, transformed using xsl, is displayed. In the other panel are some controls that allow a user to change the xml. For example, each "l_item" element appears as a row in a table labelled with a "label"; so if I have <l_item id="1"> <label>blah</label> ...
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is the printer destination for special reports such as stickers and mailing labels. The Mailing Label report is, of course, designed here for a specific printer (Mailing Label). At another site, the name could be completely different. Other than...
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
by: active | last post by:
It appears to me that if I change the Control's client size the controls size does not change to agree with the new size. Does it work like the VB6 ScaleWidth and ScaleHeight? That is after I change the Clientsize does the display stay the same but the number of units required to reference a given point changes? Anyway, it appears to me that If I want to change to size of the control so that the client size is some value, I need to...
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change data in the text boxes. Then an "update" button saves the data back to the database. What is the best way to change several properties on most of the textbox controls on the form when the "modify" button is clicked? (e.g. make them editible (and...
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
by: monkey1001 | last post by:
my program is suppose to show my due change and i got it working but my change and coins are wrong how can i improve it thank you..(its supposed to be in java)
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.