TSQL HELP

Ladies, Gentleman, need some help with the following code below

declare   @li_severity int, @lvc_errmsg varchar(255)

BEGIN TRANSACTION

update  ta_complaint_narrative
set incident_narration = ''
where complaint_id in 
( select complaint_id
  from ta_complaint
  where stage_id <> 0 
    and activity_id <> 0
)
if @@error <> 0 
begin 
    select @li_severity = 16,  
    @lvc_errmsg =  'Cannot set set incident_narration = '' '
     goto error 
end 
COMMIT
if @@error <> 0 
begin 
   select @li_severity = 16, 
          @lvc_errmsg =  'Cannot commit changes in ta_complaint_narrative'
   goto error 
end    

return 

/*  Errors handling  */ 
error: 
  rollback 
  raiserror (@lvc_errmsg, @li_severity, 1) 
GO

Open in new window


this part of the code set incident_narration = ''
was changed to set it to be empty. but I would like it not to be empty and stumped on what I need to put in there. I was thinking * but i dont think that it is it.

Any ideas?

Thanks

T
Tech315Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
You tell us.  What value do you wish to enter into the ta_complaint_narrative
 table, incident_narration column?

'Banana', 42, 'Rick Springfield', ...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott PletcherSenior DBACommented:
Maybe 'n/a' or 'none'?

Btw, unless stage_id and/or activity_id can be negative, it could be more efficient to for "> 0" rather than "<> 0".
0
PortletPaulfreelancerCommented:
':('
'grrrr'
'-'
'not provided'
'unavailable'
'empty'
'void'

http://thesaurus.com/browse/empty
bare
barren
blank
deserted
desolate
devoid
dry
hollow
unfilled
uninhabited
unoccupied
vacant
abandoned
clear
dead
deflated
depleted
desert
despoiled
evacuated
exhausted
forsaken
lacking
vacated
void
wanting
waste
destitute
godforsaken
unfurnished
vacuous

'you tell us' and '42' I quite like too; 'none' has a nice ironic ring to it

sorry, about the flippancy, but you did ask for any ideas
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Tech315Author Commented:
Ok, sorry for the ambiguity of my question. The code above is deleting one of the columns, the narrative column, and was looking for that not to happen .
0
PortletPaulfreelancerCommented:
??The code above is deleting one of the columns, the narrative column

update  ta_complaint_narrative
set incident_narration = ''
where ...

Assume 'delete' means removing values from that column
- but isn't the update statement being instructed to do precisely that?

for all records chosen by this:
select complaint_id
  from ta_complaint
  where stage_id <> 0
    and activity_id <> 0

??, and was looking for that not to happen
not sure what to advise except: don't run the code, or change the code

maybe put the former narration information into a history table?
(as new records to that table)
then set: incident_narration = '*' -- or whatever you choose

Perhaps you could expand on what the code is expected to do?

this time I'm not being flippant, but I am confused.
0
Tech315Author Commented:
Experts thanks for the taking the time out to address my question, sorry was out sick with shingles, and one of the guys from work removed the code. So I'm splitting the points for effort.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.