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

Tuesday, March 27, 2012

ftp task

Is is possible by ftp task to unzip the file and take the respective text file and place it in the local system.

sureshv wrote:

Is is possible by ftp task to unzip the file and take the respective text file and place it in the local system.

No. Unzipping a file has nothing to do with FTP and never will be included in such a task.

Use an Execute Process Task after the FTP task to unzip it.

Use a File System Task after the Execute Process task to move the resulting file, if needed. You usually can use command line arguments to the unzip process to direct the ZIP utility where to place the unzipped file.|||

what i am trying to do is i get a zip file (which has a text file) .

This zipfile is located on a different server.I want to transfer text file located with in the zip to a different server and then i run my package.

i want to setup my packages in such a way that they run automatically.

so in this case i guess i need to use ftp task to get the zip file to local server and then unzip it as u said..

|||

sureshv wrote:

so in this case i guess i need to use ftp task to get the zip file to local server and then unzip it as u said..

Correct. I've spelled out the steps you need.

Monday, March 26, 2012

FTE locks the table

I have a table with Full Text index on it, the table has at the most 300
records.
The database is on the live server and gets hit a lot.
Every morning when i come to work the table is inaccessible, meaning any
query that i issue to this table runs indefinitely, Select, update, Insert
all just hang.
The only way for me to fix this is manually End The Full Text Sql Windows
Task, in task manager. As soon as i end the task it restarts immediately and
everything is working fine after.
Is there a patch for Sql 2005 to fix this, did anyone experience something
like that?
Full-text indexing will cause some locking as it needs to create some level
of consistency with what is in the catalogs and what is in the database. Are
you using change tracking? If not you really should. You also might want to
set your resource usage to something smaller.
One more point, it is possible that other non-optimal procs or ad hoq sql
statements are themselves not tuned and are causing overall performance
problems manifesting itself in FTI locking.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
news:206A8F61-21C9-475B-9095-C6708D29A09C@.microsoft.com...
>I have a table with Full Text index on it, the table has at the most 300
> records.
> The database is on the live server and gets hit a lot.
> Every morning when i come to work the table is inaccessible, meaning any
> query that i issue to this table runs indefinitely, Select, update, Insert
> all just hang.
> The only way for me to fix this is manually End The Full Text Sql Windows
> Task, in task manager. As soon as i end the task it restarts immediately
> and
> everything is working fine after.
> Is there a patch for Sql 2005 to fix this, did anyone experience something
> like that?
>
sql

FTE locks the table

I have a table with Full Text index on it, the table has at the most 300
records.
The database is on the live server and gets hit a lot.
Every morning when i come to work the table is inaccessible, meaning any
query that i issue to this table runs indefinitely, Select, update, Insert
all just hang.
The only way for me to fix this is manually End The Full Text Sql Windows
Task, in task manager. As soon as i end the task it restarts immediately and
everything is working fine after.
Is there a patch for Sql 2005 to fix this, did anyone experience something
like that?Full-text indexing will cause some locking as it needs to create some level
of consistency with what is in the catalogs and what is in the database. Are
you using change tracking? If not you really should. You also might want to
set your resource usage to something smaller.
One more point, it is possible that other non-optimal procs or ad hoq sql
statements are themselves not tuned and are causing overall performance
problems manifesting itself in FTI locking.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
news:206A8F61-21C9-475B-9095-C6708D29A09C@.microsoft.com...
>I have a table with Full Text index on it, the table has at the most 300
> records.
> The database is on the live server and gets hit a lot.
> Every morning when i come to work the table is inaccessible, meaning any
> query that i issue to this table runs indefinitely, Select, update, Insert
> all just hang.
> The only way for me to fix this is manually End The Full Text Sql Windows
> Task, in task manager. As soon as i end the task it restarts immediately
> and
> everything is working fine after.
> Is there a patch for Sql 2005 to fix this, did anyone experience something
> like that?
>

FTE locks the table

I have a table with Full Text index on it, the table has at the most 300
records.
The database is on the live server and gets hit a lot.
Every morning when i come to work the table is inaccessible, meaning any
query that i issue to this table runs indefinitely, Select, update, Insert
all just hang.
The only way for me to fix this is manually End The Full Text Sql Windows
Task, in task manager. As soon as i end the task it restarts immediately and
everything is working fine after.
Is there a patch for Sql 2005 to fix this, did anyone experience something
like that?Full-text indexing will cause some locking as it needs to create some level
of consistency with what is in the catalogs and what is in the database. Are
you using change tracking? If not you really should. You also might want to
set your resource usage to something smaller.
One more point, it is possible that other non-optimal procs or ad hoq sql
statements are themselves not tuned and are causing overall performance
problems manifesting itself in FTI locking.
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
news:206A8F61-21C9-475B-9095-C6708D29A09C@.microsoft.com...
>I have a table with Full Text index on it, the table has at the most 300
> records.
> The database is on the live server and gets hit a lot.
> Every morning when i come to work the table is inaccessible, meaning any
> query that i issue to this table runs indefinitely, Select, update, Insert
> all just hang.
> The only way for me to fix this is manually End The Full Text Sql Windows
> Task, in task manager. As soon as i end the task it restarts immediately
> and
> everything is working fine after.
> Is there a patch for Sql 2005 to fix this, did anyone experience something
> like that?
>

FT Locks the table!

I have a table with Full Text index on it, the table has at the most 300
records.
The database is on the live server and gets hit a lot.
Every morning when i come to work the table is inaccessible, meaning any
query that i issue to this table runs indefinitely, Select, update, Insert
all just hang.
The only way for me to fix this is manually End The Full Text Sql Windows
Task, in task manager. As soon as i end the task it restarts immediately and
everything is working fine after.
Is there a patch for Sql 2005 to fix this, did anyone experience something
like that?
Full-text indexing will cause some locking as it needs to create some level
of consistency with what is in the catalogs and what is in the database. Are
you using change tracking? If not you really should. You also might want to
set your resource usage to something smaller.
One more point, it is possible that other non-optimal procs or ad hoq sql
statements are themselves not tuned and are causing overall performance
problems manifesting itself in FTI locking.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
news:60169C43-9233-4021-88C2-9C200A4E0462@.microsoft.com...
>I have a table with Full Text index on it, the table has at the most 300
> records.
> The database is on the live server and gets hit a lot.
> Every morning when i come to work the table is inaccessible, meaning any
> query that i issue to this table runs indefinitely, Select, update, Insert
> all just hang.
> The only way for me to fix this is manually End The Full Text Sql Windows
> Task, in task manager. As soon as i end the task it restarts immediately
> and
> everything is working fine after.
> Is there a patch for Sql 2005 to fix this, did anyone experience something
> like that?
>
|||Thank you Hilary.
I checked and i have the change tracking set to Auto.
I cannot find where i can change the resource usage for FT.
Can you help please?
It is Sql 2005.
"Hilary Cotter" wrote:

> Full-text indexing will cause some locking as it needs to create some level
> of consistency with what is in the catalogs and what is in the database. Are
> you using change tracking? If not you really should. You also might want to
> set your resource usage to something smaller.
> One more point, it is possible that other non-optimal procs or ad hoq sql
> statements are themselves not tuned and are causing overall performance
> problems manifesting itself in FTI locking.
>
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> 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
>
> "Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
> news:60169C43-9233-4021-88C2-9C200A4E0462@.microsoft.com...
>
>
|||sp_fulltext_service 'resource usage',2
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Mike Kansky" <MikeKansky@.discussions.microsoft.com> wrote in message
news:0953B0F8-5E75-482A-A273-DFA94BEAEA73@.microsoft.com...[vbcol=seagreen]
> Thank you Hilary.
> I checked and i have the change tracking set to Auto.
> I cannot find where i can change the resource usage for FT.
> Can you help please?
> It is Sql 2005.
>
> "Hilary Cotter" wrote:

Wednesday, March 21, 2012

from SQL 2005 to SQL 2000


Is there an easy way to import table data from SQL 2005 to SQL 2000?
Here's the story:
I want to use SQL 2005 b/c I like varchar(max) over TEXT and several other features. However there is another developer with a SQL 2000 DB who needs to be able to pull data from my tables. If I use something like varchar(max), xml, etc what would the other developer need to do to import my data?
I know that going in the reverse direction is possible, pushing data from a SQL 2005 DB to a SQL 2000 ( http://msdn2.microsoft.com/en-us/library/ms191212.aspx )
I'm mostly a programmer slowly turning into a dba so please excuse me if I'm missing something obvious.
Thanks.
--Alex

Alex,

If you want to transfer data from SQL 2005 database into SQL 2000 database BCP as you pointed out is the only option. You can use bcp from SQL 2000 installation and it will see datatypes that are compatible with SQL 2000. varchar(max) and xml I believe will be seen as text.

If you want to access data from SQL 2005 instance on SQL 2000 instance (without moving the data between instances) you can do so with linked servers with the same restriction as above (new datatypes will be seen as old ones on SQL 2000).

Regards,
Boris.

Monday, March 19, 2012

From Command window output to a text file

Hi,

I want to output from the database, throught the command prompt window and into a text file. I have found a command called bcp command, i have used it and it works just fine . However, i have a problem. The problem is that by default it outputs into the file using tab delimited form. Each column is seperated by a tab. Is there any way , either from the query analyzer onwards or from the bcp command to output the data without the tabs inbetween?

Thank you
George

Check BCP- Specifying Field and Row Terminators in BOL.

Madhu

|||HI,

i did my search before posting , however, the only part i could find similar to my problem was :

terminating character Indicated by

Tab

\t

This is the default field terminator.

Newline character

\n

This is the default row terminator.

Carriage return/line feed

\r

Backslash1

\\

Null terminator (nonvisible terminator)2

\0

Any printable character (control characters are not printable, except null, tab, newline, and carriage return)

(*, A, t, l, and so on)

String of up to 10 printable characters, including some or all of the terminators listed earlier

(**\t**, end, !!!!!!!!!!, \t—\n, and so on)


There is a lot about terminating characters,however, NOTHING on NO charactersat all. I want to tab inbetween, no backslash,no space, no nothing. How can i do that?

Thank you
George|||

i guess i am not clear with the requirement. is it that u want to have a o/p file having Column1+column2+colum3 etc ect without any delimitter?

Madhu

|||hi,

exactly. This is the output with tab delimited format.

vvvXXXXXXXXXXXXXXXXXXXXXX 20071112 h 0000000000005555,70 066,50000
abcXXXXXXXXXXXXXXXXXXXXXX 19000101 y 0454545454523456,45 077,30000
xyzcccXXXXXXXXXXXXXXXXXXX 19000101 x 0000000000003456,00 077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX 20030302 6 0000000000232323,45 005,00000

I want the output to have to tabs , as shown below:

vvvXXXXXXXXXXXXXXXXXXXXXX20071112h0000000000005555,70066,50000
abcXXXXXXXXXXXXXXXXXXXXXX19000101y0454545454523456,45077,30000
xyzcccXXXXXXXXXXXXXXXXXXX19000101x0000000000003456,00077,99865
fXXXXXXXXXXXXXXXXXXXXXXXX2003030260000000000232323,45005,00000

Columns values should not be seperated by tabs. Any thoughts?

Thank you
George|||

use QueryOut option with BCP

Eg.

C:\>bcp "Select col1+col2 from Tablename" queryout 2.txt -T -c

Madhu

|||Hi,

I am already using queryout in my command. the command is below:

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.txt -c -U sax -S KARAFOKAS -C 1252 -P passwsax

I am also using -c which assumes tab delimited as default.|||

c:\sqlcmd -q"select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" -o"c:\xxxx\replicate_replace.txt" -h-1

Check this

if its 2000 replace sqlcmd with OSQL

Madhu

|||

i can get the result as desired in both BCP and SQLCMD.

Madhu

|||Hi,

I dont understand. I want to use bcp command . Can you write the bcp command to use ?

Thank you
George|||

Have you tried with SQLCMD /OSQL . I can get the result as you mentioned using both BCP and SQLCMD. If still you are not able to then the workaround is add a new column to this table (or for that matter create a new table) and update the column with this Value and select that column using QUERYOUT.

Madhu

|||Hi,

I have tried with SQLCMD but it doesnt work. You said you got the same desired result using also bcp. well, what did u do to avoid the field delimeters? Can you copy paste the correct command to use without removing any of my properties/parameters that i have used?

Thank you
George|||Hi,

After a lot of hours i have managed to do what i wanted to . The only way NOT to have field delimiters is to create a format file and use that one in order to run the command. The format file looks like the one below (name: bcp.fmt)

8.0
5
1 SQLCHAR 0 25 "" 1 char25 Greek_BIN
2 SQLCHAR 0 8 "" 2 yyyymmdd Greek_BIN
3 SQLCHAR 0 1 "" 3 flag1 Greek_BIN
4 SQLCHAR 0 19 "" 4 amount Greek_BIN
5 SQLCHAR 0 9 "\r\n" 5 dperc Greek_BIN

As you can see , the field delimiters are empty. The command i used is :

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.tx
t -fc:\xxxx\bcp.fmt -U sax -S KARAFOKAS -C 1252 -P passsax

instead of

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.tx
t -c -U sax -S KARAFOKAS -C 1252 -P passsax

Hope others dont lose 2-3 hours of their time.

Thank you Madhu. I am marking this question sovled and helpful

George

Friday, March 9, 2012

French characters on English Platform dropped

Hi all,
I Had installed an english platform with full text indexing enable.
My data are French (with some accents for example).
When I search with a CONTAINS Statement on my Data, SQL Server drops my
accentuates characters.
How can I resolve this problem ?
What must I install on my platform to resolve this problem ?
Thanks for your answers.
Alex.
Exactly what do you mean by this.
Do you mean that a search on cafe will not match with a search on the
accented version of cafe?
This problem is fixed in SQL 2005.
In the meantime you have to expand your search on both the accented and
unaccented version of the search term.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Alexandre BARBIER" <(del_this)abarbier@.sopragroup.com> wrote in message
news:e8S11xylEHA.704@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I Had installed an english platform with full text indexing enable.
> My data are French (with some accents for example).
> When I search with a CONTAINS Statement on my Data, SQL Server drops my
> accentuates characters.
> How can I resolve this problem ?
> What must I install on my platform to resolve this problem ?
> Thanks for your answers.
> Alex.
>
|||Hi,
No, I mean that my data are in french version and my full text search turn
on an English Platform.
When I search a french word, the fulltext search dropped my accented
characters so my search doesn't work.
Any Ideas ?
Thanks.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23CSrWe0lEHA.3016@.tk2msftngp13.phx.gbl...
> Exactly what do you mean by this.
> Do you mean that a search on cafe will not match with a search on the
> accented version of cafe?
> This problem is fixed in SQL 2005.
> In the meantime you have to expand your search on both the accented and
> unaccented version of the search term.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Alexandre BARBIER" <(del_this)abarbier@.sopragroup.com> wrote in message
> news:e8S11xylEHA.704@.TK2MSFTNGP09.phx.gbl...
>
|||Alexandre,
This has been a long outstanding bug in SQL Server 7.0 and SQL Server 2000,
that is only "fixed" in SQL Server 2005 (Yukon) via the following new T-SQL
syntax:
CREATE FULLTEXT CATALOG Employee_FTC WITH ACCENT_SENSITIVITY = ON
CREATE FULLTEXT CATALOG Employee_FTC WITH ACCENT_SENSITIVITY=OFF
-- Or by using ALTER FULLTEXT CATALOG:
ALTER FULLTEXT CATALOG Employee_FTC REBUILD WITH ACCENT_SENSITIVITY=ON
The SQL Server 7.0 or SQL Server 2000 solution requires the duplication of
the accented data with the removal of accents via a UDF and insert/update
trigger to maintain the duplicate data. You would create a FT Index on the
non-accented data and return the accented data to your searcher.
Regards,
John
"Alexandre BARBIER" <(del_this)abarbier@.sopragroup.com> wrote in message
news:eE9gBIWmEHA.412@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hi,
> No, I mean that my data are in french version and my full text search turn
> on an English Platform.
> When I search a french word, the fulltext search dropped my accented
> characters so my search doesn't work.
> Any Ideas ?
> Thanks.
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:%23CSrWe0lEHA.3016@.tk2msftngp13.phx.gbl...
my
>

French characters are not imported properly with bcp

Hi
I have a script that uses bcp to import data from an ascii text file
into SQL tables. The french characters are not copied properly. They
are converted to letters of the alphabet. I tried to change all the
fields to nvarchar instead of varchar and nchar instead of char, but I
got Greek characters instead.

How can I fix this?

Here is some code:
--------
CREATE TABLE [dbo].[1_HLGT_HLT_COMP_f9.0] (
[hlgt_code] [int] NOT NULL ,
[hlt_code] [int] NOT NULL
) ON [PRIMARY]
GO

PRINT 'HLGT_HLT'
DECLARE @.s as nvarchar(300)
SET @.s='bcp MedDRA..[1_hlgt_hlt_comp_f9.0] in ' + char(34) +
'F:\MedDRA\9.0French\MedAscii\hlgt_hlt.asc' + char(34) + ' -c -t' +
char(34) + '$' + char(34) + ' -r$\n -e' + char(34) +
'F:\MedDRA\9.0French\logs\hlgt_hlt.err.txt' + char(34) + ' -b250 -m50
-SDEV -Usa -Ppassword -h' + char(34) + 'TABLOCK' + char(34)
EXEC master..xp_cmdshell @.sWael (sedky@.rocketmail.com) writes:
> I have a script that uses bcp to import data from an ascii text file
> into SQL tables. The french characters are not copied properly. They
> are converted to letters of the alphabet. I tried to change all the
> fields to nvarchar instead of varchar and nchar instead of char, but I
> got Greek characters instead.

Add -C RAW to the list of BCP options. By default, BCP assumes that
characters are in the OEM code page and will convert them to the ANSI
code page. Which results in a mess when data is already in the ANSI
code page.

> How can I fix this?
> Here is some code:
> --------
> CREATE TABLE [dbo].[1_HLGT_HLT_COMP_f9.0] (
> [hlgt_code] [int] NOT NULL ,
> [hlt_code] [int] NOT NULL
> ) ON [PRIMARY]
> GO

Eh, there are character columns in that table?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Does this require any special install on the server? I tried -C863 for
Canadian French, but the server does not recognize that code page.|||Wael (sedky@.rocketmail.com) writes:
> Does this require any special install on the server? I tried -C863 for
> Canadian French, but the server does not recognize that code page.

I have not heard of 863 before, but it sounds like an OEM code page.

Playing around a little, it appears that you can only use code pages
for which there are one or more collations. For instace, I tried CP852
which is Eastern Europe, but this gave me an error. On the the other
hand, 874 worked. (There are a number of Thai collations with that code
page.)

But is your file really in code page 863? And in such case how different
would it be from code page 850? (My standard source for checking out
code pages is down, so I can't check right now.)

Did you try -C RAW?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||I tried -C RAW but i got an error. If you check the windows regional
settings, you'll see 863 is the code page for Canadian French.

Regional and Language Options\Advanced|||Wael (sedky@.rocketmail.com) writes:
> I tried -C RAW but i got an error.

An error? Care to specify what? It's difficult to assist without knowing
the error message.

> If you check the windows regional
> settings, you'll see 863 is the code page for Canadian French.
> Regional and Language Options\Advanced

Yes, I also see that it is an OEM code page. Is the data file in this
code page?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||For question number 1, the error is pasted below.
For the second one I am not sure. The original text is a plain text
file.

NULL
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Code page 863 is
not supported by SQL Server
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to resolve column
level collations
NULL
BCP copy in failed
NULL

(9 row(s) affected)|||Wael (sedky@.rocketmail.com) writes:
> For question number 1, the error is pasted below.
> For the second one I am not sure. The original text is a plain text
> file.

If you the open file in Notepad, does it look good then? If it does,
it is not an OEM file. If the French characters are replaced with
other single characters, it could be CP863.

If the file looks bad in Notepad, does it look good when you type it
from a command-line window.

I'm a little surprised of the message you got with -C RAW. I was under
the impression that this would suppress all code-page conversion.

Anyway, if the file looks good in Notepad, use -C ACP or -C 1252.

If it looks goot in the command-line window, try -C 850. I don't know
about CP 863, but I would expected to be a version of CP 850.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||It worked. ACP worked.

THank you very much.

Wednesday, March 7, 2012

FREETEXT Document Title search

Is there a way using full text search to search on the title of a document
(i.e. The title used by Microsoft Word in it's title field, not the actual
name of the file)? I have stored procedures using FreeTextTable, but this
doesn't seem to be returning results based on the titles. Is this the
expected behavior? Is there a way around this? Thanks in advance!
No, there is no way to do this natively as SQL FTS does not index the
properties of documents only its contents. You would have to extract the
Document Title and store it in another column in the table.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Jeremy" <jmaddreysp@.cox.net> wrote in message
news:OvcQ2YfhEHA.2540@.TK2MSFTNGP10.phx.gbl...
> Is there a way using full text search to search on the title of a document
> (i.e. The title used by Microsoft Word in it's title field, not the actual
> name of the file)? I have stored procedures using FreeTextTable, but this
> doesn't seem to be returning results based on the titles. Is this the
> expected behavior? Is there a way around this? Thanks in advance!
>
>

Freetext box + SQL

I have a vb page, which is a simple front end so I can edit text from anywhere.

The person who is going to use it knows no html, and so I am trying to get freetextbox to work.

I am getting the following error:
Server Error in '/' Application.
------------------------

ExecuteNonQuery: CommandText property has not been initialized
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.InvalidOperationException: ExecuteNonQuery: CommandText property has not been initialized

Source Error:

Line 81:
Line 82: mySelectCmd.Connection.Open()
Line 83: mySelectCmd.ExecuteNonQuery()
Line 84: MyConnString.Close()
Line 85:

The pages code is below:


<%@. Page Language="VB" Debug="True" validateRequest="False"%>
<%@. Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data" %>
<script runat="server">
Dim MyConnString As SqlConnection
Dim mySelectCmd As SqlCommand
Dim mySelectQuery As String
dim myExecuteQuery As String

Sub Page_Load(Sender As Object, E As EventArgs)

If Not Page.IsPostBack Then
ReadMyData()
end if
end sub

Public Sub ReadMyData()
MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")

Dim dt As DataTable
Dim dr As DataRow
dt = New DataTable

dt.Columns.Add(New DataColumn("id", GetType(Integer)))
dt.Columns.Add(New DataColumn("title", GetType(String)))
dt.Columns.Add(New DataColumn("text", GetType(String)))
dt.Columns.Add(New DataColumn("section_no", GetType(String)))

mySelectQuery = "select * from content_text"
mySelectCmd = New SqlCommand( mySelectQuery, MyConnString)
MyConnString.Open()
Dim myReader As SqlDataReader = mySelectCmd.ExecuteReader()
Try
While myReader.Read()

dr = dt.NewRow()

dr(0) = myReader("id")
dr(1) = myReader("title")
dr(2) = myReader("text")
dr(3) = myReader("section_no")

dt.Rows.Add(dr)

End While
Finally
myReader.Close()
MyConnString.Close()
End Try

Pubs.DataSource = DT
Pubs.Databind()

End Sub

Sub Pubs_Cancel(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = -1
ReadMyData()
End Sub

Sub Pubs_Edit(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = CInt(e.Item.ItemIndex)
ReadMyData()
End Sub

Sub Pubs_Update(Sender As Object, E As DataGridCommandEventArgs)

MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")

myExecuteQuery= "Update content_text Set title=@.title, text=@.text, section_no=@.section_no where id=@.id"
mySelectCmd = New SqlCommand( mySelectQuery, MyConnString)

dim e_id as integer
dim e_title, e_text, e_section_no as string

e_Id = Pubs.DataKeys(CInt(E.Item.ItemIndex))
e_title = CType(e.Item.FindControl("e_title"), TextBox).Text
e_text = CType(e.Item.FindControl("e_text"), FreeTextBox).Text
e_section_no = CType(e.Item.FindControl("e_section_no"), TextBox).Text

mySelectCmd.Connection.Open()
mySelectCmd.ExecuteNonQuery()
MyConnString.Close()

pubs.EditItemIndex = -1

ReadMyData()

End Sub
</script>
<html>
<head>
<title>Untitled Document</title
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif; font-size:8pt}
-->
</style>
</head>
<body>
<form runat="server">
<asp:datagrid
id="Pubs"
GridLines="Both"
CssClass="style1"
DataKeyField="id"
Border="0"
CellPadding="2"
font-name="Arial"
font-size="9pt"
OnEditCommand="Pubs_Edit"
OnUpdateCommand="Pubs_Update"
OnCancelCommand="Pubs_Cancel"
Autogeneratecolumns="false"
Showfooter="true"
HeaderStyle-Font-Name="Arial"
HeaderStyle-Font-Size="8pt"
HeaderStyle-BackColor="#B7CEDF"
Font-Bold="True"
ItemStyle-Font-Name="Arial"
ItemStyle-Font-Size="8pt"
ItemStyle-VerticalAlign="top"
runat="server">
<columns>
<asp:templateColumn>
<HeaderTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left">Word</td>
<td width="15%" align="left">Title</td>
<td width="70%" align="left">Text</td>
<td width="10%" align="left">Section Number</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left"><asp:LinkButton ToolTip="Delete record" CommandName="Delete" runat="server"><img src="http://pics.10026.com/?src=images/deleteicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Edit record" CommandName="Edit" runat="server"><img src="http://pics.10026.com/?src=images/editicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="15%" align="left"><asp:Label ID="title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><asp:Label ID="text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="server" /></td>
<td width="10%" align="left"><asp:Label ID="section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table width ="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%"><asp:LinkButton ToolTip="Cancel edit record" CommandName="Cancel" runat="server"><img src="http://pics.10026.com/?src=images/cancelicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Update record" CommandName="Update" runat="server"><img src="http://pics.10026.com/?src=images/saveicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="20%" align="left"><asp:TextBox Width=200 CssClass="style1" ID="e_title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><FTB:FreeTextBox ToolbarStyleConfiguration="Office2000" id="e_text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="Server" /></td>
<td width="5%" align="left"><asp:TextBox Width=50 CssClass="style1" ID="e_section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</EditItemTemplate></asp:templateColumn>
</columns>
</asp:datagrid>
</form>
</body>
</html

You do this:
myExecuteQuery= "Update content_text Set title=@.title, text=@.text, section_no=@.section_no where id=@.id"
mySelectCmd = New SqlCommand( mySelectQuery, MyConnString)

Note you set myExecuteQuery, but you then pass mySelectQuery to the SqlCommand constructor. I strongly suggest using Option Explicit On, sinc ein this case I think it would have caught your error.|||Stupid mistake!

anyways, made that change and now get this error

Must declare the variable '@.title'.
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: Must declare the variable '@.title'.

Any idea's?

<code>
<%@. Page Language="VB" Debug="True" validateRequest="False"%>
<%@. Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data" %>
<script runat="server">
Dim MyConnString As SqlConnection
Dim mySelectCmd As SqlCommand
Dim mySelectQuery As String
dim myExecuteQuery As String
dim myExecuteCmd As SqlCommand

Sub Page_Load(Sender As Object, E As EventArgs)

If Not Page.IsPostBack Then
ReadMyData()
end if
end sub

Public Sub ReadMyData()
MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")

Dim dt As DataTable
Dim dr As DataRow
dt = New DataTable

dt.Columns.Add(New DataColumn("id", GetType(Integer)))
dt.Columns.Add(New DataColumn("title", GetType(String)))
dt.Columns.Add(New DataColumn("text", GetType(String)))
dt.Columns.Add(New DataColumn("section_no", GetType(String)))

mySelectQuery = "select * from content_text"
mySelectCmd = New SqlCommand( mySelectQuery, MyConnString)
MyConnString.Open()
Dim myReader As SqlDataReader = mySelectCmd.ExecuteReader()
Try
While myReader.Read()

dr = dt.NewRow()

dr(0) = myReader("id")
dr(1) = myReader("title")
dr(2) = myReader("text")
dr(3) = myReader("section_no")

dt.Rows.Add(dr)

End While
Finally
myReader.Close()
MyConnString.Close()
End Try

Pubs.DataSource = DT
Pubs.Databind()

End Sub

Sub Pubs_Cancel(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = -1
ReadMyData()
End Sub

Sub Pubs_Edit(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = CInt(e.Item.ItemIndex)
ReadMyData()
End Sub

Sub Pubs_Update(Sender As Object, E As DataGridCommandEventArgs)

MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")

myExecuteQuery= "Update content_text Set title=@.title, text=@.text, section_no=@.section_no where id=@.id"
myExecuteCmd = New SqlCommand( myExecuteQuery, MyConnString)

dim e_id as integer
dim e_title, e_text, e_section_no as string

e_Id = Pubs.DataKeys(CInt(E.Item.ItemIndex))
e_title = CType(e.Item.FindControl("e_title"), TextBox).Text
e_text = CType(e.Item.FindControl("e_text"), FreeTextBox).Text
e_section_no = CType(e.Item.FindControl("e_section_no"), TextBox).Text

mySelectCmd.Connection.Open()
mySelectCmd.ExecuteNonQuery()
MyConnString.Close()

pubs.EditItemIndex = -1

ReadMyData()

End Sub
</script>
<html>
<head>
<title>Untitled Document</title
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif; font-size:8pt}
-->
</style>
</head>
<body>
<form runat="server">
<asp:datagrid
id="Pubs"
GridLines="Both"
CssClass="style1"
DataKeyField="id"
Border="0"
CellPadding="2"
font-name="Arial"
font-size="9pt"
OnEditCommand="Pubs_Edit"
OnUpdateCommand="Pubs_Update"
OnCancelCommand="Pubs_Cancel"
Autogeneratecolumns="false"
Showfooter="true"
HeaderStyle-Font-Name="Arial"
HeaderStyle-Font-Size="8pt"
HeaderStyle-BackColor="#B7CEDF"
Font-Bold="True"
ItemStyle-Font-Name="Arial"
ItemStyle-Font-Size="8pt"
ItemStyle-VerticalAlign="top"
runat="server">
<columns>
<asp:templateColumn>
<HeaderTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left">Word</td>
<td width="15%" align="left">Title</td>
<td width="70%" align="left">Text</td>
<td width="10%" align="left">Section Number</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left"><asp:LinkButton ToolTip="Delete record" CommandName="Delete" runat="server"><img src="http://pics.10026.com/?src=images/deleteicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Edit record" CommandName="Edit" runat="server"><img src="http://pics.10026.com/?src=images/editicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="15%" align="left"><asp:Label ID="title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><asp:Label ID="text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="server" /></td>
<td width="10%" align="left"><asp:Label ID="section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table width ="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%"><asp:LinkButton ToolTip="Cancel edit record" CommandName="Cancel" runat="server"><img src="http://pics.10026.com/?src=images/cancelicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Update record" CommandName="Update" runat="server"><img src="http://pics.10026.com/?src=images/saveicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="20%" align="left"><asp:TextBox Width=200 CssClass="style1" ID="e_title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><FTB:FreeTextBox ToolbarStyleConfiguration="Office2000" id="e_text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="Server" /></td>
<td width="5%" align="left"><asp:TextBox Width=50 CssClass="style1" ID="e_section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</EditItemTemplate></asp:templateColumn>
</columns>
</asp:datagrid>
</form>
</body>
</html>
</code|||You need to set @.title, etc. parameters.

Here is some information on parameters|||Thanks for that, made those changes, but now getting an error as below, which is strange as the code is similar to what I used to add entries

Sorry to be a pain!

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30456: 'Text' is not a member of 'String'.

Source Error:

Line 74: myExecuteQuery= "Update content_text Set (title, text, section_no) values (@.title, @.text, @.section_no) where id=@.id"
Line 75: myExecuteCmd = New SqlCommand( myExecuteQuery, MyConnString)
Line 76: myExecuteCmd.Parameters.Add( "@.title", e_Title.Text )
Line 77: myExecuteCmd.Parameters.Add( "@.text", e_Text.Text )
Line 78: myExecuteCmd.Parameters.Add( "@.section_no", e_Section_no.Text)


<%@. Page Language="VB" Debug="True" validateRequest="False"%>
<%@. Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data" %>
<script runat="server">
Dim MyConnString As SqlConnection
Dim mySelectCmd As SqlCommand
Dim mySelectQuery As String
dim myExecuteQuery As String
dim myExecuteCmd As SqlCommand

Sub Page_Load(Sender As Object, E As EventArgs)

If Not Page.IsPostBack Then
ReadMyData()
end if
end sub

Public Sub ReadMyData()
MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")

Dim dt As DataTable
Dim dr As DataRow
dt = New DataTable

dt.Columns.Add(New DataColumn("id", GetType(Integer)))
dt.Columns.Add(New DataColumn("title", GetType(String)))
dt.Columns.Add(New DataColumn("text", GetType(String)))
dt.Columns.Add(New DataColumn("section_no", GetType(String)))

mySelectQuery = "select * from content_text"
mySelectCmd = New SqlCommand( mySelectQuery, MyConnString)
MyConnString.Open()
Dim myReader As SqlDataReader = mySelectCmd.ExecuteReader()
Try
While myReader.Read()

dr = dt.NewRow()

dr(0) = myReader("id")
dr(1) = myReader("title")
dr(2) = myReader("text")
dr(3) = myReader("section_no")

dt.Rows.Add(dr)

End While
Finally
myReader.Close()
MyConnString.Close()
End Try

Pubs.DataSource = DT
Pubs.Databind()

End Sub

Sub Pubs_Cancel(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = -1
ReadMyData()
End Sub

Sub Pubs_Edit(Sender As Object, E As DataGridCommandEventArgs)
Pubs.EditItemIndex = CInt(e.Item.ItemIndex)
ReadMyData()
End Sub

Sub Pubs_Update(Sender As Object, E As DataGridCommandEventArgs)

MyConnString = New SqlConnection( "Server=*;UID=*;PWD=*;Database=content_db")
dim e_id as integer
dim e_title, e_text, e_section_no as string

myExecuteQuery= "Update content_text Set (title, text, section_no) values (@.title, @.text, @.section_no) where id=@.id"
myExecuteCmd = New SqlCommand( myExecuteQuery, MyConnString)
myExecuteCmd.Parameters.Add( "@.title", e_Title.Text )
myExecuteCmd.Parameters.Add( "@.text", e_Text.Text )
myExecuteCmd.Parameters.Add( "@.section_no", e_Section_no.Text)

e_Id = Pubs.DataKeys(CInt(E.Item.ItemIndex))
e_title = CType(e.Item.FindControl("e_title"), e_TextBox).Text
e_text = CType(e.Item.FindControl("e_text"), e_FreeTextBox).Text
e_section_no = CType(e.Item.FindControl("e_section_no"), e_TextBox).Text

myExecuteCmd.Connection.Open()
myExecuteCmd.ExecuteNonQuery()
MyConnString.Close()

pubs.EditItemIndex = -1

ReadMyData()

End Sub
</script>
<html>
<head>
<title>Untitled Document</title
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif; font-size:8pt}
-->
</style>
</head>
<body>
<form runat="server">
<asp:datagrid
id="Pubs"
GridLines="Both"
CssClass="style1"
DataKeyField="id"
Border="0"
CellPadding="2"
font-name="Arial"
font-size="9pt"
OnEditCommand="Pubs_Edit"
OnUpdateCommand="Pubs_Update"
OnCancelCommand="Pubs_Cancel"
Autogeneratecolumns="false"
Showfooter="true"
HeaderStyle-Font-Name="Arial"
HeaderStyle-Font-Size="8pt"
HeaderStyle-BackColor="#B7CEDF"
Font-Bold="True"
ItemStyle-Font-Name="Arial"
ItemStyle-Font-Size="8pt"
ItemStyle-VerticalAlign="top"
runat="server">
<columns>
<asp:templateColumn>
<HeaderTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left">Word</td>
<td width="15%" align="left">Title</td>
<td width="70%" align="left">Text</td>
<td width="10%" align="left">Section Number</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%" align="left"><asp:LinkButton ToolTip="Delete record" CommandName="Delete" runat="server"><img src="http://pics.10026.com/?src=images/deleteicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Edit record" CommandName="Edit" runat="server"><img src="http://pics.10026.com/?src=images/editicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="15%" align="left"><asp:Label ID="title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><asp:Label ID="text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="server" /></td>
<td width="10%" align="left"><asp:Label ID="section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table width ="100%" border="0" cellpadding="2" cellspacing="2" class="style1">
<tr>
<td width="5%"><asp:LinkButton ToolTip="Cancel edit record" CommandName="Cancel" runat="server"><img src="http://pics.10026.com/?src=images/cancelicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton><asp:LinkButton ToolTip="Update record" CommandName="Update" runat="server"><img src="http://pics.10026.com/?src=images/saveicon.gif" alt="" width="12" height="12" border="0"></asp:LinkButton></td>
<td width="20%" align="left"><asp:TextBox Width=200 CssClass="style1" ID="e_title" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>' runat="server" /></td>
<td width="70%" align="left"><FTB:FreeTextBox ToolbarStyleConfiguration="Office2000" id="e_text" Text='<%# DataBinder.Eval(Container.DataItem, "text") %>' runat="Server" /></td>
<td width="5%" align="left"><asp:TextBox Width=50 CssClass="style1" ID="e_section_no" Text='<%# DataBinder.Eval(Container.DataItem, "section_no") %>' runat="server" /></td>
</tr>
</table>
</EditItemTemplate></asp:templateColumn>
</columns>
</asp:datagrid>
</form>
</body>
</html

|||Well, what do YOU think that error means?

Look at this code:


dim e_title, e_text, e_section_no as string

myExecuteQuery= "Update content_text Set (title, text, section_no) values (@.title, @.text, @.section_no) where id=@.id"
myExecuteCmd = New SqlCommand( myExecuteQuery, MyConnString)
myExecuteCmd.Parameters.Add( "@.title", e_Title.Text )
myExecuteCmd.Parameters.Add( "@.text", e_Text.Text )
myExecuteCmd.Parameters.Add( "@.section_no", e_Section_no.Text)

e_title is a string, and so, look at the docs for string. Do you see a .Text property of string? No, you do not. So, the error message was telling you EXACTLY what the problem is. You can just pass e_Title, since that is a string and that is what you are passing as the @.Title.

Sunday, February 26, 2012

Free text search for 2 million records

Hi

I have a new client with an existing system that has just over 2 million business listings in one table. Each business listing is associated with one business category.

* Company Table (around 20 fields):

companyID
companyName
categoryID
state
postCode
etc.

* Category Table (5 fields)

categoryID
categoryName
etc.

We are using MSSQL 2005 Express Edition with Advanced Services

A free text search needs to be performed on the companyName and categoryName limited by region (state and or postcode).

1) What kind of response times should I expect for the free text search (I have not used the free text search before)

2) How should I index the companyName and categoryName so they are both used in a joined query? i.e. Do I just configure the free text search index on each field separately and it should work?

Any suggestions appreciated.

Best Regards

Kevan1) Impossible to tell. It highly depends on the memory, disk solution, allocated memory to SQL Server, processor, operating system configurations and more.

2) Indexing the keys used in a join (that is: used in the on clause of the join) may improve performance.|||Thanks for that.

1)

Yes, that makes sense. I was really after a very general idea of other peoples experience when dealing with free text search on a couple of million records. What sort of average response times have other people achieved with simple free text searches on this number of records. We would most likely be using a low level hardware solution on a hosted server.

2)

Thanks

Free Text Search across multiple tables

Anyone have any recommendations on how to bring together a search across multiple tables? Like I'd love to do a search where i searched for the product name, company name or tag all in one query (though all are in separate tables)... is that possible? Individually, it's easy, but combined it's very hard.You can join the tables and use like, but I should probably first take a look at the Free text search engine (but it depends on how the table looks like, how the search will be formed in the future, how much data the table has etc), take a look at the following site:http://www.databasejournal.com/features/mssql/article.php/3441981|||

actually, that's just it... i'm using the full text search engine, which generates catalogs per table. I'm not sure how to bring the table results together. so, for example:

Declare @.search nvarchar(100)select @.search ='apple'SELECT TOP 5 * FROM brands INNER JOIN (SELECT * from freetexttable (Brands,*,@.Search) ORDER BY [RANK] DESC) AS search ON brands.brandid = search.[KEY]SELECT TOP 5 * FROM products INNER JOIN (SELECT * from freetexttable (products,*,@.Search) ORDER BY [RANK] DESC) AS search ON products.productid = search.[KEY]SELECT TOP 5 * FROM companies INNER JOIN (SELECT * from freetexttable (companies,*,@.Search) ORDER BY [RANK] DESC) AS search ON companies.companyid = search.[KEY]
 How do i bring these tables together and order them according to the closest match across the tables?
|||

Hey,

Did you have any luck with this? I'm using SQL 2005, and I've done a bit of testing, but haven't got the expected results!

Thanks

free text search

does anyone have code that shows how to separate individual words from a sentence.

e.g. i have a list of questions and answers in my database and have the following query for it:

SELECT question, Answer
FROM QuestionsAnswer
WHERE FREETEXT(Question, 'i want to travel around the world and learn about cooking')

so i want to extend the above query so that takes each key word (travel, cooking, learn) to find out how frequently that particular word appears in the question (for ranking purposes).

I know freetexttable does rank results, but they don't seem accurate enough for what i need to do.

HELP!!!i've just been told that freetext does this anyways...

=D|||have u tried search on the web|||You will need:

* A one column list (table) with all unimportant words. For that purpose I used a 20-year-old Commodore 64 text adventure interpreter list.

* A two column list (table) with the important words and the number of total occurences for each word.

You parse your text with space, comma, etc as word seperators and run each word against the first list. If it is not their you search it in the second list. If it is their you increment the occurence counter. If it is not their you add it with an occurence counter=1.

Check your second list from time to time in order to see if you can transfer a word from list 2 to list 1.

Easy, isn't it ?

Free Text Search

We have two SQL Server 2000 servers with SP4 loaded. We have copied a
database from one to the other. The free text search runs on the original
server and produces results but on the new server it runs but produces a nil
return.
Can anyone offer any help?
Confused but battling on
"Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> We have two SQL Server 2000 servers with SP4 loaded. We have copied a
> database from one to the other. The free text search runs on the original
> server and produces results but on the new server it runs but produces a
> nil
> return.
Free text?
I assume you mean FULL TEXT?
Did you copy the Full-text indices to the same place?
Did you enable full-text on the new database?
How was the data moved?

> Can anyone offer any help?
> --
> Confused but battling on
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
|||Sorry I did mean full text search. We have tried to re create the indices
and the search but it still returns a nil result. The full text search
service is running.
How do you enable full text search on a database?
The database was moved by backing up to a device, then copying the device to
the new location and restoring it (changing the file locations etc).
Eeverything else in the database works fine; it is just this full text search
Confused but battling on
"Greg D. Moore (Strider)" wrote:

> "Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
> news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> Sorry I did mean Full Text Search.
The full text searches had been copied to the same place and I'm not sure
what you mean about enabling full test searches on the database.
The full text search service is running
> Free text?
> I assume you mean FULL TEXT?
> Did you copy the Full-text indices to the same place?
> Did you enable full-text on the new database?
> How was the data moved?
>
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
>
>

Free Text Search

We have two SQL Server 2000 servers with SP4 loaded. We have copied a
database from one to the other. The free text search runs on the original
server and produces results but on the new server it runs but produces a nil
return.
Can anyone offer any help?
--
Confused but battling on"Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> We have two SQL Server 2000 servers with SP4 loaded. We have copied a
> database from one to the other. The free text search runs on the original
> server and produces results but on the new server it runs but produces a
> nil
> return.
Free text?
I assume you mean FULL TEXT?
Did you copy the Full-text indices to the same place?
Did you enable full-text on the new database?
How was the data moved?
> Can anyone offer any help?
> --
> Confused but battling on
--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||Sorry I did mean full text search. We have tried to re create the indices
and the search but it still returns a nil result. The full text search
service is running.
How do you enable full text search on a database?
The database was moved by backing up to a device, then copying the device to
the new location and restoring it (changing the file locations etc).
Eeverything else in the database works fine; it is just this full text search
--
Confused but battling on
"Greg D. Moore (Strider)" wrote:
> "Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
> news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> > We have two SQL Server 2000 servers with SP4 loaded. We have copied a
> > database from one to the other. The free text search runs on the original
> > server and produces results but on the new server it runs but produces a
> > nil
> > return.
> Sorry I did mean Full Text Search.
The full text searches had been copied to the same place and I'm not sure
what you mean about enabling full test searches on the database.
The full text search service is running
> Free text?
> I assume you mean FULL TEXT?
> Did you copy the Full-text indices to the same place?
> Did you enable full-text on the new database?
> How was the data moved?
>
> >
> > Can anyone offer any help?
> >
> > --
> > Confused but battling on
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
>
>

Free Text Search

We have two SQL Server 2000 servers with SP4 loaded. We have copied a
database from one to the other. The free text search runs on the original
server and produces results but on the new server it runs but produces a nil
return.
Can anyone offer any help?
Confused but battling on"Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> We have two SQL Server 2000 servers with SP4 loaded. We have copied a
> database from one to the other. The free text search runs on the original
> server and produces results but on the new server it runs but produces a
> nil
> return.
Free text?
I assume you mean FULL TEXT?
Did you copy the Full-text indices to the same place?
Did you enable full-text on the new database?
How was the data moved?

> Can anyone offer any help?
> --
> Confused but battling on
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||Sorry I did mean full text search. We have tried to re create the indices
and the search but it still returns a nil result. The full text search
service is running.
How do you enable full text search on a database?
The database was moved by backing up to a device, then copying the device to
the new location and restoring it (changing the file locations etc).
Eeverything else in the database works fine; it is just this full text searc
h
--
Confused but battling on
"Greg D. Moore (Strider)" wrote:

> "Madame Artois" <MadameArtois@.discussions.microsoft.com> wrote in message
> news:C3B84E7A-4085-4089-85B8-820174CC303E@.microsoft.com...
> Sorry I did mean Full Text Search.
The full text searches had been copied to the same place and I'm not sure
what you mean about enabling full test searches on the database.
The full text search service is running
> Free text?
> I assume you mean FULL TEXT?
> Did you copy the Full-text indices to the same place?
> Did you enable full-text on the new database?
> How was the data moved?
>
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com [url]http://www.greenms.com/sqlserver.html[/ur
l]
>
>

Friday, February 24, 2012

Free - Text Indexing

I am looking at a problem about intense CPU processing during a Background
Free Text reindexing. This happens about every 5 minutes (scheduled).
The key problem, is we are looking at putting the free text element onto
another hard disk controller to minimise. Would putting the Free-Text onto
another hard disk controller be sufficient or does it need to be associated
with another CPU.
This is on SQL 2000 Enterprise
Any advice would be helpful
Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.comJack,
What does your disk I/O look like? Is it higher that it should be? If not,
then adding another disk and controller probably won't solve your problem
(although it is a good idea anyway to isolate full text catalogs). If CPU is
your bottleneck and there are no other influencing issues such as bad
indexes, etc., then adding another server exclusively for full text indexing
is probably the solution.
Full text catalogs are notoriously resource intensive on SQL 2K. Supposely,
SQL 2005 has improved the performance significantly, but I haven't verified
it myself. Maybe upgrading to 2005 should be in the plan as well.
-- Bill
"Tom" <DEL_TO_REPLY@.del.com> wrote in message
news:Z7OdnXKLyrVGPJvbnZ2dnUVZ8sOonZ2d@.bt
.com...
>I am looking at a problem about intense CPU processing during a Background
>Free Text reindexing. This happens about every 5 minutes (scheduled).
> The key problem, is we are looking at putting the free text element onto
> another hard disk controller to minimise. Would putting the Free-Text onto
> another hard disk controller be sufficient or does it need to be
> associated with another CPU.
> This is on SQL 2000 Enterprise
> Any advice would be helpful
> --
> Jack Vamvas
> ___________________________________
> Advertise your IT vacancies for free at - http://www.ITjobfeed.com
>
>

Free - Text Indexing

I am looking at a problem about intense CPU processing during a Background
Free Text reindexing. This happens about every 5 minutes (scheduled).
The key problem, is we are looking at putting the free text element onto
another hard disk controller to minimise. Would putting the Free-Text onto
another hard disk controller be sufficient or does it need to be associated
with another CPU.
This is on SQL 2000 Enterprise
Any advice would be helpful
--
Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.comJack,
What does your disk I/O look like? Is it higher that it should be? If not,
then adding another disk and controller probably won't solve your problem
(although it is a good idea anyway to isolate full text catalogs). If CPU is
your bottleneck and there are no other influencing issues such as bad
indexes, etc., then adding another server exclusively for full text indexing
is probably the solution.
Full text catalogs are notoriously resource intensive on SQL 2K. Supposely,
SQL 2005 has improved the performance significantly, but I haven't verified
it myself. Maybe upgrading to 2005 should be in the plan as well.
-- Bill
"Tom" <DEL_TO_REPLY@.del.com> wrote in message
news:Z7OdnXKLyrVGPJvbnZ2dnUVZ8sOonZ2d@.bt.com...
>I am looking at a problem about intense CPU processing during a Background
>Free Text reindexing. This happens about every 5 minutes (scheduled).
> The key problem, is we are looking at putting the free text element onto
> another hard disk controller to minimise. Would putting the Free-Text onto
> another hard disk controller be sufficient or does it need to be
> associated with another CPU.
> This is on SQL 2000 Enterprise
> Any advice would be helpful
> --
> Jack Vamvas
> ___________________________________
> Advertise your IT vacancies for free at - http://www.ITjobfeed.com
>
>