Showing posts with label function. Show all posts
Showing posts with label function. Show all posts

Wednesday, March 21, 2012

Pattern extraction table value function

I need a table value function for extracting strings matching a particular pattern from a long string.

e.g. I have a table called cs_Posts, it has a column called FormattedBody, this value can be something like:

Code Snippet

this is the 1st photo <a href="http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPGhttp://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG">http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG</A< A>>" border="0" alt="" /></a>


this is the 2nd photo<a href="http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPGhttp://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG">http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG</A< A>>" border="0" alt="" /></a>

When this long string is input, the table value function should 2 rows:
http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG
http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG

Any idea?

This is just a sample,

Code Snippet

Create table Utility_Numbers (Number int);

Declare @.I as Int;

Set @.I = 1

While @.I<=8000

Begin

Insert Into Utility_Numbers Values(@.I);

Set @.I = @.I + 1;

End

Go

Code Snippet

Create Function GetUrls

(

@.html as varchar(8000)

) returns @.result Table(URL varchar(1000))

as

Begin

Set @.html = char(10) + @.html + char(10)

Declare @.Table Table (data varchar(1000))

Insert Into @.Table

Select Substring(@.html,number,charindex(char(10),@.html,number+1) - number) from Utility_Numbers where number<len(@.html)

and substring(@.html,number,1)=char(10)

Insert Into @.result

Select Substring(data,charindex('>http://',data)+1,charindex('</'< SPAN>,data,charindex('>http://',data)+1)-charindex('>http://',data)-1) from @.Table

return;

End

Go

Code Snippet

Select * from GetUrls('

this is the 1st photo http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG</A< A>>" border="0" alt="" />

this is the 2nd photohttp://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG</A< A>>" border="0" alt="" />

')

|||

Thanks Manivannan. But I got my answer now

Code Snippet

CREATE FUNCTION ExtractHTMLImgs
(
@.html nvarchar(max)
)
RETURNS
@.result TABLE
(
imgLink nvarchar(4000),
ordinal int
)
WITH SCHEMABINDING
AS
BEGIN
-- image link prefix & suffix
DECLARE @.imgPrefix char(10)
SET @.imgPrefix = '<img src="'
DECLARE @.imgSuffix char(2)
SET @.imgSuffix = '" '

-- image link ordinal
DECLARE @.ordinal int
SET @.ordinal = 1

-- searching positions
DECLARE @.imgStartPos int
SET @.imgStartPos = 1
DECLARE @.imgEndPos int
SET @.imgEndPos = 1

-- extract image links
WHILE @.imgEndPos < LEN(@.html)
BEGIN
-- search the image-link-prefix, starting from the last found image-end
SET @.imgStartPos = CHARINDEX(@.imgPrefix, @.html, @.imgEndPos)

IF @.imgStartPos = 0
BEGIN
-- NO more image link => STOP
BREAK
END
ELSE
BEGIN
-- image found => get the image-link-start-position
SET @.imgStartPos = @.imgStartPos + LEN(@.imgPrefix)

-- search the image-link-suffix, starting from the current image-start
SET @.imgEndPos = CHARINDEX(@.imgSuffix, @.html, @.imgStartPos)

-- populate results
INSERT @.result VALUES (
SUBSTRING(@.html, @.imgStartPos, (@.imgEndPos - @.imgStartPos)),
@.ordinal
)

-- next
SET @.ordinal = @.ordinal + 1
END
END

RETURN
END

Tuesday, March 20, 2012

PATINDEX fails to find (UK Pound Sterling symbol)

Hi all, Has anyone ever tried looking for a UK Pound sign using the PATINDEX function? It's fine for other characters but fails to find
The following code returns -1 because the function does not locate the pound symbol (it is in there!)
SELECT @.intPos = PATINDEX('%%', [my_text_field]) FROM my_table
Any suggestions?
Many thanks!I just tried a little test...

declare @.v1 varchar(10), @.v2 nvarchar(20)
select @.v1 = '100.00', @.v2 = '100.00'
select @.v1, @.v2
select PATINDEX('%%', @.v1),PATINDEX('%%', @.v2)

and got

---- -------
100.00 100.00

---- ----
1 1

do you have anymore details?|||Ah, yes your test certainly works! Your test spurred me to rey something out...Indeed I've found out why my code was not working...

It turned out that the data I was accessing contained a unc pound character amongst the text, this looked correct in my WinXP Notepad but manifested as two odd characters when viewed in sql server, that's why my search for a normal pond character was failing!

Thanks for you help!|||sometimes it's hard to see the forrest because of all the trees! Gald to help!

PATINDEX and CHARINDEX

Hello
I have a table in my database , in one field i have data like this
(230+365+651+695) varchar(100)
I want to use the any SQL function to return the data in form of rows from
the above field.
Result should look like
230
365
651
695
Anyone can help in this regard'?
Thanks in advance.Here's one way to do it using an auxiliary table of numbers:
SET NOCOUNT ON;
USE tempdb; -- specify your user db here
GO
IF OBJECT_ID('dbo.Arrays') IS NOT NULL
DROP TABLE dbo.Arrays;
GO
CREATE TABLE dbo.Arrays
(
arrid VARCHAR(5) NOT NULL PRIMARY KEY,
arr VARCHAR(1000) NOT NULL
);
INSERT INTO dbo.Arrays VALUES('A', '230+365+651+695');
INSERT INTO dbo.Arrays VALUES('B', '1+23+456');
GO
-- Code to create and populate the auxiliary table of numbers:
IF OBJECT_ID('dbo.Nums') IS NOT NULL
DROP TABLE dbo.Nums;
GO
CREATE TABLE dbo.Nums(n INT NOT NULL PRIMARY KEY);
DECLARE @.max AS INT, @.rc AS INT;
SET @.max = 8000; -- adjust @.max to your needs
SET @.rc = 1;
INSERT INTO dbo.Nums VALUES(1);
WHILE @.rc * 2 <= @.max
BEGIN
INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums;
SET @.rc = @.rc * 2;
END
INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums WHERE n + @.rc <= @.max;
GO
-- Query that splits arrays
SELECT A.arrid,
Nums.n - LEN(REPLACE(LEFT(A.arr, Nums.n), '+', '')) + 1 AS pos,
CAST(SUBSTRING(A.arr, Nums.n,
CHARINDEX('+', A.arr + '+', Nums.n) - Nums.n)
AS INT) AS element
FROM dbo.Arrays AS A
JOIN dbo.Nums
ON Nums.n <= LEN(A.arr) AND SUBSTRING('+' + A.arr, Nums.n, 1) = '+';
GO
Output:
arrid pos element
-- -- --
A 1 230
A 2 365
A 3 651
A 4 695
B 1 1
B 2 23
B 3 456
BG, SQL Server MVP
www.SolidQualityLearning.com
www.insidetsql.com
Anything written in this message represents my view, my own view, and
nothing but my view (WITH SCHEMABINDING), so help me my T-SQL code.
"mukki_neo" <u20644@.uwe> wrote in message news:5e741dc37de34@.uwe...
> Hello
> I have a table in my database , in one field i have data like this
> (230+365+651+695) varchar(100)
> I want to use the any SQL function to return the data in form of rows from
> the above field.
> Result should look like
> 230
> 365
> 651
> 695
> Anyone can help in this regard'?
> Thanks in advance.|||Thanks a lot for quick response.
It just work fine with my Database, but what if i have a value of
"Alphanumeric" in this field... like
(DO-903+DP-366+DP-659+TM-TEMP)
same for other rows corresponding columns
i want to show it like
DO-903
DP-366
DP-659
TM-TEMP
Any help please?
Itzik Ben-Gan wrote:
>Here's one way to do it using an auxiliary table of numbers:
>SET NOCOUNT ON;
>USE tempdb; -- specify your user db here
>GO
>IF OBJECT_ID('dbo.Arrays') IS NOT NULL
> DROP TABLE dbo.Arrays;
>GO
>CREATE TABLE dbo.Arrays
>(
> arrid VARCHAR(5) NOT NULL PRIMARY KEY,
> arr VARCHAR(1000) NOT NULL
> );
>INSERT INTO dbo.Arrays VALUES('A', '230+365+651+695');
>INSERT INTO dbo.Arrays VALUES('B', '1+23+456');
>GO
>-- Code to create and populate the auxiliary table of numbers:
>IF OBJECT_ID('dbo.Nums') IS NOT NULL
> DROP TABLE dbo.Nums;
>GO
>CREATE TABLE dbo.Nums(n INT NOT NULL PRIMARY KEY);
>DECLARE @.max AS INT, @.rc AS INT;
>SET @.max = 8000; -- adjust @.max to your needs
>SET @.rc = 1;
>INSERT INTO dbo.Nums VALUES(1);
>WHILE @.rc * 2 <= @.max
>BEGIN
> INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums;
> SET @.rc = @.rc * 2;
>END
>INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums WHERE n + @.rc <= @.max;
>GO
>-- Query that splits arrays
>SELECT A.arrid,
> Nums.n - LEN(REPLACE(LEFT(A.arr, Nums.n), '+', '')) + 1 AS pos,
> CAST(SUBSTRING(A.arr, Nums.n,
> CHARINDEX('+', A.arr + '+', Nums.n) - Nums.n)
> AS INT) AS element
>FROM dbo.Arrays AS A
> JOIN dbo.Nums
> ON Nums.n <= LEN(A.arr) AND SUBSTRING('+' + A.arr, Nums.n, 1) = '+';
>GO
>Output:
>arrid pos element
>-- -- --
>A 1 230
>A 2 365
>A 3 651
>A 4 695
>B 1 1
>B 2 23
>B 3 456
>
>[quoted text clipped - 12 lines]|||I changed the CAST from INT to VARCHAR, and it works fine, am i right?
Itzik Ben-Gan wrote:
>Here's one way to do it using an auxiliary table of numbers:
>SET NOCOUNT ON;
>USE tempdb; -- specify your user db here
>GO
>IF OBJECT_ID('dbo.Arrays') IS NOT NULL
> DROP TABLE dbo.Arrays;
>GO
>CREATE TABLE dbo.Arrays
>(
> arrid VARCHAR(5) NOT NULL PRIMARY KEY,
> arr VARCHAR(1000) NOT NULL
> );
>INSERT INTO dbo.Arrays VALUES('A', '230+365+651+695');
>INSERT INTO dbo.Arrays VALUES('B', '1+23+456');
>GO
>-- Code to create and populate the auxiliary table of numbers:
>IF OBJECT_ID('dbo.Nums') IS NOT NULL
> DROP TABLE dbo.Nums;
>GO
>CREATE TABLE dbo.Nums(n INT NOT NULL PRIMARY KEY);
>DECLARE @.max AS INT, @.rc AS INT;
>SET @.max = 8000; -- adjust @.max to your needs
>SET @.rc = 1;
>INSERT INTO dbo.Nums VALUES(1);
>WHILE @.rc * 2 <= @.max
>BEGIN
> INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums;
> SET @.rc = @.rc * 2;
>END
>INSERT INTO dbo.Nums SELECT n + @.rc FROM dbo.Nums WHERE n + @.rc <= @.max;
>GO
>-- Query that splits arrays
>SELECT A.arrid,
> Nums.n - LEN(REPLACE(LEFT(A.arr, Nums.n), '+', '')) + 1 AS pos,
> CAST(SUBSTRING(A.arr, Nums.n,
> CHARINDEX('+', A.arr + '+', Nums.n) - Nums.n)
> AS INT) AS element
>FROM dbo.Arrays AS A
> JOIN dbo.Nums
> ON Nums.n <= LEN(A.arr) AND SUBSTRING('+' + A.arr, Nums.n, 1) = '+';
>GO
>Output:
>arrid pos element
>-- -- --
>A 1 230
>A 2 365
>A 3 651
>A 4 695
>B 1 1
>B 2 23
>B 3 456
>
>[quoted text clipped - 12 lines]|||No need to cast it if you want to keep it a character string.
BG, SQL Server MVP
www.SolidQualityLearning.com
www.insidetsql.com
Anything written in this message represents my view, my own view, and
nothing but my view (WITH SCHEMABINDING), so help me my T-SQL code.
"mukki_neo" <u20644@.uwe> wrote in message news:5e757a18834f7@.uwe...
>I changed the CAST from INT to VARCHAR, and it works fine, am i right?
> Itzik Ben-Gan wrote:

Wednesday, March 7, 2012

password encryption

Hi all Im used to work on mysql and in that Db you can call the password function to encrypt password, so that people browsing directly the db can't see others password.

What is the best way to do this in sqlserver ?

You may use these two undocumented SQL Server functions.

PWDEncrypt and PWDCompare

How to use them?
http://msmvps.com/blogs/gladchenko/archive/2005/04/06/41083.aspx

Pwdencrypt() Weakness
http://www.sqlteam.com/article/pwdencrypt-weakness

Good luck.

|||

so as I see it. It seems easy to hack, So I will ask an other question to you. How do you procede to encrypt password? do you encrypt in code instead of in the db?|||

Frist thing you need to make Password column as VarBinary.

It will save in encrypted format. If you dont wanna use builtin function then make some function which will add some values and then subtract some values.

Hope this will help you.

DBMaster

My Blog

|||

You could use varbinary, you could also use binary, since the results will always be the same lengh.

Public Function MD5(s as string) as byte()

Dim encoder as New UTF8Encoding()
Dim md5Hasher as NewSystem.Security.Cryptography.MD5CryptoServiceProvider

return md5Hasher.ComputeHash(encoder.GetBytes(s))

end function


dim cmd as new SqlCommand("INSERT INTO Users(UserName,Password) VALUES (@.UserName,@.Password)",conn)

with cmd.parameters

.add("@.UserName",sqldbtype.varchar).value=txtUsername.text

.add("@.Password",sqldbtype.varBinary).value=md5(txtPassword.text)

end cmd

...

dim cmd as new SqlCommand("SELECT COUNT(*) FROM Users WHEREUserName=@.UserName ANDPassword=@.Password",conn)

with cmd.parameters

.add("@.UserName",sqldbtype.varchar).value=txtUsername.text

.add("@.Password",sqldbtype.varBinary).value=md5(txtPassword.text)

end cmd

if cmd.executescalar<>1 then

throw new applicationexception("Bad password")

endif

Saturday, February 25, 2012

passing tablename as parameter to function and to use it dynamically

Hi,

How do I run dynamic sql statements in side a UDF?
Is there any work around to retrieve data that way?

Example:
-- Table
create table dataTbl
(col1 varchar(5),col2 varchar(5),col3 varchar(5))

create table dataTbl2
(col1 varchar(5),col2 varchar(5),col3 varchar(5))

--Populate data
insert into dataTbl values ('x','y','z')
insert into dataTbl values ('a','1','2')
insert into dataTbl values ('e','3','4')
insert into dataTbl values ('h','6','7')

insert into dataTbl2 values ('x','m','n')
insert into dataTbl2 values ('a','k','l')
insert into dataTbl2 values ('e','u','o')
insert into dataTbl2 values ('h','t','y')

-- function

Create function testFun(@.colname varchar(10),@.tblName varchar(10))
returns varchar(10)
as
Begin
declare @.x varchar(10)
select @.x=col2 from dataTbl where col1='a'
return @.x
end

-- calling the function
select dbo.testFun('x','dataTbl')
select dbo.testFun('x','dataTbl2')

How can I achive this objective?

Quote:

Originally Posted by satish@.entech.us

Hi,

How do I run dynamic sql statements in side a UDF?
Is there any work around to retrieve data that way?

Example:
-- Table
create table dataTbl
(col1 varchar(5),col2 varchar(5),col3 varchar(5))

create table dataTbl2
(col1 varchar(5),col2 varchar(5),col3 varchar(5))

--Populate data
insert into dataTbl values ('x','y','z')
insert into dataTbl values ('a','1','2')
insert into dataTbl values ('e','3','4')
insert into dataTbl values ('h','6','7')

insert into dataTbl2 values ('x','m','n')
insert into dataTbl2 values ('a','k','l')
insert into dataTbl2 values ('e','u','o')
insert into dataTbl2 values ('h','t','y')

-- function

Create function testFun(@.colname varchar(10),@.tblName varchar(10))
returns varchar(10)
as
Begin
declare @.x varchar(10)
select @.x=col2 from dataTbl where col1='a'
return @.x
end

-- calling the function
select dbo.testFun('x','dataTbl')
select dbo.testFun('x','dataTbl2')

How can I achive this objective?


I don't think you can do this because DynamicSQL has it's own scope. Which means it won't return anything to the function. It will just run. So you can't do

SET @.Return = EXEC @.Command

As they are two different scopes.

What you could do is store the results of the output to a temp table and interrogate that when the function completes.

Cheers
C

passing table variables into functions

can T-SQL allow table variables to be passed into user defined functions for
processing? i'm trying to work a function with that but sql2k doesn't seems
to allow itNestor wrote:
> can T-SQL allow table variables to be passed into user defined functions f
or
> processing? i'm trying to work a function with that but sql2k doesn't seem
s
> to allow it
No. If you post a fuller description of what you want then maybe we can
help you with some alternatives.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||No you cannot. One option is to work with temporary tables across modules in
SQL Server.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Nestor" <n3570r@.yahoo.com> wrote in message
news:u71oBrIVGHA.1160@.TK2MSFTNGP09.phx.gbl...
> can T-SQL allow table variables to be passed into user defined functions
> for processing? i'm trying to work a function with that but sql2k doesn't
> seems to allow it
>

Monday, February 20, 2012

Passing Table data type as Param to a function

Hi,
How can i pass Table data type parameter to UDF ?You can't but there's probably another solution (using joins for example).
If you need more help, describe the problem with DDL, sample data and
required results.
David Portas
SQL Server MVP
--|||A few methods to pass table data into a user defined function or stored
procedure:
1 - Use persistant tables or views. You pass the selection criteria as
variables. Requires you to define your datasets you would want to pass
before hand.
2 - Use a temporary table. The table and column names must be predefined
and the table must be built before calling the function.
3 - Use a text or varchar variable with delimiters to pass a single column
worth of data. Limit of 8000 characters.
4 - Use dynamic SQL. Security, speed and integrity problems arise with
dynamic SQL.
A few questions to ask before deciding what approach to take:
- What is the maximum number of rows to pass?
- Is more then one column required?
- Does the data being passed require indexing?
- Who will be using the funtion and what rights do they have?
"DMP" <debdulal.mahapatra@.fi-tek.co.in> wrote in message
news:%230w4L2RZFHA.1368@.tk2msftngp13.phx.gbl...
> Hi,
> How can i pass Table data type parameter to UDF ?|||Just to add to that, you can also send an XML doc:
http://msdn.microsoft.com/library/d... />
ql01c5.asp
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"tygrus" <tygrus@.user.net> wrote in message
news:e9YAVLcZFHA.3712@.TK2MSFTNGP09.phx.gbl...
A few methods to pass table data into a user defined function or stored
procedure:
1 - Use persistant tables or views. You pass the selection criteria as
variables. Requires you to define your datasets you would want to pass
before hand.
2 - Use a temporary table. The table and column names must be predefined
and the table must be built before calling the function.
3 - Use a text or varchar variable with delimiters to pass a single column
worth of data. Limit of 8000 characters.
4 - Use dynamic SQL. Security, speed and integrity problems arise with
dynamic SQL.
A few questions to ask before deciding what approach to take:
- What is the maximum number of rows to pass?
- Is more then one column required?
- Does the data being passed require indexing?
- Who will be using the funtion and what rights do they have?
"DMP" <debdulal.mahapatra@.fi-tek.co.in> wrote in message
news:%230w4L2RZFHA.1368@.tk2msftngp13.phx.gbl...
> Hi,
> How can i pass Table data type parameter to UDF ?

Passing table Column name as parameter to a stored procedure

I want to run a Stored Procedure which takes Column name( table column names ) as input, use some aggregate function and return the desired output.

I have tried passing a single column name as input parameter and also the entire SQL statement as input parameter. but i am not able to capture and return the output value

I have also tried using Table data type but fail to capture the value. I dont want to use Temporary table.

The syntax i tried is some thing like this

Declare @.stmt nvarchar(100)
Declare @.AcctCode Char(8)
Declare @.rtVal numeric(18,5)

Set @.AcctCode = 'An_Sales'
Set @.stmt = 'Select AVG(' + @.ACCTCODE + ') From T_Comp_Profile'
Exec sp_executesql @.rtval = @.stmt

And also

Declare @.AcctCode Char(8)
Declare @.Ssql NVarchar(100)
Declare @.rtVal numeric (18,5)
Set @.AcctCode = 'An_Sales'

Set @.Ssql = 'Select ' +@.rtval + '=AVG(an_sales) into From T_Comp_Profile'
Exec SP_ExecuteSql @.Ssql
print @.rtval

Pls help me in this regard

Ramanbir Singhtry something like...

Declare @.mystmt nvarchar(100)
Declare @.AcctCode Char(8)
Declare @.rtVal numeric(18,5)

Set @.AcctCode = 'An_Sales'
Set @.mystmt = 'Select AVG(' + @.ACCTCODE + ') From T_Comp_Profile'
Exec sp_executesql @.stmt= @.mystmt|||Dear Rockslide

U have wriiten me with the following code

Declare @.mystmt nvarchar(100)
Declare @.AcctCode Char(8)
Declare @.rtVal numeric(18,5)

Set @.AcctCode = 'An_Sales'
Set @.mystmt = 'Select AVG(' + @.ACCTCODE + ') From T_Comp_Profile'
Exec sp_executesql @.stmt= @.mystmt

The stt "Exec sp_executesql @.mystmt" this returns a data set, so it is not going to be stored in a variable like u specified i.e
Exec sp_executesql @.stmt= @.mystmt

because when we print the value of @.stmt using "Print @.stmt" it returns nothing also we cant use a table data type here in place of @.stmt|||hi rjaj

I think I am a little confused.

sp_executesql takes (basically) 2 different parameters, see the syntax below.

sp_executesql [@.stmt =] stmt
[
{, [@.params =] N'@.parameter_name data_type [,...n]' }
{, [@.param1 =] 'value1' [,...n] }
]

When we say

exec sp_executesql @.stmt=@.mystmt

we are effectively saying

exec sp_executesql @.stmt = 'Select AVG(' + @.ACCTCODE + ') From T_Comp_Profile'

if we do nothing else with the returned results they will be outputed.

if you want the results to return to a parameter then you would need to do something like

select @.results = sp_executesql @.stmt = 'Select AVG(' + @.ACCTCODE + ') From T_Comp_Profile'

at a guess (the line above hasn't been tested, in theory I think it should work).|||Sounds familiar

http://www.dbforums.com/t970045.html|||create table #tbl ([output] int null)
insert #tbl Exec (@.stmt)|||Originally posted by ms_sql_dba
create table #tbl ([output] int null)
insert #tbl Exec (@.stmt)

Using temporary tables work
but i dont want to use a temporary table
Is there any other way for that

passing row to custom code

I wish to pass the current row to a custom function in reporting
services...does anyone have the syntax for this?
It would looking like: txtMybox.value = ParseInformation( current_row)
ThanksRoy.
Your value should be
=Code.ParseInformation(Fields!CurrentRow.Value)
Now, this is subject to what "current row" is refering to. If your
referencing just 1 field in the current row then the above is approriate;
however if you are trying to pass 2, or n number of fields, you need to
either
a) concatenate them together such as
Code.ParseInformation(FIelds!Field_1.Value+Fields!Field_2.Value+...Fields!Field_n.Value)
OR make in your custom code create a variable for each field to be passed,
and call the code like:
Code.ParseInformation(Fields!Field_1.Value,Fields!Field_2.Value,...,Fields!Field_n.Value)
Michael C
"roy@.mgk.com" wrote:
> I wish to pass the current row to a custom function in reporting
> services...does anyone have the syntax for this?
> It would looking like: txtMybox.value => ParseInformation( current_row)
>
> Thanks
>