﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Get Left-most Char of Col A to insert into Col B / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 03:27:33 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>That is a very good tip from Jeff.....Computed Columns are not used a lot....they are even sometimes avoided in the cases they could be used....it may be due to negligence or ignorance.....the following links would give you a very good insight at Computed Columns : [url=http://msdn.microsoft.com/en-us/library/ms191250(v=sql.105).aspx][b]COMPUTED COLUMNS[/b][/url][url=http://blog.sqlauthority.com/2010/08/22/sql-server-computed-columns-index-and-performance/]COMPUTED COLUMNS - Performance[/url]</description><pubDate>Wed, 14 Nov 2012 22:06:20 GMT</pubDate><dc:creator>vinu512</dc:creator></item><item><title>RE: Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>Thanks for the tip, Jeff. I'll look into computed columns - never used them. Yes always position 1.</description><pubDate>Wed, 14 Nov 2012 21:02:01 GMT</pubDate><dc:creator>dbaforever</dc:creator></item><item><title>RE: Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>If it is always going to the first character of column a, might consider redefining column b as a computed column to save you the pain of ongoing updates, etc. depending on your needs of course.Just a thought.</description><pubDate>Wed, 14 Nov 2012 20:59:45 GMT</pubDate><dc:creator>JeffRush</dc:creator></item><item><title>RE: Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>Ah, I got it.Update Table1Set ColB = (Select Substring(ColA, 1, 1));This worked.Thanks.</description><pubDate>Wed, 14 Nov 2012 20:54:01 GMT</pubDate><dc:creator>dbaforever</dc:creator></item><item><title>RE: Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>Is this what you need ? Look up the  LEFT function in BOL Books On Line[code="sql"]   CREATE TABLE #T(Cola VARCHAR(6),Colb CHAR(1))    INSERT INTO #T(Cola,colb)    SELECT 'FGHIJK',LEFT('FGHIJK',1)-- check result    SELECT Cola,colb FROM #TResult:Cola	colbFGHIJK	F[/code]</description><pubDate>Wed, 14 Nov 2012 20:52:40 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>Get Left-most Char of Col A to insert into Col B</title><link>http://www.sqlservercentral.com/Forums/Topic1384959-391-1.aspx</link><description>Hi experts,For example:  Col A Varchar(6)  contains FGHIJK                    Col B char(1)I need to insert the first character - F in this case, into Column BI need update a column in all rows by retrieving the left-most character of Col A and insert that value into Column BHow can this be done without getting the "would be truncated" error?Thanks, Bill</description><pubDate>Wed, 14 Nov 2012 20:32:33 GMT</pubDate><dc:creator>dbaforever</dc:creator></item></channel></rss>