SQL Server - Displaying >= a different way on a report - sql-server

I have a user who wants to show quality spec descriptions where the >= shows as an underlined > instead of having the = sign to the right. In SQL server, I cannot find a way to do this and I don't think there is an ASCII code for this. I know this is an obscure one but I thought I would ask the question.
Thanks,
Maria
Here is more information and an image of what is being asked for.
I wrote a SQL stored procedure that is executed by an SSRS report. The grid that is returned from this proc contains a formatted criteria column. The users want to see Less Than Or Equal To as a left carrot underlined. All in one space and not like this <=. In Excel and Word you can do this because you can just use < and then underline it. But in SQL, I can't do this. I cannot add the underline in SSRS because the column is a big long text string and it's variable. I've convinced the users to forget this. I told them that some things they have done in Word and Excel can't be done on this type of automated report. Short of using the ascii character of < and the ascii character for _ and then making sure they are on top of each other by preventing a space seems way too complicated when they can just get used to seeing <= or >= . Let me know if you agree and thanks for the input.
Thanks for the reply to my post.

Related

Customize Normalization in SQL Server Full Text Search by replacing characters

I want to customize SQL Server FTS to handle language specific features better.
In many language like Persian and Arabic there are similar characters that in a proper search behavior they should consider as identical char like these groups:
['آ' , 'ا' , 'ء' , 'ا']
['ي' , 'ی' , 'ئ']
Currently my best solution is to store duplicate data in new column and replace these characters with a representative member and also normalize search term and perform search in the duplicated column.
Is there any way to tell SQL Server to treat any members of these groups as an identical character?
as far as i understand ,this would be used for suggestioning purposes so the being so accurate is not important. so
in farsi actually none of the character in list above doesn't share same meaning but we can say they do have a shared short form in some writing cases ('آ' != 'اِ' but they both can write as 'ا' )
SCENARIO 1 : THE INPUT TEXT IS IN COMPLETE FORM
imagine "محمّد" is a record in a table formatted (id int,text nvarchar(12))named as 'table'.
after removing special character we can use following command :
select * from [db].[dbo].[table] where text REPLACE(text,' ّ ','') = REPLACE(N'محمد',' ّ ','');
the result would be
SCENARIO 2: THE INPUT IS IN SHORT FORMAT
imagine "محمد" is a record in a table formatted (id int,text nvarchar(12))named as 'table'.
in this scenario we need to do some logical operation on text before we query in data base
for e.g. if "محمد" is input as we know and have a list of this special character ,it should be easily searched in query as :
select * from [db].[dbo].[table] where REPLACE(text,' ّ ','') = 'محمد';
note:
this solution is not exactly a best one because the input should not be affected in client side it, would be better if the sql server configure to handle this.
for people who doesn't understand farsi simply he wanna tell sql that َA =["B","C"] and a have same value these character in the list so :
when a "dad" word searched, if any word "dbd" or "dcd" exist return them too.
add:
some set of characters can have same meaning some of some times not ( ['ي','أ'] are same but ['آ','اِ'] not) so in we got first scenario :
select * from [db].[dbo].[table] where text like N'%هی[أي]ت' and text like N'هی[أي]ت%';

SQL Server Problem with carriage splitting a string

DECLARE #Description2 VARCHAR(MAX);
SELECT #Description2 = '1. Each week there will be a philosophical question to address. For example, you will address questions such as do we have freewill or are we determined?, what does quantum physics tell us about the nature of reality?, and what are the philosophical implications of Darwinian evolution? Utilizing the readings for the week prepare a written essay response. There will be a minimum of ten mini-essays for the term and each must be a minimum of 200 words.
2. Develop an argument on the topic of ontology, focusing specifically on the question "Are we just the brain?" Argue either the materialist position (we are just the brain) or the non-materialist position (we are not just the brain), drawing from the primary writings of the philosophers. Be sure to explain both positions in your essay and then make the case for the position you are supporting. This argumentative essay needs to be at least 750 words in length. We will then conduct an in class debate and you will need to argue your point in a debate setting.
3. Develop an argument in the area of ethics, arguing for or against animal rights. Make sure to utilize primary writings in the construction of your argument. This argumentative essay needs to be at least 750 words in length. Students will present their position to the class in a ten minute oral presentation.
4. Having read the writings of Epictetus and Sartre compare and contrast Stoicism and Existentialism. Write a 750 word essay highlighting the key differences and similarities.
5. Analyze the primary readings of Nietzsche in journal form. Choose 10 separate passages to analyze and include the following: a) a summary of the passage; b) an interpretation or analysis of the argument; c) a comparison and/or contrast to the ideas of another philosopher or philosophy; d) personal insight into the writing by applying the ideas to you or to the world at large (its meaning on a deeper, more personal level). This journal will be at least 1000 words in length. '
set #Description2 = replace(replace(replace(replace(replace(replace(replace(#Description2,'<p>',''),'</p>',''),'<br />',''),' ',''),'<br />.<br />',''),'<div>',''),'</div>','')
set #Description2 = concat('???',REPLACE(#Description2,CHAR(13)+char(10),'???'))
select ltrim(s.Item)
from dbo.DelimitedSplit8K_LEAD(#Description2, '???') s
where ltrim(s.Item) <> ''
So what do you actually want to happen? And what are you seeing that is different from what you want?
In SSMS, if you go to tools > options > query results > SQL Server > results to grid, there is a checkbox labelled "retain CR/LF on copy or save" which determines how varchar data will be treated when you click on the output grid results and copy the data.
If you check the checkbox, the carriage return/linefeed will be retained. Ie, if you do:
select 'a
b'
Run that query, copy the result from the grid, and paste it into, say, notepad, you will get 2 lines of text in notepad.
On the other hand, if you don't check the checkbox, you will only get a single line in notepad.
Be aware that if you change the setting of this checkbox, I believe you will need to open a new query window to see the new behaviour.
Note that this only controls the behaviour of SSMS. It has nothing to do with how your data is "really" stored, for example, if you insert it into a table. If you have an application reading data from a table, the way it formats the output is up to the application.

nvarchar data type in sql not supported math type character

I want to insert multi language, and math type uni character throw rich text box,
in sql nvarchar data type.
But it does not support certain character like mention below in picture red circle.
After that i got it throw crystal report show in green box but its changed?
I tried editing my previous post or adding a new comment, but i needed to have 50 reputations for the that. So, if this post is bypassing any rules, forgive me as i had to help the OP.
I believe one or more of these links should be of help:
http://www.vbforums.com/showthread.php?700133-RESOLVED-Copy-RTF-to-Clipboard-but-it-will-not-paste-to-notepad
How to write textbox values to .txt file with vb.net
https://social.msdn.microsoft.com/Forums/en-US/6f7cf2c4-47dc-467e-add9-dd7b2be84249/writing-text-to-notepad-with-visual-basic?forum=Vsexpressvb
Let us know how it turned out for you. Remember to mark as answered if it helped you.

Identify all strings in SQL Server code (red color - like in SSMS)

I was not able to solve this by myself so I hope I didn't miss any similar post here and I'm not wasting your time.
What I want is to identify (get a list) of all strings used in SQL Server code.
Example:
select 'WordToCatch1' as 'Column1'
from Table1
where Column2 = 'WordToCatch2'
If you put above code to SSMS all three words in apostrophes will be red but only words 'WordToCatch1' and 'WordToCatch2' are "real" strings used in code.
My goal is to find all those "real" strings in any code.
For example if I will have stored procedure 10k rows long it would be impossible to search them manually so I want something what will find all those "real" strings for me and return a list of them or something.
Thanks in advance!
The trouble is, Column1 is nothing particular different compared to WordToCatch1 and WordToCatch2 - not unless you parse the SQL yourself. You could modify your query to take the quotes away from Column1 and it will show up coloured black.
I guess a simple regex will show up all identifiers after an AS keyword, which would be easier than fully parsing SQL, if all the unwanted strings are like that, and its not just an example.

SSRS how to format memo field

I'm pulling data from a SQL Server 2008 R2 database and one of the fields is a memo field.
When the data is displayed it comes out in the format DATE/USER/then the message. There is a line break and this repeats. For example:
30/10/2013 11:34 TRACEY : order Created
30/10/2013 11:38 AUTO : order Authorised
30/10/2013 11:40 TRACEY : order Issued
30/10/2013 11:41 TRACEY : order processed
I don't have an control in changing SQL database tables/fields.
I want to be able to format this ugly block of text but really struggling to find a solution - for display in SSRS report. Is there any way I can add a space between each line? Or strip out certain words or complete lines based on some specific parameter?
I just don;t seem to be enable control formatting of memo fields. Any help appreciated.
You can write your own function (in the report' declaration) which will perform the formatting, but this is not the simple task. After this you can call this function and receive a formatted text.
Samples of this you can find in the following articles:
http://technet.microsoft.com/en-us/library/ms156028.aspx
http://technet.microsoft.com/en-us/library/ms155798%28v=sql.100%29.aspx

Resources