[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

remove [ ] in a job name

Posted on 2014-03-25
4
Medium Priority
?
195 Views
Last Modified: 2014-03-25
Hello,

How can I remove [ ]  between  a job name?
I try to modify this query, but the result is not correct :
set nocount on; SELECT DISTINCT REPLACE(name, ' [ ] ', '') FROM    msdb..sysjobs"
Thanks
0
Comment
Question by:bibi92
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
John Easton earned 1500 total points
ID: 39953056
I assume your current job name is something like [job] - if so, try the following:

SELECT DISTINCT REPLACE(REPLACE(name, '[', ''),']','') FROM msdb..sysjobs
0
 

Author Comment

by:bibi92
ID: 39953129
Hello,

Yes like [ job ], I try but how can I delete space like [] are removed.
Thanks
0
 
LVL 32

Expert Comment

by:awking00
ID: 39953357
Not sure I understand your concern with deleting space. If you're referring to something like [job ] (where ther is a space after job), then just modify the query JEaston provided adding a trim function (i.e. trim(replace(replace(name, '[',''),']',''))
0
 

Author Comment

by:bibi92
ID: 39953403
Hello,

Thanks, I have found :
SELECT DISTINCT REPLACE(REPLACE(REPLACE(name,'[',''),']',''),' ', '') FROM msdb..sysjobs

Regards
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question