October 5, 2009 at 1:07 pm
Is there a way to select records into a temp table and specify the size of the columns at select time?
SELECT
[2] AS [Size]
, [3] AS Placement
INTO #Parse
FROM Split PIVOT ( MAX(value) FOR idx IN ( [1], [2]) ) AS P
I want to the columns to have a size of varchar(50)
I am getting a truncation error because of size of columns
Thanks,
vmon
October 5, 2009 at 1:14 pm
SELECT
CAST([2] AS VARCHAR(50)) AS [Size],
CAST([3] AS VARCHAR(50)) AS Placement
INTO #Parse
FROM Split
PIVOT ( MAX(value) FOR idx IN ( [1], [2]) ) AS P
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 5, 2009 at 2:59 pm
Excellent, thanks!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply