Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Monday, March 26, 2012

How can I print a multi-value parameter

I have a multi-value parameter and I need to print its value in report.
But if I put in a text box =Parameters!Mine.Label when rendering I obtain #Error
How can I do it?
Thanks in advanceUse the .NET Framework function Join(). You can specify the delimiter as well.

Friday, March 23, 2012

how can i pass values from .mdb to crystal report?

how can i pass values from a text box to crystal report.the value is not stored in the database.please help me...Pass it as a parameter.

Create a parameter field in the report.

Then pass the value for the parameter from ur interface to report in the folg. way

Cr1.ParameterFields.GetItemByName("EnterOption").AddCurrentValue(ParamOption)

Here EnterOption is the name of the parameter created in Crystal Reports and ParamOption contains some value which u want to pass (any value)

Hope this may help|||Thanks ,
But its not working.I got an error message like this "Argument not optional". Pls explain the reason and do help me with sample code
Thanks
Hari|||Hope you are using VB code for creating interface
--------

'In the General Declarations , declare

Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report

'Assinging the report name
Set Report = Appl.OpenReport("report1.rpt")
Report.DiscardSavedData
'Passing the value of cmboption.Text value to the first parameter
'instead of passing by the name of the parameter, we can also use this convention
Report.ParameterFields(1).AddCurrentValue cmbOption.Text

'Assigning the report source to CRViewer Control and viewing the report
CRViewer1.ReportSource = Report
CRViewer1.ViewReport

--------

If your code produces error, send the code fragment|||There are 3 ways to deal with this/your problem or setting/passing arguments to a report :

Sample 1
---
g_ole_crx_report.DiscardSavedData()
g_ole_crx_report.ParameterFields.item[1].AddCurrentValue("100200300")

Sample 2
---
g_ole_crx_report.DiscardSavedData()
g_ole_crx_report.ParameterFields[1].AddCurrentValue("100200300")

Sample 3
---
g_ole_crx_report.DiscardSavedData()
g_ole_crx_report.ParameterFields.GetItemByName("@.AccountNumber").AddCurrentValue("100200300")

Sample 4
---
g_ole_crx_report.DiscardSavedData()
g_ole_crx_report.ParameterFields.item[3].AddCurrentValue(date("01/01/1999"))

Look at this sample. It needs conversion. You need to use convert function like date (I dont' know about VB) to convert date to date format.

Maybe this is what causing your problem.

Thanks

How can I parse text held in MS SQL 2005 text field

Hi,
I been reading various web pages trying to figure out how I can extract some simple information from the XML below, but at present I cannot understand it.

I have a MS SQL 2005 database with which contains a field of type text (external database so field type cannot be changed to XML)
The text field in the database is similar to the one below but I have simplified it by remove many of the unneeded tags in the <before> and <after> blocks. I also reformatted it to show the structure (original had no spaces or returns)

For each text field in the SQL table contain the XML I need to know the OldVal and the NewVal.


<ProductMergeAudit>
<before>
<table name="table1" description="Test Desc">
<product id="OldVal">
</table>
</before>
<after>
<table name="table1" description="Test Desc">
<product id="NewVal">
</table>
</after>
</ProductMergeAudit>

Cast your TEXT to an XML datatype field and use:

SET

@.XML=CONVERT(XML,'<ProductMergeAudit>
<before>
<table name="table1" description="Test Desc">
<product id="OldVal"/>
</table>
</before>
<after>
<table name="table1" description="Test Desc">
<product id="NewVal"/>
</table>
</after>
</ProductMergeAudit>')
SELECT @.XML.value('(/ProductMergeAudit/before/table/product/@.id)[1]','varchar(50)'), @.XML.value('(/ProductMergeAudit/after/table/product/@.id)[1]','varchar(50)')

gives

OldVal NewVal

N.B. The line<product id="NewVal"/> had to have a / added at the end to make it valid XML.

|||

Thanks,
That work when selecting the value from a single row into a XML variable.

How can I open an OS text file inside one Stored Procedure

HI,
I have one Operating System text file in some directory in UNIX environment . How can I open this file inside one Stored Procedure.
Thanks in advance.
DillipHello,

to open flat files in the OS use the package SYS.UTL_FILE. You can use the functions/procedures fopen, get_line and fclose to access the datas in the ff.

You get direct access to the file you must enter the path of the file in your initial parameter. Otherwise Oracle can not read or write the file.

The parameter is UTL_FILE_DIR.

Here is a short example:

declare
fptr utl_file.file_type;
buff varchar2(2048);
line_no number(10):=0;
loc_no integer;
begin
fptr:=utl_file.fopen('C:\Oracle\admin\PENT\udump', 'ORA00324.TRC','R');
utl_file.get_line(fptr,buff);
utl_file.fclose(fptr);
exception
when no_data_found then
utl_file.fclose(fptr);
dbms_output.put_line('Number of lines parsed ='||line_no);
when utl_file.invalid_path then
dbms_output.put_line('invalid path');
raise_application_error(-20100,'file error');
when utl_file.invalid_mode then
dbms_output.put_line('invalid_mode');
raise_application_error(-20100,'file error');
when utl_file.invalid_filehandle then
dbms_output.put_line('invalid_filehandle');
raise_application_error(-20100,'file error');
when utl_file.invalid_operation then
dbms_output.put_line('invalid_operation');
raise_application_error(-20100,'file error');
when utl_file.read_error then
dbms_output.put_line('read_error');
raise_application_error(-20100,'file error');
when utl_file.write_error then
dbms_output.put_line('write_error');
raise_application_error(-20100,'file error');
when utl_file.internal_error then
dbms_output.put_line('internal_error');
raise_application_error(-20100,'file error');
when others then
dbms_output.put_line('un-handled');
raise_application_error(-20100,'file error');
end;

Hope that helps ?

Regards
Manfred Peter
(Alligator Company)
http://www.alligatorsql.com

Wednesday, March 21, 2012

how can i monitor full text queries?

i've got a sharepoint database configured by a sys admin.
how can i use profiler to see if there are any full text queries
happening?
just look for the "contains" clause or something else?
I take it you mean Sharepoint Team Services, that requires you to monitor
Microsoft Search, for SPS monitor Search, Queries and Query rate.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?
|||monitor the object Microsoft Search and the counters queries and query rate.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?
|||i need to see the actual queries and whether or not they're returning
anything and not just the counters available in perfmon.
Hilary Cotter wrote:[vbcol=seagreen]
> monitor the object Microsoft Search and the counters queries and query rate.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "ch" <ch@.dontemailme.com> wrote in message
> news:43CE51F7.9F6C5653@.dontemailme.com...
|||you need to use profiler for this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE6B6E.8BC997C5@.dontemailme.com...[vbcol=seagreen]
>i need to see the actual queries and whether or not they're returning
> anything and not just the counters available in perfmon.
>
> Hilary Cotter wrote:
sql

how can i monitor full text queries?

i've got a sharepoint database configured by a sys admin.
how can i use profiler to see if there are any full text queries
happening?
just look for the "contains" clause or something else?I take it you mean Sharepoint Team Services, that requires you to monitor
Microsoft Search, for SPS monitor Search, Queries and Query rate.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?|||monitor the object Microsoft Search and the counters queries and query rate.
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?|||i need to see the actual queries and whether or not they're returning
anything and not just the counters available in perfmon.
Hilary Cotter wrote:[vbcol=seagreen]
> monitor the object Microsoft Search and the counters queries and query rat
e.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "ch" <ch@.dontemailme.com> wrote in message
> news:43CE51F7.9F6C5653@.dontemailme.com...|||you need to use profiler for this.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE6B6E.8BC997C5@.dontemailme.com...[vbcol=seagreen]
>i need to see the actual queries and whether or not they're returning
> anything and not just the counters available in perfmon.
>
> Hilary Cotter wrote:

how can i monitor full text queries?

i've got a sharepoint database configured by a sys admin.
how can i use profiler to see if there are any full text queries
happening?
just look for the "contains" clause or something else?I take it you mean Sharepoint Team Services, that requires you to monitor
Microsoft Search, for SPS monitor Search, Queries and Query rate.
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?|||monitor the object Microsoft Search and the counters queries and query rate.
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE51F7.9F6C5653@.dontemailme.com...
> i've got a sharepoint database configured by a sys admin.
> how can i use profiler to see if there are any full text queries
> happening?
> just look for the "contains" clause or something else?|||i need to see the actual queries and whether or not they're returning
anything and not just the counters available in perfmon.
Hilary Cotter wrote:
> monitor the object Microsoft Search and the counters queries and query rate.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "ch" <ch@.dontemailme.com> wrote in message
> news:43CE51F7.9F6C5653@.dontemailme.com...
> > i've got a sharepoint database configured by a sys admin.
> > how can i use profiler to see if there are any full text queries
> > happening?
> > just look for the "contains" clause or something else?|||you need to use profiler for this.
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"ch" <ch@.dontemailme.com> wrote in message
news:43CE6B6E.8BC997C5@.dontemailme.com...
>i need to see the actual queries and whether or not they're returning
> anything and not just the counters available in perfmon.
>
> Hilary Cotter wrote:
>> monitor the object Microsoft Search and the counters queries and query
>> rate.
>> --
>> Hilary Cotter
>> Looking for a SQL Server replication book?
>> http://www.nwsu.com/0974973602.html
>> Looking for a FAQ on Indexing Services/SQL FTS
>> http://www.indexserverfaq.com
>> "ch" <ch@.dontemailme.com> wrote in message
>> news:43CE51F7.9F6C5653@.dontemailme.com...
>> > i've got a sharepoint database configured by a sys admin.
>> > how can i use profiler to see if there are any full text queries
>> > happening?
>> > just look for the "contains" clause or something else?

Monday, March 19, 2012

How can I make a script out of a table data ?

Hello,

I want to take a table (SQL server) and show all it's data in a form of INSERT... (text file)
so that I can show it on a web-page and just paste the INSERT text into aMyTableData.sql
and then I can just run this script on the Query analyzer and fill my table with data

I need it so I can backup my DATA both in English and other languages...
(a replacement for the DTS packages that gives me hard time with the LOCALE / UNICODE translation)

did anyone already made such program ?
where can I find something like this ?My initial thought is "Don't do it!"!

You are planning on having a textbox that the user will have complete control over, and then you are taking the contents of that textbox and turning it into a SQL script that will be run?

This is extremely insecure and could result in all sorts of malicious script being executed against your database. Even in a trusted intranet environment, I would not write such functionality.

My 2 cents.

Terri|||Here's an app that will do it in its Export feature: http://www.microsoft.com/downloads/details.aspx?FamilyId=F0D03472-5E6C-459E-A6D8-6745A729C3C9&displaylang=en

Terri, your concern is valid, but I'd assume (or at least hope) that the page on the site for doing this would be completely secure.|||

My advice is to use the following softwarehttp://www.denovations.com/products/sqlpopulator/ It's looks handy...

Friday, March 9, 2012

how can I include Full Text Search service in my program setup silently?

heloo..

if I want to use full text search in my program, can I include Full Text Search service in my program setup silently in the same way as including SQL Express and .Net Framework to the setup project, Or I have to Install MS Sql Server 2005 on my customer computer?

Full text search is included with the SQL Server Express Advanced edition (but not SQL Server Express). You can add "ADDLOCAL=SQL_FullText " to your addlocal parameter during silent install or use "ADDLOCAL=All" to get everything.

Here's a link showing what Express and Express Advanced include:

http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx

Thanks,
Sam Lester (MSFT)

Wednesday, March 7, 2012

How Can I Ignore Accsents and diacritical marks in WHERE statement?

How Can I Ignore Accsents and diacritical marks in WHERE statement?

i use sql statment for searching and i wont to search in text filds where some accent and diacritical marks have been enterd.

like: i want to search for 'e' or 'o' ... letters in this text: "ü??"
if i used: "Select * from table where fild like 'e' " the result will be 0 items.

Also, same proplem in Arabic accents for eg: if i want to search for '???' in this text '?????' , using select where statement. what can i do?

Here is a small example. You may need to read more about collation to completely solve this problem, but this should point you in the right direction. Notice that in the first example, no collation is specified so you get an empty result. In the second example, you specify an Accent Insensitive collation so the data is returned.

Declare @.Temp nVarChar(20)
Set @.Temp = N'ü??'

Select @.Temp As [No Collation Specified]
Where @.Temp Like '%e%'

Select @.Temp As [Collation Specified]
Where @.Temp collate SQL_Latin1_General_CP1_CI_AI Like '%e%'

|||

Thank you..

This statement works properly with French and German,
but it does'nt works with ARABIC or FARSI.

There is no option for Arabic accent insensetive in SQL Collations.
What Can I do now?

I have tried [BRACKETS] after "LIKE" to make the accents
optional, it works but when there is no accent it does'nt.
eg.:"WHERE myfld LIKE '%?[????]???%'". the result was as follows:
?????
?????
but ???? without accents doesn't appear.
Thanks..

Monday, February 27, 2012

How can I get the keyword list indexed by SQL Server 2005

Full Text search must keep a list of key words or items somewhere.

How can I get access to this list to present to a user.

For example: show me all indexed words starting with letter a* and then ac*.

I'm trying to find this information without success.

Full Text uses only predicates so what you are asking are actually noise word and you can find the noise words for supported languages in the location below in your C drive. Hope this helps.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData

|||

As far as I know there is no way built in way to get the list from fulltext service as the data is stored natively by FTS.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Friday, February 24, 2012

How can I get c# text and use as parameter?

I want to grab what is in textbox1, put in string, and send as a query
to bring up report with only textbox1 occurances in table. How do I do
that please?
Thanks,
Trint"trint" <trinity.smith@.gmail.com> wrote in message
news:1104768719.403928.182220@.f14g2000cwb.googlegr oups.com...
>I want to grab what is in textbox1, put in string, and send as a query
> to bring up report with only textbox1 occurances in table. How do I do
> that please?
> Thanks,
> Trint

You will probably get a better answer in a C# or .NET forum - from a pure
MSSQL point of view, you probably want to look at creating a stored
procedure which takes @.mystring as a parameter. But there are different ways
to call a stored proc (check out the Command and Connection objects in ADO),
which is why you might want to try a different group for a more exact
reponse.

Simon

Sunday, February 19, 2012

how can I force text wrapping

In some text boxes within the table header, I want to force the text to wrap. This would be comparable to using Alt+Enter in Excel. For example, the text box may read like this...

Customer

Install Date

but I want it to look like this...

Customer

Install

Date

Thanks.

In your textbox, you can set the expression as follows:

="Customer" & vbcrlf & "Install" & vbclrf & "Date"

This should work and hope it helps!

|||

Thanks. That did it.