Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Wednesday, March 21, 2012

further to problem with obtaining first/last occurance of contiguous blocks of data

Hi again, I was hoping someone could help me create a sql query to
minimizing the content in my table based on a few rules.
Further to my previous post...
f2b9da63" target="_blank">http://groups.google.com.au/group/m...br />
f2b9da63
... I have decided to use triggers to process my table (see trigger solutio
n
in my previous post). However since triggers are slow at processing, I aim
to search for a solution to minimize my initial table structure so the
triggers have less data to work with (hence process it much quicker). What I
am looking for is a method to perform the following:
This is my initial table (as an example):
[system] [date] [isOn]
A 01 0
A 04 1
A 05 1
A 06 0
A 20 1
A 21 0
A 25 0
A 27 1
A 32 1
A 33 1
A 34 0
A 40 1
B 41 1
B 45 0
B 49 1
B 50 1
B 51 1
B 53 1
B 67 0
I want my final table to look like this:
[system] [date] [isOn]
A 01 0
A 04 1
-
A 06 0
A 20 1
A 21 0
-
A 27 1
-
-
A 34 0
A 40 1
B 41 1
B 45 0
B 49 1
-
-
-
B 67 0
... where i have placed a '-' sign to indicate the rows i need deleted
I am deleting rows under the following conditions:
1. for a contiguous block of 1's WITHIN the same client range, delete all
but the first one ( i.e.the one at the earliest date)
2. for a contiguous block of 0's WITHIN the same client range, delete all
but the first one (i.e. the one at the earliest date)
i.e. notice above that even though there is a contiguous block of 1's from
date = 40 to 41, I have not remove the 2nd '1' as that crosses into client
B.
After this table is thus processed, I can use my cursor on it.
Any help would be really appreciated!
many thanks
wileyI have scrapped my cursor implementation for a much faster set-based
approach put forward by Itzik Ben-Gan (as im my previous post). Thanks
everyone!
cheers
wiley
"wiley" <wiley@.nospam.com> wrote in message
news:uK5SI4SFGHA.216@.TK2MSFTNGP15.phx.gbl...
> Hi again, I was hoping someone could help me create a sql query to
> minimizing the content in my table based on a few rules.
> Further to my previous post...
> 29f2b9da63" target="_blank">http://groups.google.com.au/group/m... />
29f2b9da63
> ... I have decided to use triggers to process my table (see trigger
> solution in my previous post). However since triggers are slow at
> processing, I aim to search for a solution to minimize my initial table
> structure so the triggers have less data to work with (hence process it
> much quicker). What I am looking for is a method to perform the following:
> This is my initial table (as an example):
> [system] [date] [isOn]
> A 01 0
> A 04 1
> A 05 1
> A 06 0
> A 20 1
> A 21 0
> A 25 0
> A 27 1
> A 32 1
> A 33 1
> A 34 0
> A 40 1
> B 41 1
> B 45 0
> B 49 1
> B 50 1
> B 51 1
> B 53 1
> B 67 0
> I want my final table to look like this:
> [system] [date] [isOn]
> A 01 0
> A 04 1
> -
> A 06 0
> A 20 1
> A 21 0
> -
> A 27 1
> -
> -
> A 34 0
> A 40 1
> B 41 1
> B 45 0
> B 49 1
> -
> -
> -
> B 67 0
> ... where i have placed a '-' sign to indicate the rows i need deleted
> I am deleting rows under the following conditions:
> 1. for a contiguous block of 1's WITHIN the same client range, delete all
> but the first one ( i.e.the one at the earliest date)
> 2. for a contiguous block of 0's WITHIN the same client range, delete all
> but the first one (i.e. the one at the earliest date)
> i.e. notice above that even though there is a contiguous block of 1's from
> date = 40 to 41, I have not remove the 2nd '1' as that crosses into client
> B.
> After this table is thus processed, I can use my cursor on it.
> Any help would be really appreciated!
> many thanks
> wiley
>

Friday, February 24, 2012

Full-Text search indexing HTML content

I've been quite busy these days looking up which was the best way to create
a full-text search catalog for a field composed entirely of HTML content, a
nd I found out that the best way to handle it, so it could ignore HTML tags
as the search was performed, was to make the column an Image-type field, and
associate a file type in a separate column.
I developed a small application that read each of the text field entries, co
nverted it to a byte[] variable using the UnicodeEncoding class (and it's Ge
tString and GetBytes methods) and saved the resulting byte array as a binary
file in the new image field. I even tested how the field data would fare in
a physical file, by using a FileStream to write the Byte[] data on several
different records.
So far, so good. It all seemed to be working. The problem is that after I bu
ild up the full-text catalog (using the wizard, and specifying the file type
field related to the "image" field where the HTML file is stored), I get no
resulting records whenever I perform a query using either CONTAINS or FREET
EXT. Such queries worked just fine when the field was a text field instead o
f an image field, so I'm guessing something went wrong either on the data co
nversion, or on the catalog building process.
Anyone has any ideas?On Wed, 23 Nov 2005 16:45:54 -0600, bacusgod wrote:
(snip)
>Anyone has any ideas?
Hi bacusgod,
You might want to try reposting this in the group where the full text
experts hang out: microsoft.public.sqlserver.fulltext
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Sunday, February 19, 2012

Full-text Search

Hello, I have a full-text enabled field in my table has the following
content as an example:
"SQL Server is a comprehensive, integrated, end-to-end data solution
that empowers your people by providing a more secure, reliable, and
productive platform for enterprise data and BI applications. SQL Server
2005 delivers powerful, familiar tools to IT professionals as well as
to information workers, reducing the complexity of creating, deploying,
managing, and using enterprise data and analytical applications on
platforms ranging from mobile devices to enterprise data systems."
My question: Is there a way to return only the text that follows a
keyword specified as a parameter in the select statement? for example
the above content would be selected if i search for "reducing" but i
would like to return in that case:
"reducing the complexity of creating, deploying, managing, and using
enterprise data and analytical applications on platforms ranging from
mobile devices to enterprise data systems." as that piece of text
follows the word "reducing"
Any ideas would be appreciated.
Thanks,
Mayahttp://groups.google.com/group/microsoft.public.sqlserver.fulltext/msg/81eb71cac37c6cf3?dmode=source
--
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
"Maya" <kfoury@.gmail.com> wrote in message
news:1140309837.125404.94740@.g14g2000cwa.googlegroups.com...
> Hello, I have a full-text enabled field in my table has the following
> content as an example:
> "SQL Server is a comprehensive, integrated, end-to-end data solution
> that empowers your people by providing a more secure, reliable, and
> productive platform for enterprise data and BI applications. SQL Server
> 2005 delivers powerful, familiar tools to IT professionals as well as
> to information workers, reducing the complexity of creating, deploying,
> managing, and using enterprise data and analytical applications on
> platforms ranging from mobile devices to enterprise data systems."
>
> My question: Is there a way to return only the text that follows a
> keyword specified as a parameter in the select statement? for example
> the above content would be selected if i search for "reducing" but i
> would like to return in that case:
>
> "reducing the complexity of creating, deploying, managing, and using
> enterprise data and analytical applications on platforms ranging from
> mobile devices to enterprise data systems." as that piece of text
> follows the word "reducing"
>
> Any ideas would be appreciated.
>
> Thanks,
>
> Maya
>

Fulltext query fails with "The content index is corrupt." on sql server 2005

What are my options here, does a repair exist or do I have to delete and rebuild the entire index?

I am afraid you will need to rebuild your entire index. There is no such option as 'repair'.

Please, feel free to contact me letting me know which operations toke place in order to have this corrupted status, as it is not common indeed.

Thanks.

Fulltext query fails with "The content index is corrupt." on sql server 2005

What are my options here, does a repair exist or do I have to delete and rebuild the entire index?

I am afraid you will need to rebuild your entire index. There is no such option as 'repair'.

Please, feel free to contact me letting me know which operations toke place in order to have this corrupted status, as it is not common indeed.

Thanks.