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
 Old Forums
 CLOSED - General SQL Server
 left or right function

Author  Topic 

casati74
Posting Yak Master

109 Posts

Posted - 2006-09-06 : 04:31:36
Hello I have a table name ending with s; every table have a ID Column named how table without s

es:

CCHeats 'table name'
CCHeatID 'columnID'

I want set @var1 = tableName withotu s +ID

set @var1 = CCHeat+ID

How can i do it?????

Thank's

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-09-06 : 04:35:02
set @var1 = LEFT(@CCHeat, LEN(@CCHeat) - 1) + 'ID'

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

casati74
Posting Yak Master

109 Posts

Posted - 2006-09-06 : 04:38:45
thank's a lot
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-09-06 : 09:11:33
Can you explain what you are trying to do with that string?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -