I have a simple webform with a text box with multiline enabled and a submit button, in vb.net. Inside the text box, when you are typing text with let's say adding carriage returns, spaces etc. How to i save the text to a database? By that, i mean, how to i declare the column in my database, varchar, text ...?
Also, when retrieving the saved text back to the textbox, will it keep the formatting because that's what i am trying to do? Or, what is the best way to keep text formatting in a database?
how to declare multiple derived columns in SSIS Derived Column Task in one attempt.as i have around 150 columns coming from Flat file. I had created the required Expression in Excel and now i want add those in derived column task but its allowing only 1 expression at a time.
I was planning on running a service where thousands of text messages are stored. Obviously I'd want to make the most of my DB space, and was wondering if there's some way for SQL to compress text down to the smallest space possible. If not, is there some kind of ASP component I could download to do this? Failing that, I could always write a simple one, which takes the most common letter combinations, and shortens them down to a single character.
In SQL 2005, what is the best way to take a text file and store it in a table field, then later extract that file to a directory with original name and format intact?
I have this querey at the minute but when I attempt to put the default value of IND in the Sales Rep Code field I get an error Invalid column name, if I try and put 'IND' AS [Sales Rep Code] I get an incorrect syntax error.
DECLARE @Query nVarchar(1000) SET @Query = N'SELECT NULL AS [GEO UNIT], NULL AS [PMC Invoice Date], IND AS [Sales Rep Code] FROM '+ 'Test' + RIGHT(DATEPART(yy, GETDATE()), 2) + '_' + CASE WHEN DATEPART(m, GETDATE()) IN ('11', '12', '1') THEN 'Q1' ELSE CASE WHEN DATEPART(m, GETDATE()) IN ('2', '3', '4') THEN 'Q2' ELSE CASE WHEN DATEPART(m, GETDATE()) IN ('5', '6', '7') THEN 'Q3' ELSE CASE WHEN DATEPART(m, GETDATE()) IN ('8', '9', '10') THEN 'Q4' END END END END + '.dbo.all_data' EXECUTE sp_executesql @Query, N'@level tinyint', @level = 35
Just a quick question to ask what is the best field to store the data held in a rich text box/control. Just want to make sure that i get it right first time you know. Not sure about the amount of characters that needs held but its going to be quite a lot as this field shall contain most of my pages content.
Hi!I want to store some really big text in my database (for my articles). The approximate size will be from 500 to 40000 characters. I was thinking of using the database 'text' datatype.I have heard that reading these text fields is slower and decreases the performance. Moreover is it advisable to index this for searching purposes?
"[Flat File Destination [13]] Error: Data conversion failed. The data conversion for column "SDATA" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". " "[Flat File Destination [13]] Error: Cannot copy or convert flat file data for column "SDATA". " "[DTS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Flat File Destination" (13) failed with error code 0xC02020A0. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure. " "[DTS.Pipeline] Error: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC02020A0. There may be error messages posted before this with more information on why the thread has exited. " "[DataReader Source [207]] Error: The component "DataReader Source" (207) was unable to process the data. " "[DTS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "DataReader Source" (207) returned error code 0xC02090F5. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. " "[DTS.Pipeline] Error: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited. "
I am selecting data from an OBDC then copying it to a text file an I always get this error, but when I change the destination to a excel file it works perfectly. But the whole point of the package is to copy to a text file.
Please could you help me, your replies will be greatly appreciated.
This may be a stupid question but I can't find an easy answer for what Iwant to do. I need a blob data field that can store both binary and textdata like the sql_variant field. I am using vb.net to populate a sql table.I want to store both string and binary data.
As we all know, there is a 8060 bytes size limit on SQL Server rows. Ihave a table which requires a number of text fields (5 or 6). Each ofthese text fields should support a max of 4000 characters. We currentlystore the data in varchar columns, which worked fine untill ourappetite for text fields increased to the current requirement of 5, 6fields of 4000 characters size. I am given to review a design, whichesentially suggests moving the text columns to a separate TextFieldstable. The TextFields table will have two columns - a unique referenceand a VARCHAR (4000) column, thus allowing us to crossreference withthe original record. My first impresion is that I'd rather use the SQLServer 'text' DB type instead, which would allow me the samefunctionality with much less effort and possibly better performance.Can anyone advise on advantages and disadvantages of the two optionsand what the best practice in this case would be.Any advise will be well appreciated.Tzanko
hi in my front end i have one text area where user can input his sql statements. for samller data its working. the data type of coulmn is Text in sql server 2005. but problem is when i try to store this data its showing error.i meant not storing data at all. if i cut some of line from this then in this case it stores the data .what should i do to overcome this problem
thanx a lot.
DECLARE @sTemp VARCHAR(10) DECLARE @nMemberID INT DECLARE @nPartnerID INT DECLARE @nDocumentTypeNo INT DECLARE @nDocumentFormat INT DECLARE @sEmailAddress VARCHAR(200) SET @sTemp = '{*MEMBERID*}' IF UPPER(@sTemp) = 'NULL' SET @nMemberID = NULL ELSE SET @nMemberID = CAST(@sTemp AS INT) SET @sTemp = '{*PARTNERID*}' IF UPPER(@sTemp) = 'NULL' SET @nPartnerID = NULL ELSE SET @nPartnerID = CAST(@sTemp AS INT) SET @sTemp = '{*DOCUMENTTYPENO*}' IF UPPER(@sTemp) = 'NULL' SET @nDocumentTypeNo = NULL ELSE SET @nDocumentTypeNo = CAST(@sTemp AS INT) SET @sTemp = '{*DOCUMENTFORMAT*}' IF UPPER(@sTemp) = 'NULL' SET @nDocumentFormat = NULL ELSE SET @nDocumentFormat = CAST(@sTemp AS INT) SET @sEmailAddress = '{*EMAILADDRESS*}' IF EXISTS(SELECT * FROM ProtocolSettings WHERE ((@nMemberID IS NULL AND MemberID IS NULL) OR MemberID = @nMemberID) AND ((@nPartnerID IS NULL AND PartnerID IS NULL) OR PartnerID = @nPartnerID) AND ((@nDocumentTypeNo IS NULL AND DocumentTypeNo IS NULL) OR DocumentTypeNo = @nDocumentTypeNo) AND ((@nDocumentFormat IS NULL AND DocumentFormatNo IS NULL) OR DocumentFormatNo = @nDocumentFormat) AND ProtocolSettingNo = 307) BEGIN UPDATE ProtocolSettings SET SettingValue = @sEmailAddress WHERE ((@nMemberID IS NULL AND MemberID IS NULL) OR MemberID = @nMemberID) AND ((@nPartnerID IS NULL AND PartnerID IS NULL) OR PartnerID = @nPartnerID) AND ((@nDocumentTypeNo IS NULL AND DocumentTypeNo IS NULL) OR DocumentTypeNo = @nDocumentTypeNo) AND ((@nDocumentFormat IS NULL AND DocumentFormatNo IS NULL) OR DocumentFormatNo = @nDocumentFormat) AND ProtocolSettingNo = 307 END ELSE BEGIN INSERT INTO ProtocolSettings (ProtocolSettingNo, MemberID, PartnerID, DocumentTypeNo, DocumentFormatNo, SettingValue) VALUES(307, @nMemberID, @nPartnerID, @nDocumentTypeNo, @nDocumentFormat, @sEmailAddress) END
I was wondering does anybody have advice for storing Russian in a column in either 2000 or 2005. Example:
create table Russian ( Word varchar(100), Meaning varchar(500), Russian varchar(500) COLLATE Cyrillic_General_CI_AS_KS not null, English varchar(1000) )
insert into Russian ( Word, Meaning, Russian, English ) values ( 'Thank You', 'Thank you', 'Ñ?паÑ?бо', 'spice e ba' ) What I get is Thank You Thank you ?????? spice E bo How can I store 'Ñ?паÑ?бо' and get this value to display, and not ??????
Hi, I have a table called geofence. It has a primary key geofence_id. Each geofence consists of a set of latitudes and latitudes. So I defined two columns latitude and longitude and their type is varchar. I want to store all latitude/longitude values as a comma separated values in latitude/longitude columns So in general how do people implement these types of requirements in relational databases?
I have a file with a header row which contains the date of the file and under that all the columns without a header.
In SSIS package I skip row and manually name the different columns.
However, I want to use the column in the header row to store the date value in an SSIS variable and use that variable to write it to our staging table. How can I do this when I skip the header row?
Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?
Hi everyone,I encountered an error "Need to run the object to perform this operationCode execution exception: EXCEPTION_ACCESS_VIOLATION" When I try to import data from Oracle to MS SQL Server with EnterpriseManager (version 8.0) using DTS Import/Export Wizard. There are 508 rowsin Oracle table and I did get first 42 rows imported to SQL Server.Anyone knows what does the above error message mean and what causes therest of the row failed importing?Thanks very much in advance!Rene Z.--Posted via http://dbforums.com
Hi, I am mapping the .csv files to a destination table in sql server. The names of each column in the .csv file is the same as the ones in the destination table. In the destination table there is an extra field i.e. FileTypeField
Here is the question; When transfering the data from .csv to the destination table i.e flat file source to oledb destination, I would like to place a text into the field FileTypeField I do not see an option to do this. Can you help please? Thanks
HiI have to create an XML file based on a SQL SERVER 2005 table.Everything works fine:SELECT 1 as Tag, NULL as Parent, Ex_Id as [Exam!1!Ex_Id], NULL as [Ex_Title!2!!cdata] FROM Exams WHERE ex_State = 'P' UNION ALL SELECT 2 as Tag, 1 as Parent, Ex_Id, ex_Title FROM Exams WHERE ex_State = 'P' order by [Exam!1!Ex_Id], [Ex_Title!2!!cdata] FOR XML EXPLICIT, ROOT('Exams') BUT when i add another column, a text column, I get into trouble: SELECT 1 as Tag, NULL as Parent, Ex_Id as [Exam!1!Ex_Id], NULL as [Ex_Title!2!!cdata], NULL as [Ex_Situation!3!!cdata] FROM Exams WHERE ex_State = 'P' UNION ALL SELECT 2 as Tag, 1 as Parent, Ex_Id, ex_Title, ex_Situation FROM Exams WHERE ex_State = 'P' order by [Exam!1!Ex_Id], [Ex_Title!2!!cdata], [Ex_Situation!3!!cdata] FOR XML EXPLICIT, ROOT('Exams') The problem is clearly the fact that i have to sort on the text column, plus the fact that this column requires the CDATA tag enclosurePlease help me....i'm desperate :(
Hi I had a text type not null column which i wanted to change to a null column.Writing a simple alter statement gave me an eror cannot change text type column so i tried to rename the original column create a new column with the same name and allowing nulls on it and then copying the contents of the renamed column to the new column and finally deleting the renamed column. EXEC sp_rename 'TableName.ColumnName', 'ColumnName_old', 'COLUMN'ALTER TABLE TableName ADD ColumnName text NULLUPDATE TableName SET ColumnName = ColumnName_oldALTER TABLE TableName DROP COLUMN ColumnName_old However when i tried to execute these statements in query analyser on the Update statement it gave me the error that ColumnName_old does not exist. However then I tried to execute these queries one by one I was able to do that. Can anybody tell me whats causing the queries to not be executed all at once without giving the ColumnName_old does not exist error cause I wanted to run them on live dbs.
how can i update a column with datatype of text with a combination of columns having a datatype of float? do i convert the float columns to varchar/char/?? and/or can i convert the column i am updating?
What would the syntax be to insert a column to the right of this one, and extract the first 8 digits from the data in the DATEID column and insert that into the new column DATE, therefore making it easier for me to query against an actual date?
Hi all i want to remove text from my column name using query. for example i have the product name like "silver 8' trampoline pack " i need to remove "silver 8' " and want to display only trampoline pack similarly if I have product name like "gold 8' trampoline pack" i need to display only trampoline pack. can anybody help me in this regard?