I have a SQL Server 2000 table with a few fields of "text" data type
that contain rich text. I have to downstream this data and the
recipient cannot handle rich text. I need to figure out a way to
convert it back to plain text. Any suggetions?
Does anyone have the logic to convert RTF formatted data in a textcolumn into plain ascii text that I can use in a varchar variable orfield?We have an app that allows formatted comments/notes to be stored in aSQL 2000 text column. Ideally, I would like a trigger that would copyany inserted comments into a seperate table, varchar field so thatthese are viewable in other apps that can not display formatted RTF.I would really like the logic to be all SQL based and not have to use aclient app to read/convert/insert the data in a batch mode.
Greetings all. I am currently working to improve the security on a legacy application we have at my company. The app was written in vb6 years ago. We now have the app running against a sql 2005 server. One of the function/screens in the application is used to administrate users. (each user has a sql user id) and one of the functions is to reset the password. The vb code uses a call to sp_password. Here is the problem. We setup a network sniffer and found the command being in plain text. While the user logon is encrypted ( SSL Fallback) the sp_password commands issued by the app are plan text. Anyone know of a way to make this encrypted? Leif
How can I set the default body_format in database mail. I would like to send a warning with plain text format (from the alerts), that i'll get on my mobile phone, but the message's format is html... always...and I don't get the sms-s.
sorry to raise this again here. I have seen a lot of posts on this board about plain text rendering but never really a satisfactory answer. So my question is: Has anyone succeeded in developing a custom rendering extension which is able to render a report as plain text?
I am a Technical Lead in a project to convert and migrate reporting from Unix/C to Reporting Services 2005. One requirement is, to render the reports in plain text for archiving purposes. I know that there are a million options out there to archive in PDF and whatever. Well, we need plain text. No way around it! It is a governmental requirement!
I am about to pull the plug on SSRS 2005 just because we are not able to fulfill this requirement. And we are talking about a big project converting >700 reports!
Challenges we are facing:
Reporting components are rendered as they appear in a compnent list, one after each other. If you now have two multiline components side by side, i.e. two lists, the first list component in the array gets rendered and then the other. This makes it almost impossible to render the lines in those two components side by side. In the sample below, the Report Header would be rendered, then the Address block, then the Other Data block, then the Order History Table and then the Account Statement table.
Positioning of text boxes is almost impossible. We are able to find out how many centimeters/inches/millimeters/points a control is located from the left border. But how can we translate this into i.e. how many spaces will we need to add for padding?
The column width can't be determined. SSRS adds a line break if the cell text is longer than the column width.
We have reports which look something like this:
Code Block
Code Block
REPORT NAME
MANAGER NAME
ACCOUNT REPORT DATE
First Name: XXXXXXXXXXXX Other Data: XXXXXXXXXXXXXX Last Name: XXXXXXXXXXXX More Data: XXXXXXXXXXXXXX Address: XXXXXXXXXXXX More Data: XXXXXXXXXXXXXX City: XXXXXXXXXXXX
I also got some advice that SSRS is probably the wrong tool. And I also read this in some of the "Plain Text" posts here. And I am actually surprised about this. People suggest to look for some other tool and not use i.e. email subscrptions, other rendering formats, SSRS security model, snapshot history, report models and all the other goodies only because we can't render in simple text?
If anyone has any information to share, I would very much appreciate it. We also looked at third party tools and plug ins but couldn't find any! If anyone knows of a company who would be able to help us, let me know!
I really would love to pull this project off with SSRS 2005 because I Iike the technology and SSRS provides a lot of functionality we want to leverage. I believe SSRS is the right tool for us and it covers 95% of our business requirements! But at this stage it doesn't look very rosy! Because of the Plain Text rendering!
Hi all. Iv'e tryed out xp_smtp_sendmail, and I like what I can see sofar. The thing I wonder about is if the xp supports sending both htmlAND plain text in the same mail. I'm on a sql2000 sp3 and I have noproblem with the xp when i either send plain text or html, but asstated above I need to send with both formats in one mail......For use when one does not know if the receiver uses a mail-client thatsupports html or not. If not does anyone know of a good way to attackthis problem?thanks in advanceKarl B
I am new to Integration services.I have one query ,Is it possible to import the data from text file in integration services. I know that we can import the data from excel sheet and we can export it to table.But my question is whether we can do the same thing from the text file.If anyone come acroos the same thing send u r possible answers.Your help is much appreciated.
Hello. I'm wondering how I CONVERT or CAST a column of type TEXT to INT with T-SQL ?
Also, is there anyway to catch an error in a Stored Procedure. For example if you try to convert a CHAR column to INT when the column has an 'a' in it, can I try to convert and if it did't work I do something else ? Or is there a way to check if a column has only numbers ?
Thanks for any help, the CONVERT Text to Int is the most urgent ...
I am trying to write a query in access that will pull results that arein the database in a text field and convert to where I can get aaverage including decimals. Any Ideas?-----------------------Start SQL--------------------------------------SELECT AVG(CAST(dbo_sur_response_answer.answer_text AS int)) ASavg_correctFROM (dbo_sur_response_answerINNER JOIN dbo_sur_subitemON dbo_sur_response_answer.subitem_id = dbo_sur_subitem.subitem_id)INNER JOIN dbo_sur_responseON dbo_sur_response_answer.response_id = dbo_sur_response.response_idWHERE (((dbo_sur_response.completed_yn)="Y") AND((dbo_sur_subitem.subitem_id)=478));-----------------------End SQL--------------------------------------
I have an image data type in a table (it is a digital signature) and one of my users wants me to search the image data and see how many people have a certain attribute in their digital signature. I know the image data is HEX, but how, in query analyzer, can I view it as the XML digital signature data that it really is? So, how can I convert hex to text in sql server?
Hi all iam trying to but a varchar variable into a TEXT var but i get this error "The assignment operator operation cannot take a text data type as an argument"
I want to merge data from two different tables that have the same column names but different datatypes.
Table one has a varchar field pubdate_full that includes a date formatted as text like this: '2005-04-15'.
Table two has a smalldatetime field called Hard_NYP and a varchar pubdate field that includes just the year (eg '2007').
I want to Select data in table two and return a pubdate_full field that has either the datepub or the Hard_due. If the Hard_due is not null or '1/1/1900 12:00:00 AM' then I want to fill pubdate_full with that value, otherwise fill it with the pubdate value.
This works in that regard:
SELECT Hard_due, datepub CASE WHEN (Hard_due <> '1/1/1900 12:00:00 AM') AND (Hard_due IS NOT NULL) THEN Hard_Due ELSE datepub END AS pubdate_full from inventory
The question is, how do I convert pubdate_full on the fly to be the same format and datatype as the Table one pubdate_full or vice versa in order to be able to merge the two tables?
I have a number of bit datatypes ( Boat types: Cruiser, Sportfisher, Megayacht, Sailboat) that I would like to place in a text box and do away with the individual selections. For instance, some marinas cater to "Cruiser", "Megayacht" and "Sailboat" while others include the "Sportfisher" also and there are many other combinations of vessels. I am stumped at how to write a query that takes the existing "True" values for each boat type and places them in a text box in the form of " Cruisers, Megayachts, Sailboats" .
I have a source DB that contains a BLOB which is really a bunch of text. I am trying to use SSIS to read this BLOB and stream the chars as text to a flat file which will later be FTP'ed to another server and reloaded as nvarchar records.
In my data flow task I have my source (SQL DB BLOB) and target (Flat File) of course...in between I am using a script component to try and convert the BLOB. Here is my code:
Dim intBlobLength As Integer = Convert.ToInt32(Row.denoteblob.Length) Dim intFinish As Integer = intBlobLength - 1 Dim byteBlob(intFinish) As Byte byteBlob = Row.denoteblob.GetBlobData(0, intFinish)
Hi, How can I convert a text file (.txt) into SQL in ASP.net 2.0 ? The sample of the file format is like that ... 09/03/2007 08:41 "Fung, Kitty" Granted Access D1 Main 2354 111 09/03/2007 08:42 "Ng, Jaclyn" Granted Access D1 Main 21906 18 09/03/2007 08:42 "Leung, Agnes" Granted Access D1 Main 21920 18 Cheers
Hi Everyone,My SQL Query is :"select Field1 from table1"The Field1 in Database is of Type "nvarchar" . I need to convert this Field into "integer" in the Query itself.Please Help!!I have already tried "Select convert(int, Field1 ) from table1"The field gives zero output ThanksRegardsNavdeep
Can you guys help me out? I m trying to sum up some varchar-typed field. I need to convert it to float before doing the summing up so I m using "Cast".
I do get the answer but its not the correct figure. My SQL statement is as follow:
SELECT Sum((Cast(Qty1 as float)) + (Cast(Qty2 as float))) as intAnswer FROM TableName
How can I generate the result using typical SQL statement based on the following tables?
Table a - Salesman (salesId, Name) pk : salesId
Table b - Invoice(InvoiceNo, salesId, InvoiceAmt) pk : invoiceNo fk : salesId -> Table a
The result set :
salesId, Name, sum(InvoiceAmt), InvoiceNos with comma separator
For example:
Table a SalesId Name S001 Peter S002 Alice Table b InvoiceNo SalesId InvoiceAmt INV001 S001 $100 INV002 S001 $100 INV003 S001 $400 INV004 S002 $200 Result set SalesId Name Sum(InvoiceAmt) InvoiceNos S001 Peter $600 INV001, INV002, INV003 S002 Alice $200 INV004
Hello. I am really new to sql server. I have a db in the server that I use for testing. i want to export it in plain sql so as to import it in another db system. How can I do it?
I'm quit new into SQL - have a problem - and hope someone here ca n help me.
I have a table TABLE1 with different fields. A part of it looks like this:
FIELD1 FIELD2 FIELD3
111111 121212 0
111111 121212 91
222222 232323 0
222222 232323 73
etc. etc.
I want to "copy"/write over '0' in FIELD3 with the number in FIELD3 from the line that has the same numbers (and unique for these two lines) in FIELD1 and FIELD2. The table will then look like this:
FIELD1 FIELD2 FIELD3
111111 121212 91
111111 121212 91
222222 232323 73
222222 232323 73
I can make a temporary table or a new field if necessary. I just don't know how to write the right SQL.
Why this won't work. POST_DT is nvarchar(50). I know it should be datetime but, I have no control over it. That's why I'm creating a temp table. But, I want to only insert the most recent invoice. There is code to create test data at the end.
i have string where i need to convert them into Capital text in required string only
i have written query to do this using Charindex it is finding only one how to go for 2nd one i am only finding the 2 nd word through index how to find other words also
I've got a field I'm trying to convert into a date format as it currently sits as a text field. The date setup is of the format DD/MM/YYYY. Some of the fields are NULL, however for the sake of filling in gaps I've just set the nulls to '01-01-1905'.
I've tried to use CAST to change the data into a readable format for SQL Server however I tend to get one of two messages:
Conversion failed when converting date and/or time from character string.
I got a qry that takes 10s. This is off course too long. As I described in my earlier posts, I'm no sql hero, but I'm on a neverending quest to improve. Currently I need a select statement over several (7) tables and return fields from almost all of them. Furthermore I have optional restrictions on fields spread over all those tables, based on a set of parameters. What I initially do is inner join all my tables and then have a big where clause that adds where-rules depending on the arguments given.
Like so: select c.clr_id, n.clr_nm, co.long_nm, p.paint_cd, a.appl_desc, m.modl_nm, y.yr_num from CLR c inner join paint_cd p on c.clr_id = p.clr_id inner join clr_use_yr y on y.clr_id = c.clr_id inner join co on co.co_id = c.co_id inner join modl m on y.modl_id = m.modl_id inner join clr_appl ca on c.clr_id = ca.clr_id inner join appl a on ca.appl_cd = a.appl_cd inner join clr_nm n on c.clr_id = n.clr_id WHERE (CASE @regn when '' THEN '' ELSE n.regn_cd END) like (CASE @regn when '' THEN '' ELSE @regn END) AND (CASE @co when '' THEN '' ELSE co.long_nm END) like (CASE @co when '' THEN '' ELSE @co END) AND (CASE @clrNm when '' THEN '' ELSE n.clr_nm END) like (CASE @clrNm when '' THEN '' ELSE @clrNm END) AND (CASE @paintCd when '' THEN '' ELSE p.paint_cd END) like (CASE @paintCd when '' THEN '' ELSE @paintCd END) AND (CASE @applDc when '' THEN '' ELSE a.appl_desc END) like (CASE @applDc when '' THEN '' ELSE @applDc END) AND (CASE @useYear when '' THEN '' ELSE cast(y.yr_num as varchar(4)) end) like (CASE @useYear when '' THEN '' else @useYear END) AND (CASE @modlNm when '' THEN '' ELSE m.modl_Nm END) like (CASE @modlNm when '' THEN '' ELSE @modlNm END)
It appeared to me that by getting those where clauses in the join, I would limit the calculations. So the joins where similar to this: inner join paint_cd p on c.clr_id = p.clr_id AND (CASE @paintCd when '' THEN '' ELSE p.paint_cd END) like (CASE @paintCd when '' THEN '' ELSE @paintCd END)
The result though, was exactly the same. So, where in my thinking am I wrong and what is the correct way to go about this?
Thank You, You are the first person, that has given me a clear answer. I am going to explain in plain English What this SP is suppose to do.
I have to find any station_nbr that has more than one group_code and that the current date = (DATEADD(mm,DATEDIFF(mm,0,dateadd(mm,-0-datepart(day,0),getdate())),0) The current date starts with the first day of the previous month. Example today is October 10, 2007 I need September 01, 2007 for this query. To insert the record it needs to be active meaning that the current date is in between Beg_eff_date and end_eff_date, and the end_eff_date is = ‘12/31/3000’
I need to write SP(cursor) that reads line by line this table and that insert the answer: INSERT INTO #TP_TIES_OVerlaping_Dates.
The above explanation is for the first type of Error.
The second Type of Error: If the Group Code ends with "W" and the End_effective_date = '12/31/3000' and the W_Beg_date is Part of the Temp Table(I to create the W_Beg_Date Column) -- is GREATER than the End_eff_date. I want to Insert this Record into the Table. I need to set sometype of Record Control to make the different between one error to another one.
I thank you so much for your help.....I hope this is clear to understand for everybody.
We are trying to figure out how to make a stored procedure call and pass some inputs using C# and plain ADO. We are able to call an empty stored procedure but cannot pass parameters into a stored procedure.
Does anyone have sample code in C# whereby we can open a connection and pass inputs into a stored procedure? The following is a sample code we are using:
In the above example, we create a parameter of type integer and try to add it to the ADO Command object. It is supposed to return a recordset. It returns a recordset with record count -1.