I am trying to write some SQL statement so I can update my entire database table by removing all the spaces from one of its columns.
Here is the database design:
<!-- language: lang-sql --> /****** Object: Table [dbo].[document_control] Script Date: 02/06/2012 21:02:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[document_control]( [id] [int] IDENTITY(1,1) NOT NULL, [doc_number] [nchar](10) NOT NULL, [doc_title] [nchar](256) NOT NULL, [co_num] [int] NULL, [co_date] [date] NULL, [doc_path] [nchar](256) NULL, [doc_revision] [int] NULL, [doc_family] [nvarchar](5) NULL, CONSTRAINT [PK_document_control] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO I have lots of spaces in the [doc_path] column specifically. I know I can easily use LTRIM() function to remove the spaced; however, how can I write a SQL statement so I can update the entire database?