Transact SQL :: Invalid Length Parameter Passed To Left Or Substring

Dec 1, 2015

is it possible to identify which value is causing me the above  error message and how to resolve it,These are for British postcodes.

create table #tmp (postcode varchar(200) NULL)
insert into #tmp values ('NULL')
insert into #tmp values ('-')
insert into #tmp values ('.')
insert into #tmp values ('0L6 7TP')
insert into #tmp values ('AB10 1WP')
insert into #tmp values ('AB51 5HH')

[code]...

This is the main query

select postcode,LEFT([Postcode], CHARINDEX(' ',[Postcode]) - 1)
from #tmp
order by Postcode
drop table #tmp

View 4 Replies


ADVERTISEMENT

Transact SQL :: Invalid Length Parameter Passed To LEFT Or SUB-STRING Function

Jul 22, 2015

when I am trying to perform below query,
 
  INSERT INTO EMPLOYEE
    SELECT TOP 100 *
 FROM EMPLOYEE_LANDING;

I am getting Invalid length parameter passed to the LEFT or SUBSTRING function.

View 3 Replies View Related

Invalid Length Parameter Passed To The Substring F

Aug 13, 2007

Hi there when i tried to execute the following query in sql server

select au_fname,
SUBSTRING(P1.au_lname, CHARINDEX('/', P1.au_lname) + 1,
CHARINDEX('=', P1.au_lname, 1)-3)AS [Full Name]
from authors as P1

i will get the error like
"Invalid length parameter passed to the substring function."

If i remove -3 from there it works fine...
Please can anyone clarify this issue.

Thank You.

pavan

View 3 Replies View Related

Invalid Length Parameter Passed To Substring Function

Mar 3, 2014

I have a sql job which will execute the below stored proc.

Basically it Refresh the data by truncating the tables and using BCP to import the data. Job was running fine but today got a error message.

Invalid length parameter passed to the substring function. [SQLSTATE 42000] (Error 536). The step failed.

USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Procedure [dbo].[Refresh_tables]

[Code] ......

View 2 Replies View Related

Invalid Length Parameter Passed To The SUBSTRING Function.

Feb 1, 2008

Hi,

I was trying to execute the following query.

select substring(ISNULL(CAST(FullAdress AS NVARCHAR(MAX)),''),1,charindex(',',ISNULL(CAST(FullAdress AS NVARCHAR(MAX)),''))-1) from tbl_lrf_company_details_with_codes


but i am getting the error as "Invalid length parameter passed to the SUBSTRING function."
Please advice
Thanks In advance

View 4 Replies View Related

Invalid Length Parameter Passed To The SUBSTRING Function

May 27, 2008



SELECT

C.Description,

SUBSTRING (

(CONVERT (VARCHAR (255), D.CurrentXmlValue)), --expression

(CHARINDEX ('>', CONVERT (VARCHAR (255), D.CurrentXmlValue)) + 1), --start

( (LEN (CONVERT (VARCHAR (255), D.CurrentXmlValue))) -

(CHARINDEX ('>', CONVERT (VARCHAR (255), D.CurrentXmlValue))*2) - 1

)--length

) AS Version

FROM

:
:
WHERE
:
:
This does not work while

:
:

--SUBSTRING (

(CONVERT (VARCHAR (255), D.CurrentXmlValue)) as expression, --expression

(CHARINDEX ('>', CONVERT (VARCHAR (255), D.CurrentXmlValue)) + 1) as start, --start

( (LEN (CONVERT (VARCHAR (255), D.CurrentXmlValue))) -

(CHARINDEX ('>', CONVERT (VARCHAR (255), D.CurrentXmlValue))*2) - 1

) as length --length

--) AS Version

:
:

works!!
I get

Msg 536, Level 16, State 5, Line 2

Invalid length parameter passed to the SUBSTRING function.
Error.
Any idea why i am getting this??
I am trying to get rid of xml tags in the column.

Thanks,

View 4 Replies View Related

Error: Invalid Length Parameter Passed To The SUBSTRING Function.

Sep 28, 2007

Hi,

I am using a simple procedure to pivot results (found in another forum and adapted it). It is done on SQL Server 2005 server with all service packs. Procedure:
**************
ALTER Procedure [dbo].[EthnicityPivot] @StDate as Datetime, @EndDate as Datetime
as
begin
DECLARE @Teams varchar(2000)

truncate table ForEthnicPivot

INSERT INTO ForEthnicPivot
SELECT DISTINCT COUNT(ID), Team, Ethnicity
FROM dbo._EthnicityByTeamEpisode
where Startdate between @StDate and @EndDate
GROUP BY Ethnicity, Team

SET @Teams = ''
--// Get a list of the pivot columns that are important to you.

SELECT @Teams = @Teams + '[' + Team + '],'
FROM (SELECT Distinct Team FROM ForEthnicPivot) Team
--// Remove the trailing comma

SET @Teams = LEFT(@Teams, LEN(@Teams)-1)
--// Now execute the Select with the PIVOT and dynamically add the list
--// of dates for the columns
EXEC( 'SELECT * FROM ForEthnicPivot PIVOT (SUM(countID) FOR Team IN (' + @Teams + ')) AS X' )
end
************

I can call the function:
exec EthnicityPivot '01/01/2007','09/09/2007'

and it works fine in SQL analyzer, but when I want to use it in Visual Studio in a new report I am getting this error
message:

There is an error in the query. Invalid length parameter passed to the SUBSTRING function. Incorrect syntax near ')'.

Anyone had similar error and sorted it?

Cheers

Polda

View 4 Replies View Related

Sql 2005 ... Invalid Length Parameter Passed To The SUBSTRING Function.

Oct 9, 2006

Hi,
I am new at sql 2000 and 2005, I have created a package in 2005 which I am trying to execute on a daily bases by creating a job. At first because of security issues the job would not execute. Hence, I had to create a credential and a proxy to run the job with sa account. Now it is giving me this error,
€œSQLServer Error: 536, Invalid length parameter passed to the SUBSTRING function. €œ
Through research I have no clue as what I need to do, or where to look.
The package runs without error when I execute the package itself.
Any help is greatly appreciated.
Thanks,
Lori

View 1 Replies View Related

Error In Query; Invalid Length Parameter Passed To The Substring Function

Nov 28, 2005

Hi
i got errro mess "Invalid length parameter passed to the substring function" from this below. Anyone how can give me a hint what cause this, and how i can solve it? if i remove whats whitin thoose [] it works, i dont use [] in the code :)
colums:
VLF_InfectionDestination is nvarchar 254

SELECT TOP 10 tb_AVVirusLog.VLF_VirusName, COUNT(tb_AVVirusLog.VLF_VirusName) AS number
FROM tb_AVVirusLog INNER JOIN
__CustomerMachines002 ON tb_AVVirusLog.CLF_ComputerName = __CustomerMachines002.FalseName
WHERE (CONVERT(varchar, tb_AVVirusLog.CLF_LogGenerationTime, 120) BETWEEN @fyear + @fmonth + @fday AND @tyear + @tmonth + @tday) AND
(__CustomerMachines002.folder_id = @folderId) [OR
(CONVERT(varchar, tb_AVVirusLog.CLF_LogGenerationTime, 120) BETWEEN @fyear + @fmonth + @fday AND @tyear + @tmonth + @tday) AND
(tb_AVVirusLog.VLF_InfectionDestination LIKE N'%@%')]
GROUP BY tb_AVVirusLog.VLF_VirusName
HAVING (NOT (tb_AVVirusLog.VLF_VirusName LIKE N'cookie'))
ORDER BY COUNT(tb_AVVirusLog.VLF_VirusName) DESC

View 7 Replies View Related

Odd Error Upon SqlDataReader.Read() Invalid Length Parameter Passed To The Substring Function.

Nov 12, 2003

An application I developed normally works great, but it seems that when processing a certian record (and none of the others so far), SQL Server throws this error:
"Invalid length parameter passed to the substring function."

Here's the code in question:

orderConnection.Open()
orderReader = orderCommand.ExecuteReader()
setControls(orderReader)

...

Private Sub setControls(ByVal dr As SqlDataReader)
If (dr.Read()) Then '<--*******problem line*******

The SqlDataReader (orderReader) doesn't blow up or anything until I call .Read() (and, as mentioned, this problem only occurs for one order). What could be happening here?

View 3 Replies View Related

Invalied Length Parameter Passed The Substring Function

Nov 12, 2004

Does anyone know what the above error message means?

View 4 Replies View Related

INVALID LENGTH PARAMETER PASSED....

Jun 4, 2007

I have the follwoing stored procedure:ALTER procedure [dbo].[up_GetExecutionContext](@ExecutionGUID int = null) asbeginset nocount ondeclare@s varchar(500)declare @i intset @s = ''select @s = @s + EventType + ','-- Dynamically build the list ofeventsfrom(select distinct top 100 percent [event] as EventTypefrom dbo.PackageStepwhere (@ExecutionGUID is null or PackageStep.packagerunid =@ExecutionGUID)order by 1) as xset @i = len(@s)select case @iwhen 500 then left(@s, @i - 3) + '...'-- If string is too long thenterminate with '...'else left(@s, @i - 1) -- else just remove the final commaend as 'Context'set nocount offend --procedureGOWhen I run this and pass in a value of NULL, things work fine. When Ipass in an actual value (i.e. 15198), I get the following message:Invalid length parameter passed to the SUBSTRING function.There is no SUBSTRING being used anywhere in the query and thedatatypes look okay to me.Any suggestions would be greatly appreciated.Thanks!!

View 2 Replies View Related

Using Of Substring With Dynamic Values For Length Parameter

Feb 12, 2003

Hi everybody,

I want to use substring with dynamic
values for length parameter
but result is different compare to
static parameter.

declare
@x smallint,
@y smallint,
@string varchar(250)


set @x = 0
set @string = '17898880219800alex3.5'

select @y = charindex('',@string,@x)
-- result varchar(5)
select substring(@string,@x,5)

select @y
-- result varchar(250) !!!!!!

select substring(@string,@x,@y)

Any Idea why ?

View 3 Replies View Related

Invalid Length Parameter ....

Jun 13, 2003

I have a ##temp table which collects command (varchar(120)) info from sysjobsteps table as follows:
command
------------------------------
BACKUP DATABASE FDMS_11111_2 To Backup_11111_2_4Thu with init, name = 'Backup of Job_11111_2_4Thu'

Now, I need to extract the database name from the command string: It did return the correct database name but ended with error message.

select substring(command, 17, charindex(' To Backup_',Command)-17) from ##tempServerNameDatabaseNameJobHistory

Command
-------
FDMS_11111_2
FDMS_9999_2
(2 row(s) affected)

Server: Msg 536, Level 16, State 3, Line 1 Invalid length parameter passed to the substring function.

-D

View 2 Replies View Related

Transact SQL :: Quotes Around Retrieved Date To Be Passed As Parameter To Stored Procedure

May 4, 2015

I'm trying to replace a view with stored procedure for faster performance. the View is called by end user using a query as below, I need to pass the date as parameter for sp to execute with quotes for it to execute with correct results.  I tried to pass the date as parameter but could not execute stored procedure with correct results. Is there any way to put quotes around returned date from sub query : 

Execute statement is like
Exec dbo.storedProc1  select max(date) from table

I need to pass the above as  :

Exec dbo.storedProc '2015-03-24'  .

Somehow passing the date as parameter is giving me empty result set.

View 2 Replies View Related

Substring With Zero Length?

Sep 19, 2007

I'm using a substring expression in a Derived Column transformation to create a new column (string data) out of a segment of another. The length of the new column data is calculated at run time based on the contents of other columns, and under some circumstances may be zero.

Is this kocher, or will it lead to 'unpredictable' results? Coz unexpected results is what I'm getting, not in the row concerned, but in the rows following......

View 1 Replies View Related

Substring From The Left?!?

May 21, 2008

Hi,
we are using Moss 2007 and in one of our lists we add a hyperlink.
when we display this field into a report it is showed as: hyperlinkurl, name

for example: http://www.site.com,testsite

What we want to is that the piece after the , is displayed as a value and the string before the , is used as hyperlink.

Now we have tested a few things like:



=Trim(Right(Fields!Variant_Locatie.Value, Len(Fields!Variant_Locatie.Value) - InStr(Fields!Variant_Locatie.Value, ", ")))

and this give's us the string part AFTER the , so that part is correct!

but I can't find out how to do the same thing but then for using everything BEFORE the ,


...

anyone got an idea? just changing Right with Left give's us (for example): http://thisisa
instead of http://thisisatest.com (he's counting the number of characters from the right to the , and then displays the characters starting from the left but only the number of characters he counted previously) ...

urgent plz!

View 3 Replies View Related

What Is The Max Length Of Substring Function.

Mar 16, 2001

hi thanks for your help

update vendor_invoice
set de_ftpdownload= (select SUBSTRING(de_ftpdownload,1,CHARINDEX('.',de_ftpdow nload,0)-1)as de_ftpdownload from vendor_invoice)
where vendor_invoice_id =931

This get me this error.... so what is the max allowable length of substring function.

Server: Msg 536, Level 16, State 3, Line 1
Invalid length parameter passed to the substring function.
The statement has been terminated.
Thanks
Al

View 1 Replies View Related

Left-justifying Substring-Easy, Ya'd Think

Jun 9, 2007

Having a whale of a time, having tried almost every approach, except obviously the right one.

I have employee_no which is character size 10. It is right-justified for some reason. I'm using SUBSTRING to peel off the last five digits (it's going to a flat file where only 5 chars are allowed).

Now I just need to Left Justify the return string. What should I add
to this statement

substring(employees.employee_no,6,8)

My return is this:

A97 1Joe
A97 3Bruce
A97 4Scott

Many thanks in advance, you guys are amazing.
lisa

View 5 Replies View Related

T-SQL (SS2K8) :: Procedure Parameter Length Declaration Less Than Column Length?

Jun 30, 2014

is there any way or a tool to identify if in procedure the Parameter length was declarated less than table Column length ..

I have a table

CREATE TABLE TEST001 (KeyName Varchar(100) ) a procedure
CREATE PROCEDURE SpFindNames ( @KeyName VARCHAR(40) )
AS
BEGIN
SELECT KeyName FROM TEST001
WHERE KeyName = @KeyName
END
KeyName = @KeyName

Here table Column with 100 char length "KeyName" was compared with SP parameter "@KeyName" with length 40 char ..

IS there any way to find out all such usage on the ALL Procedures in the Database ?

View 2 Replies View Related

Performance Issue Using Left Or Substring Function

Oct 18, 2007

Hi,

I've tried the following query in SQL SERVER 2005, SQL Express and MACCESS.

select * from Table1 where drid in (SELECT DrID FROM Table2 WHERE (substring(PostalCode,1,3) IN ('B0E','B1P','B2H','B2Y','B3A','B3M','B4A','B4H','E1A','E1C','E1N','G0A', …)) and (substring(Telephone,1,3) IN ('204','250','306','403','416','418','450','506','514','519','604','613','705','780','807','819','902','905')))

The query is using two table. The first one Table1 is a table with user info. The second table Table2 has the info concerning a survey.

The Table1 containt approx. 6000 row and Table2 containt only 210 rows

The table structure from the different environment(MACCESS, SQL SERVER 2005, Sql Server Express 2005) are the same. The Table1 containt the field "PostalCode" and "Telephone".

When I execute this query on MACCESS and in SQL Server 2005 the result are approximately the same(Less than half second). But there a performance issue in Sql Express 2005. The query take an execution time between 7 and 9 secondes.

When I add a condition using a field from tblResponsePQ2Part1 ex: QA=1
like in the following query :
select * from Table1 where drid in (SELECT DrID FROM Table2
WHERE (QA = 1 substring(PostalCode,1,3) IN ('B0E','B1P','B2H','B2Y','B3A','B3M','B4A','B4H','E1A','E1C','E1N','G0A', …)) and (substring(Telephone,1,3) IN ('204','250','306','403','416','418','450','506','514','519','604','613','705','780','807','819','902','905')))
the query take an execution time of ~15 secondes!!!!

This issue only happen in Sql Server Express, on the others cases(mean MSAccess, Sql Server) the execution time is less than half second.

It’s weird because, Sql Express 2005 is supposed to be more performant
than MACCESS, and have the same performance than Sql Server Professional Edition. Please Help Me!!!!


Anyone have an idea why?



Mathieu Desbiens

View 1 Replies View Related

How To Select A Word Substring In A Coumn Header From Right To Left

Oct 10, 2007

I have an application providing me with multiple headers which I havemergerd into one big header (below), this header my not always be thesame but I need to be able to extract a periodstart and periodend fromit. The periodstart will always be the third substring from the end(or 3rd from right) and the periodend will always be the firstsubstring from the end (or 1st from the right).How can I extract the periodstart and periodend?E.g:- Header'Jensen Alpha TR UKN GBP BM: Caut Mgd BM (50% FTAllSh 50% ML £ BroadMkt) RF DEF:RFI 3Y 31/08/2004 To 31/08/2007'I currently have the sql: convert(Datetime,(dbo.FDHGetWord(@FullHeader, 20)) ,103) but this only works in thisinstance, I need to use someting like the RIGHT function or REVERSEfunction but I can't get the sql right.Can someone please help!????

View 1 Replies View Related

RS 2005: Stored Procedure With Parameter It Runs In The Data Tab But The Report Parameter Is Not Passed To It

Feb 19, 2007

Hello,
since a couple of days I'm fighting with RS 2005 and the Stored Procedure.

I have to display the result of a parameterized query and I created a SP that based in the parameter does something:

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE PROCEDURE [schema].[spCreateReportTest]
@Name nvarchar(20)= ''

AS
BEGIN

declare @slqSelectQuery nvarchar(MAX);

SET NOCOUNT ON
set @slqSelectQuery = N'SELECT field1,field2,field3 from table'
if (@Name <> '')
begin
set @slqSelectQuery = @slqSelectQuery + ' where field2=''' + @Name + ''''
end
EXEC sp_executesql @slqSelectQuery
end

Inside my business Intelligence Project I created:
-the shared data source with the connection String
- a data set :
CommandType = Stored Procedure
Query String = schema.spCreateReportTest
When I run the Query by mean of the "!" icon, the parameter is Prompted and based on the value I provide the proper result set is displayed.

Now I move to "Layout" and my undertanding is that I have to create a report Paramater which values is passed to the SP's parameter...
So inside"Layout" tab, I added the parameter: Name
allow blank value is checked and is non-queried

the problem is that when I move to Preview -> I set the value into the parameter field automatically created but when I click on "View Report" nothing has been generated!!

What is wrong? What I forgot??

Thankx for any help!
Marina B.





View 3 Replies View Related

Transact SQL :: Left Pad With 0 And Extract 2 Characters On The Left?

Oct 28, 2015

I have a table PLACE with a character column CODE

[Code] [nchar](4) NULL

I need to left pad the column with 0 if it is less than 4 characters long and extract the first 2 characters on the left into a new column COUNTY_CODE.

How can I do that in transact SQL?

I tried:
     
SELECT  RIGHT(RTRIM('0000'+ISNULL([Code],'')),4)     
   FROM [Place]
   WHERE [Place Code]='B' and [Code]='627'

And I got 0627. And how do I extract the first 2 characters?

View 10 Replies View Related

Left Or Length Command

Apr 28, 2006

I have a field that contains data such as 'ACB00/02'. How would I write into a function that gathers a load of data together for me a peice of code that will grab only the first 2 chars of the afore mentioned value, So the result would be in the new created colum in a temp table 'AC'.

This is to occur over 7,000 records but they are not all AC, I just want the first two from every line.

Regards

View 4 Replies View Related

SQL2K/Log Reader Fails With Error 9003 The LSN Passed To Log Scan Is Invalid

Aug 8, 2007

Hi All,
We have transactional replication between two SQL Server 2000, SP4 and database is in simple recovery.
Occassionally Logreader agent fails with error 9003 (The LSN (164051:119090:22) passed to log scan in database 'ReportDB' is
invalid).
But in April 2007 this error has occurred multiple times. We have opened the case with PSS in April 2007 but till now there
is no concrete solution.

Error details in ErrorLog:
2007-04-24 16:49:09.79 spid59 Error: 9003, Severity: 20, State: 1
2007-04-24 16:49:09.79 spid59 The LSN (164051:119090:22) passed to log scan in database 'ReportDB' is invalid..
Error details in Log reader agent:
Repl Agent Status: 3
Publisher: {call sp_repldone ( 0x000280d30001d1320016, 0x000280d30001d1320016, 0, 0)}
Publisher: {call sp_replcmds (100, 0)}
Status: 0, code: 0, text: 'The process could not execute 'sp_replcmds' on 'BR14D135R17'.'.
The process could not execute 'sp_replcmds' on 'BR14D135R17'.
Repl Agent Status: 6
Status: 0, code: 9003, text: 'The LSN (164051:119090:22) passed to log scan in database 'ReportDB' is invalid.'.

From above error details it can be seen that sp_repldone is already called for LSN 164051:119090:22 (0x000280d30001d1320016)
which means it is distributed.
Since LSN is distributed, transaction log of publisher for that LSN can be truncated by checkpoint process. And afterward if
logreader issues sp_replcmds for that LSN, we will get 9003 error.
So, question is why Logreader is looking for LSN if that is already distributed.
When checked "DBCC Opentran", it also reflect oldest distributed LSN as 164051:119090:22.

We tried changing the recovery model to FULL but that has only delayed the occurrence.
Once we have noticed that LSN mentioned in Error 9003 was already backed up one day before. And we don't think replication latency to be more than 3 hrs
(maximum).

After PSS recommendation, we have applied the hotfix 2187 but error has occurred again after one month.
Other recommendation is to disable read cache of hardware controller to avoid stale read(that we are working on). Current
setting is 100% read and 0% Write.

Other Details:
SQL Server 2000 Enterprise Edition SP4 with Hotfix 2187
Window 2000 Advanced Server.
RAID 5 with array controller as HP Smart Array 641 Controller

Please let me know if you have faced such issue and have any idea on this problem.

Thanks,
Ramesh

View 3 Replies View Related

SUBSTRING In User Defined Function - Invalid Column

May 23, 2007

I'm trying to create a function that splits up a column by spaces, andI thought creating a function that finds the spaces with CHARINDEX andthen SUBSTRING on those values would an approach. I get an errorsaying that the I have an Invalid column 'Course_Number'. Not surewhy but I am very new to User Defined Functions. Here is what I haveso far:CREATE FUNCTION CourseEvalBreakdown(@fskey int)RETURNS @CourseTable TABLE(Col CHAR(2),Area CHAR(4),Number CHAR(4),Section CHAR(4),Term CHAR(3))ASBEGINDECLARE@Ind1 tinyint,@Ind2 tinyint,@Rows intDECLARE @crstbl TABLE (FStaffKey int,Course_Number char(20),Term char(3),Col char(2),Area char(4),Number char(4),Section char(3))INSERT INTO @crstbl (FStaffKey, Course_Number, Term)SELECT FStaffKey, Course_Number, TermFROM EvalWHERE FStaffKey = @fskeySET @Rows = @@rowcountWHILE @Rows 0BEGINSET @Ind1 = CHARINDEX(' ', Course_Number, 4)SET @Ind2 = CHARINDEX(' ',Course_Number, (CHARINDEX(' ',Course_Number, 4)+1))UPDATE @crstblSET Col = SUBSTRING(Course_Number, 1, 2)WHERE FStaffKey = @fskeyUPDATE @crstblSET Area = UPPER(SUBSTRING(Course_Number, 4, @Ind1-4))WHERE FStaffKey = @fskeyUPDATE @crstblSET Number = UPPER(SUBSTRING(Course_Number, @Ind1+1, (@Ind2-@Ind1)-1))WHERE FStaffKey = @fskeyUPDATE @crstblSET Section = SUBSTRING(Course_Number, @Ind2+1, 3)WHERE FStaffKey = @fskeyENDINSERT @CourseTableSELECT Col, Area, Number, Section, Term FROM @crstblRETURNENDGO

View 7 Replies View Related

SQLDescribeParam With Subselect: Invalid Parameter Number/Invalid Descriptor Index

Apr 21, 2008

Hello,

I've got the following query:

SELECT zA."ID" AS fA_A
, zA."TEXT" AS fA_B
, (
SELECT COUNT(zC."ID")
FROM Test."Booking" AS zC
) AS fA_E
FROM Test."Stack" AS zA
WHERE zA."ID" = ?

With this query I call:
- SQLPrepare -> SQL_SUCCESS=0
- SQLNumParams -> SQL_SUCCESS=0, pcpar = 1
- SQLDescribeParam( 1 ) -> SQL_ERROR=-1, [Microsoft][ODBC SQL Server Driver]Invalid parameter number", "[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index"

Is there a problem with this calling sequence or this query? Or is this a problem of SQL Server?

Regards
Markus

View 7 Replies View Related

Make Use Of An Passed XML Parameter

Nov 19, 2007

I have tested the following code, and it works for me:

DECLARE @XML XML
SET @XML = '
<DocumentElement>
<data>
<item code="ABCDEFG" quantity="1" sort="0" />
<item code="XCFVGBF" quantity="1" sort="0" />
<item code="ABCDEFG" quantity="10" sort="0" />
</data>
</DocumentElement>'

SELECT SUM(x.qty * ISNULL(p.price_mn,0))
FROM (SELECT [Code] = A.A.value('@code','varchar(20)'),
[Qty] = A.A.value('@quantity','INT')
FROM @xml.nodes('/DocumentElement/data/item') AS A(A)) X
LEFT JOIN productprice_t P ON p.code_id = x.code


The question is, how can I do this if the XML is in a different format & doesn't use any attributes?
So it looks like this (which I'm getting from an ADO.Net datatable using .WriteXML):
<DocumentElement>
<data>
<code>ABCDEFG</mercurycode>
<quantity>1</quantity>
<sort>0</sort>
</data>
<data>
<mercurycode>XCDFEG</mercurycode>
<quantity>2</quantity>
<sort>0</sort>
</data>
<data>
<code>ABCDEFG</mercurycode>
<quantity>10</quantity>
<sort>0</sort>
</data>
</DocumentElement>

View 5 Replies View Related

Parameter Value Not Being Passed For My SProc

Mar 19, 2007

I am quite new to SSRS and am having some difficulties in trying to develop a new report via Business Intelligence Studio based on a stored procedure which requires the input of 1 parameter, and also has an optional parameter which I default to NULL in the sproc.

When I create my dataset I select the given sproc I want and when I attempt to execute it, I am prompted for the parameters the sproc expects.

However, when I enter a value in the dialog for the required Parameter I get a SQL error indicating that the parameter the sproc expects was not supplied. I have profiled the call and see the attempt to execute the sproc, but no parameter value.

Can some one tell me why the value I enter is not being passed to the sproc in my database ? Is there some special syntax that I need to use ?

I have scanned a number of sites & through the books I have and can't find anything on this. From what I have read, when I exec my sproc the parameters get recongnized & I can just enter my values. This doesn't seem to be the case.

Any help and/or suggestions are appreciated !!!
Thanks.

View 8 Replies View Related

Getting The Parameter Value Passed From Url String

Nov 30, 2007

I have a requirement where, I need to get the value of parameter from a query string of url and use it in my report.
Ex:- http://www.mysite.com?name=bobby

From the above url, I have to take the value of name and be able to use it in my report query or assign to a parameter.

Please let me know, how can I acheive this.

View 1 Replies View Related

Can A Passed Parameter Be A Check Box?

Jan 28, 2008

I have a boolean parameter on my report that the user will enter. Currently, it shows as an option button with True/False beside each option as the words used. Is it possible to have a check box instead of an option button for the user instead?
Thanks in advance!

View 3 Replies View Related

DTS RunTime Error &#34;received Invalid Column Length From BCP Client&#34;

Jul 26, 2002

when i tried to run a DTS which transfer bulk data between 2 SQL servers, i got following error message:
================================================== ============
Error: -2147467259 (80004005); Provider Error: 4815 (12CF)
Error string: Received invalid column length from bcp client.
Error source: Microsoft OLE DB Provider for SQL Server
Help file:
Help context: 0
================================================== ===========

if anybody has encounter the same problem before? after testing, i think it's
must related with network traffic problem. but i can not figure out how to solve it.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved