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)
I have a conversion application which convertts an access database to an sql server(different versions). I'm using stored procedures. The thins is that I export the OLe Object form access to SQL varbinary. what I do is to convert the binary data from the OLE Object to string using ToBase64String. The thing is that when I execute the SQL statement I get the following error:
Error:Operand type clash: text is incompatible with varbinary.
Can anyone tell me what I do wrong and how can I fix this? Thanks.
hi everyone a question for all you wise men out there! ;-)
i run a db with thousands of reviews, interviews, article and so on. What's better: 1) leaving all the articles on .txt files and then using the file system object to show them in the page; 2) insert the articles in the db splitting them in several varchar fields 3) insert the articles in the db using the text/blob fields
Hi all, I have the following weird situation. I must update a "text" column in my mssql db with a string that is more than 10000 character long. I know that "text" is able to store up to 2Gbyte of data, but what is happening? that when i excecute the query (in PHP, using the odbc_exec function), my poor Apache got stuck!!! and afterwards, i am not even able to access that field (i mean Apache go nut again).
Have you ever experienced somthing like that? Any suggestion?
We have an interface where we receive data from an external supplier. One of the fields in the interface is of type BLOB (the source is an Oracle database), which would be read into our MSSQL database as image. This can also be converted to varbinary, and a typical field value looks something like:
0x70697A5F8F000000789C0DCCBD0DC2301....etc. etc.
However, we know that the origin only contains text, and we even know the text from the GUI they supply us with. The text could typically be "Delayed by 3 minutes because of water damage" or something like that.
What I want to do, is to extract that text from the field.
First, I have stored the incoming data stream in a table, where one column is of type varbinary(max). It looks like this goes swell. But I don't know which command to use in order to get the text extracted.
I have tried these:
1) select master.dbo.fn_varbintohexstr(Myfield) from Mytable -> Returns just the text "0x70697A5F8...." which I have no interest in
2) select cast(Myfield as varchar(max)) from Mytable -> Returns just Chinese signs.
3) select cast(Myfield as nvarchar(max)) from Mytable -> Returns just Chinese signs.
4) declare @ptrval varbinary(16) select @ptrval = TEXTPTR(MyField) from MyTable  -- with MyField defined as image READTEXT MyTable.MyField @ptrval 1 30 -> Returns just the text "0x697A5F8...." which I have no interest in
Of course, since only text is stored in this field, the field should never have been defined as BLOB in the first place. But the source system is external, and it's a standard system, so we may not alter it in any way.
i have a MSSQL 2000 database with about 30 tables in it. On one of those tables i've defined an full text index on an image field. In this table are around 500 records with binary files.
it functioned well for a time but now when i try to upload a file into the table this goes extremely slow (300 KB takes over 3 minutes).
i tried disabling "change tracking" but this didn't help a thing
adding blobs to other tables (without fulltext index on it) still goes fast.
what could be a reason that the uploading goes so slow??
We are debating what is industry “best practice� for serving huge numbers of images in an industrial scale website. More directly, which approach produces the best performance and the best scalability? For example, how do sites like ebay, Amazon, and other large sites handle the millions or billions of images they must deal with?
Store as BLOB in sql server?
Store in /images folder and store url text into sql server?
We always assumed that the second approach is what most sites must do. But do they?
One developer on our team maintains that storing one million or more image files in a directory will most certainly result in poor performance, because the server must scan the directory, searching for the correct file, each time a web request is made. The directory is not indexed (?) so performance must eventually suffer.
Other developer counters that storing millions of images as BLOBs into sql server will result in poor performance and HUGE database. An additional layer of access (webserver to sql server, back to webserver, then to client) causes a delay and performance hit. Who is right? What do the gurus as the world class sites do?
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 SQL Server 2000 table with a few fields of "text" data typethat contain rich text. I have to downstream this data and therecipient cannot handle rich text. I need to figure out a way toconvert it back to plain text. Any suggetions?TIA
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" .
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
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.
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
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'm still haven't resolved the issue with displaying information from a SQL database. The text I'm displaying is in ALL CAPS in the SQL database, and I'm trying to convert it so that when I display it in gridview, The First Letter Of Each Word Is Capitalized, as apposed to ALL CAPS. I've tried the text-transform feature of CSS, but I noticed in a SQL book there are LOWER() & UPPER() string functions. The ideal thing to do then, would be to do some select statement that converts all the incoming text to lowercase, then use the CSS text-transform: capitalize , to convert the first letter of each word to caps. Basically, I need a select statement or something that converts my sql material to lowercase. Thanks.
Hello, Can anyone tell me, how to convert an rtf string to text string using a function in SQL Server? I got a table in SQL Server database with field datatype text(16), which holds an rtf. I've to extract it as a text using a function. thank you,
Our sql server 2005 database is receiving data from a third part program over which we have no control. We need to be able to automatically convert data entered in one column of one table to UPPER case only.
I was trying to export a report which contains a number format. When I do that, all the numbers in excel will have a green small tag beside it saying "Convert from Number to Text".
Is there anyway that I can change the format to a number when I export it to excel?