Solved

remove [ ] in a job name

Posted on 2014-03-25
4
187 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
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
JEaston 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now