Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Case and coulumn width

Author  Topic 

Sprinjee
Starting Member

42 Posts

Posted - 2005-10-25 : 12:02:27
I wrote an SQL script with the intention to schedule it on the server; outputing a .csv that is imported by another program (using a default location)

It is importent that the position of the of the comma (seperation chararcter) for each row is at the 35th position. using the following select statement this works perfectly

select left(name, 35) from table

However my select statements uses CASE statements even though I put left(name, 35) in there...it uses the length defined for this column in the table definition (whicht is 128 characters). This results in a CSV export with my comma on the 128th position (instead of 35th). Does anyone know a way of solving this??

PaladinZ06
Starting Member

3 Posts

Posted - 2005-10-25 : 12:54:29
Please provide the SQL with the CASE statements that you are trying to resolve
-Paladin
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2005-10-25 : 13:09:49
Try using: cast(name as char(35))
Go to Top of Page
   

- Advertisement -