In a query Analyser, there is a provision to change the "Maximum characters per column 256 " to our size in advanced option.
It works ok.
We are using VisualInterdev for developing ASP's -- there
thro ADO - we are getting the rows from sql server 7.0 -- there data more than
256 characters are truncated.
How will i get the actual data ?.. where i can do the settings..?
I am having DTS problem exporting from a table to a text file (my 600 character table column is truncated to 255 characters in the output text file). I don't why this is happining nor how to get the DTS not truncate to 255 characters. Is this a bug? A limitation? How do I get around this problem? .......I am running SQL Server 7 SP1 and database is in 6.5 compatability mode.
Hi;I am trying to write a rountine ( below ) that will go into a colum oftext data type ( fae.pmcommnt ) locate the word "to" and replace it.I have the routine below. I get no error messages, but it also seemsto do nothing :).Any clues would be greatly appreciated.ThanksSteve================================================== =============declare @ptrP intSELECT @ptrP = PATINDEX('%to%', pmcommnt)from fae where projid ='00013'declare @ptrPC binary(16)select @ptrPC = TEXTPTR(pmcommnt)from faeif( TEXTVALID ('fae.pmcommnt', @ptrPC ) > 0 )print 'works'print @ptrPUPDATETEXT fae.pmcommnt @ptrPC @ptrP 2 'JJ'select projid, pmcommnt from fae
I receive the error " [OLE DB Destination [1907]] Warning: Truncation may occur due to inserting data from data flow column "GENDER" with a length of 255 to database column "GENDER" with a length of 2. " on the source flow.
I have done some googling and came up with this post: http://torontosql.dotnetnuke-portal.com/Default.aspx?tabid=32233 which I thought may help, but it does not.
The query against the access datasource features the column: iif([sex]=1, 'm', 'f'). I tried using left(..., 2) as well, but SSIS is determind to treat the field as 255 characters for some reason.
I don't even particualrly care that the field is 255 chars and the sources is only two, I just want the data in! I have other fields coming up with similar error.
Can someone please advise?
PS, what is th significance of the "External Columns" Vs "Output Columns" on the Input and Output Properties tab in Advanced Editor?
I am really struggling with SSIS, it is not as intuitive as DTS.
Hi guys, In the query below, I need to insert a new Column that shows the last Document date. In example, Document Date Last Date 2006/01/15 2007/11/30 2007/03/25 2007/11/30 2007/11/30 2007/11/30 I need to show the last (max) date for each row. Thanks in advance for any help, Aldo.
Code Block SELECT Stock.VALUEDATE AS 'Document Date'
FROM Stock As Stock INNER JOIN ACCOUNTS AS Accounts LEFT OUTER JOIN ACCSORTNAMES AS AccSortNames ON Accounts.SORTGROUP = AccSortNames.ACCSORTCODE LEFT OUTER JOIN EXTRANOTES AS ExtraNotes01 ON Accounts.ACCOUNTKEY = ExtraNotes01.KEF AND ExtraNotes01.NOTEID IN ('17') LEFT OUTER JOIN EXTRANOTES AS ExtraNotes02 ON Accounts.ACCOUNTKEY = ExtraNotes02.KEF AND ExtraNotes02.NOTEID IN ('18') ON Stock.ACCOUNTKEY = Accounts.ACCOUNTKEY INNER JOIN DOCUMENTSDEF AS DocumentsDef ON Stock.DOCUMENTID = DocumentsDef.DOCUMENTID
WHERE Accounts.SORTGROUP Between '0' AND '379' AND Accounts.SORTGROUP Not Between '100' AND '150' AND Stock.DOCUMENTID In ('1', '4', '5', '11', '78', '95') AND Stock.STATUS Not In ('0', '2') AND Accounts.SORTGROUP Between '0' AND '379' AND Accounts.ACCOUNTKEY Like '313%'
Is there a way to alter the default 256 value to some other value in a transac SQL script? The value can be changed manually in the advanced tab of the current connection options. I need to be able to set and reset this value in a script and/or stored procedure. Kind of urgent for an answer to this problem. Thanks in advance.
i have a table with productID and OrderID. For ech product there are orders. So for each productID there are lot Of OrderID's are present. My data like
On table TABLENAME, I have increased the size of column C to decimal(38, 14); maximum size and an excessive amount of precision. If I do a SELECT MAX(CONVERT(DECIMAL(7,2), A) / B) FROM TABLENAME SELECT MIN(CONVERT(DECIMAL(7,2), A) / B) FROM TABLENAME I get 3.0000000000000 for the MAX and 0.1000000000000 for the MIN value, yet if I update UPDATE TABLENAME SET C = CONVERT(DECIMAL(7,2), A) / B WHERE B <> 0 Msg 8115, Level 16, State 8, Line 1 Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated. Obviously I have obscured the column names and table name, but I am puzzled as to why values in the range 0.1 to 3.0 should give an overflow error. I am using SQL2005 SP2
I have some code I build 2 weeks ago which I’ve been running daily but it’s suddenly stopped working with the following error.
“The table "tbl_Intraday_Tmp" has been created, but its maximum row size exceeds the allowed maximum of 8060 bytes. INSERT or UPDATE to this table will fail if the resulting row exceeds the size limit” When I google this there seems to be a related to tables with vast numbers of columns.
My table tbl_Intraday_tmp is relatively small. It has 7 columns. 1 of varchar(5), 3 of decimal(9,3) and 2 of decimal(18,0). The bit I’m puzzled with is it was working and stopped.
I don’t recall changing anything but I wouldn’t rule that out. I ‘ve inspected the source files and I don’t believe they have changed either.
HiAm Using ASP.NET With SQL SERVER 2005 Backend AGENT CODE 3008000003
NAME agent code dropdownlist values like 1005000006,2009000002,3008000003select dropdownlist value it display corresponding values related to that codewhen i select first 2 values its run properly,But when i select 3008000003 i will get following error messagein SQL SERVER 2005 Agent Code Date Type is "bigint"" The conversion of the nvarchar value '3008000003' overflowed an int column. Maximum integer value exceeded. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: The conversion of the nvarchar value '3008000003' overflowed an int column. Maximum integer value exceeded.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: Please Help me to solve this issueThanks With RegardsS.Senthil Nathan
is there any more efficient way for example to implement the next query?
SELECT s1.article, dealer, s1.price FROM shop s1 JOIN ( SELECT article, MAX(price) AS price FROM shop GROUP BY article) AS s2 ON s1.article = s2.article AND s1.price = s2.price; WHERE dealer = 'dealer sample'
SQL Server 2000 8.00.760 (SP3)I've been working on a test system and the following UDF worked fine.It runs in the "current" database, and references another database onthe same server called 127-SuperQuote.CREATE FUNCTION fnGetFormattedAddress(@WorkID int)RETURNS varchar(130)ASBEGINDECLARE@Address1 As varchar(50)@ReturnAddress As varchar(130)SELECT@Address1 = [127-SuperQuote].dbo.tblCompany.Address1FROM[Work] INNER JOIN[127-SuperQuote].dbo.tblCompany ON [Work].ClientID =[127-SuperQuote].dbo.tblCompany.CompanyIDWHERE[Work].WorkID = @WorkIDIF @Address1 IS NOT NULLSET @ReturnAddress = @ReturnAddress + @Address1 + CHAR(13)+ CHAR(10)RETURN @ReturnAddressENDSo now the system has gone live and it turns out that the live"SuperQuote" database is on a different server.I've linked the server and changed the function as below, but I get anerror both in QA and when checking Syntax in the UDF builder:The number name 'Zen.SuperQuote.dbo.tblCompany' contains more than themaximum number of prefixes. The maximum is 3.CREATE FUNCTION fnGetFormattedAddress(@WorkID int)RETURNS varchar(130)ASBEGINDECLARE@Address1 As varchar(50)@ReturnAddress As varchar(130)SELECT@Address1 = Zen.SuperQuote.dbo.tblCompany.Address1FROM[Work] INNER JOINZen.SuperQuote.dbo.tblCompany ON [Work].ClientID =Zen.SuperQuote.dbo.tblCompany.CompanyIDWHERE[Work].WorkID = @WorkIDIF @Address1 IS NOT NULLSET @ReturnAddress = @ReturnAddress + @Address1 + CHAR(13)+ CHAR(10)RETURN @ReturnAddressENDHow can I get round this? By the way, I've rather simplified thefunction to ease readability. Also, I haven't posted any DDL because Idon't think that's the problem!ThanksEdward
I have a field name call firstname and other field middleinit, now the table contains data. and i want to extract data, the firstname field sometimes contains the middle initial, for for example JOHH D. now I would like to set the firstname field with JOHN only and and set the middleinit field like D only thanks
With this procedure,can't show if GiftTitle contains space ,nonalphabetic chars(&,-,..) and if start with numnber. How can i modify ?? Plz help me. Thanks.
CREATE PROCEDURE dbo.trymatrix AS DECLARE @SQLCommand varchar(4096), @column sysname
SET @SQLCommand = 'select c.CustomerID as Cust_ID,Name as Co_Name, ' + char(13)
DECLARE curGift CURSOR STATIC LOCAL FOR
select distinct GiftTitle from Redemption1
OPEN curGift
WHILE 1 = 1
BEGIN
FETCH curGift INTO @column
IF @@FETCH_STATUS <> 0
BREAK
SET @SQLCommand = @SQLCommand +
'sum(case GiftTitle when ''' +@column +''' then 1 else null end) as '+ @column + ','+char(13)
END
DEALLOCATE curGift
SET @SQLCommand = left (@SQLcommand, len(@SQLcommand)-2) + char(13)
I have an overloaded method in my data access layer that I use to load the parameters into a command object. One of these overloaded methods is as follows: public void LoadSqlParameter(string name, string value, ParameterDirection direction){ param = new SqlParameter(); param.ParameterName = name; param.Value = value; param.Direction = direction; param.SqlDbType = SqlDbType.VarChar; cmd.Parameters.Add(param);} Will using a SqlDbType of VarChar cause me any problems if the actual parameter in the stored procedure is a Char? Am I better off leaving out the line that specifies the type? Thanks
Hi, I have a problem with a text string which is more than 8000 chars. I am taking this string as an input from an application.so,I cannot define a local variable as text or ntext and varchar has limitation of only 8000 char. Can anyone help me in dealing with this situation. Also,I cannot break the string at application level.I wish if I could solve it at db level somehow? TIA pd
How do you insert more than 255 characters into a text field? or am I using READTEXT and DATALENGTH incorrectly?
I am trying to concatenate two 255 varchar strings. Both do have 255 characters of data. I want to insert the concatenated strings into a field define as a text data type. if I try to ' insert into tempTbl(textFieldDataType) values (@text1+@text2) it appears only the @text1 is inserted. I have been told the data is really there, but I can only read the 256 position + with READTEXT.
DECLARE @textptr varbinary(16) select @textptr = (select TEXTPTR(textFieldDataType) from tempTbl where pktempTbl = 33) READTEXT tempTbl.textFieldDataType @textPtr 255 10
This should have read 10 text positions after the 255th position. However, I get msg Msg 7124, Level 16, State 1 The offset and length specified in the READTEXT command is greater than the actual data length of 255.
If I use the datalength function, it appears to confirm that @text2 was never inserted
declare @length int select @length = (select datalength(textFieldDataTypet) from tempTbl where pktempTbl = 33) select @length
I am trying to get the domain name of the server running this instance of SQL server 2000 using xp_loginconfig but have been getting some very strange results. The code example below shows the problem quite nicely. Basically the output shows white space of some sort before the "/HelloWorld" in the second select.
Any ideas why? and how to get rid of it. I've tried using RTRIM() but that made no difference.
On some server instances I dont even see the "/HelloWorld" perhaps it's put in a new line char or something like that.
select ConfigName+'/HelloWorld' from #tmp where ConfigName = 'default domain' select ConfigValue+'/HelloWorld' from #tmp where ConfigName = 'default domain'
Hi all,I have a variable called Description which is set from a database field - How do i set another variable to grab the first 200 chars from this var? hope this makes sense
I have a column of varchar(2000) but when I use it in a select statement I only get the first 255 characters displayed. (all the data is there as I can see different parts using substring) How do I get the complete column to display?
CREATE TABLE saved_query ( id INT NOT NULL IDENTITY(1,1) PRIMARY KEY, name VARCHAR(32) NOT NULL, query_text VARCHAR(2048) NOT NULL )
CREATE TABLE saved_query ( id INT NOT NULL IDENTITY(1,1) PRIMARY KEY, name VARCHAR(32) NOT NULL, query_text VARCHAR(2048) NOT NULL)
and whenever I insert or update the query_text field, it's always truncated to 255 characters. Why? I clearly specified a larger field size. I also tried defining query_text as a "TEXT" but got the same result.
I am using SQL Server Compact Edition and I get an exception when running a query with a LIKE-operator which parameter is a string with length greater than 256 characters.
Has anybody had this problem? Any ideas on how to fix this?