Solved

remove [ ] in a job name

Posted on 2014-03-25
4
190 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 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

718 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