Decoding MIME Base64
May 18, 2006
Hi
How do you decode an image (found inside an xml file) which has been encoded in MIME Base 64. If you read in the string, how would you get the image?
I know other database systems (like ASA) that has a build in function to do it for you but I cant find a similar function in SQL Express?
Thanks
View 1 Replies
Feb 16, 2004
Yes i just can't find a place to help me out on something.
Everything went well to create the XML using transact SQL command
SELECT TOP 10 * FROM TblEvenement for xml auto, binary base64
But how do decode my image field in my XML so i can save the data into a new table ..
all this as to be done in a store procedure inside SQL-Server 2000 !!
thanx guys !!
***Any good sites or example i can use for !!
View 5 Replies
View Related
May 8, 2008
Hello, I've been banging my head trying to figure this one out so I appreciate any help you guys can provide.
I've setup and configured SQL 2005's Database mail and have sent a few plain and simple text emails and I receive it fine at the destination.
I now want to send mime messages but I'm not sure what I'm doing wrong. I took the following source from an email that linked-in sent me which was a mime message:
"
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary='----=_Part_434343432'
------=_Part_434343432
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Plain Text Goes Here
------=_Part_434343432
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<html>
<body>
<b>HTML Goes here</b>
</body>
</html>
------=_Part_434343432--
"
and put the above text in the @body parameter of the stored proc msdb.dbo.sp_send_dbmail and submitted it.
When I received the email, it didn't appear as html. Instead, I just got the mime message above as plain text in my email as if someone just typed it and sent it to me. What do I need to do for SQL Database Mail to send the above as a MIME message?
Thanks in advance for any help
View 5 Replies
View Related
Feb 28, 2008
Does anyone have some TSQL that will do a base64 encode? I have a need for uid and pwd columns and need to have a third field that will be these values base64 encoded. Best way I can figure is to have a trigger on insert/update.
Please note that I am using Windows Server 2000 and using SQL Server 2000.
View 4 Replies
View Related
Jun 7, 2006
Hi,
I have a xml string which is consist of some images encoded in base64; I have to extract these images in a stored procedure and save them in some tables.
The problem is that I can't decode this base64s to images. Is there a way to do it? (I use SQL Server 2005 Enterprise)
Thanx
View 5 Replies
View Related
Sep 5, 2007
CREATE FUNCTION dbo.fnDeURL
(
@URL VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @Position INT,
@Base CHAR(16),
@High TINYINT,
@Low TINYINT,
@Pattern CHAR(21)
SELECT@Base = '0123456789abcdef',
@Pattern = '%[%][0-9a-f][0-9a-f]%',
@Position = PATINDEX(@Pattern, @URL)
WHILE @Position > 0
SELECT@High = CHARINDEX(SUBSTRING(@URL, @Position + 1, 1), @Base),
@Low = CHARINDEX(SUBSTRING(@URL, @Position + 2, 1), @Base),
@URL = STUFF(@URL, @Position, 3, CHAR(16 * @High + @Low - 17)),
@Position = PATINDEX(@Pattern, @URL)
RETURNREPLACE(@URL, '+', ' ')
END
E 12°55'05.25"
N 56°04'39.16"
EDIT: Decoding + as Jeff mentioned
View 9 Replies
View Related
Nov 11, 2004
Hello All
I'm working on a recurring multi-day appointment program. Basically the user can choose a meeting on multiple days of the week over a span of time. For example: Tuesday and Thursday from 10:00 to 10:30 from December 1st 2004 to February 27th 2005.
So I've decided the best way to handle this is to assign a value to each day of the week like so:
MON = 1
TUE = 2
WED = 4
THU = 8
FRI = 16
SAT = 32
SUN = 64
So if the user picks TUE and THU that would be 2 + 8 = 10. The value is unique and seems to work.
So the values would be:
@begin_date = '12/01/2004'
@begin_time = '10:00 AM'
@end_date = '02/27/2005'
@end_time = '10:30 AM'
@recur_days = 10
Now I want to pass the values to stored procedure that will decode the recur_days variable and create entries in a table for each date. I'm struggling to figure out 2 things
1. How do I decode the 10 back into 2(TUE) + 8(THU) ( I think it has something to do with the bitwise AND "&" operator but I'm not sure how to use it.)
2. What is the best way to loop through the date range and create a record for each day?
Regards
Russ
View 2 Replies
View Related
Mar 2, 2006
I have an OLE-DB Command transformation that inserts a row. If the insert SQL command fails for some reason, I use the "Redirect Row" option to send the row to another OLE-DB Command transformation that logs the error on that row to a "failed rows" table. In this table I log the ErrorCode and ErrorColumn values that come with the error path from the first OLE-DB Command.
OK, that's all working great. However, here's the kicker: there's no error description value. The ErrorCode value, naturally, is the decimal form of an HRESULT--for example, -1071607696. Without some further information, however, this code is not useful for troubleshooting.
Has anyone figured out a trick here? I'm not even certain that this is an SSIS HRESULT, since it could for all I know be from the OLE-DB layer, the database layer, or somewhere else.
Thanks,
Dan
View 7 Replies
View Related
Sep 19, 2007
Hi,
I have a table column type as nText, however there are some Chinese character stored in that field and it is a messed up as it is not readable.
In my vb.net code, I did Convert to unicode by getting the byte of each character and encode it with UTF8 e.g:
Public Shared Function ConvertToUnicode(ByVal s As String) As String
' Convert To Unicode
Dim MyBytes As Byte() = Encoding.Default.GetBytes(s)
Dim GBencoding As Encoding = System.Text.UTF8Encoding.UTF8
Return GBencoding.GetString(MyBytes)
End Function
This works well but ,the problem is that it slows down the process quite alot, and I wonder are there any text encoding method I can use in SQL that can run when i do the SELECT Statement?
SELECT
Convert(MyNTEXTColumn)
....
something like that?
Thanks.
Jon
View 4 Replies
View Related