Record Not Found With Contains And The Word 'most'

Jan 17, 2008

I encountered a problem in SQL server 2005 (sp2) when using a Contains statement on a table with Full-Text indexation turned on.

I have a table named 'Dealer' with Full-Text index turned on for a couple of fields. I also have website that people can use to search this table. The search is 'freetext' and will result in the following statement:


SELECT *

FROM Dealer

WHERE contains ((Dealer.Company, Dealer.Address), ' "searchword*" ')


As you can see we search two columns (both are included in the index) and 'searchword' is the word people have filled in on the website. This all works pefectly.

The problem.

The problem occurs when users search for the word 'most'. There is a dealer in the dealer table with 'Materieelverhuur vd Most bv' as company name. The statement above should return this dealers records but for some reason it does not. I execute the query in the MS SQL Server Management Studio. Couple of things I checked to solve it:
- When the search word is 'mater' (start of the name) or 'vd' the record _IS_ found.
- When I change the company name to 'Materieelverhuur vd Mast bv' (with an 'a') and I search for the word 'mast' the record _IS_ found.
- When I change the companyname to ''Materieelverhuur vd Moste bv'' (wiht an 'e' appended') the record _IS_ found. This will work with other letters and numbers as well. But if I append a '.' or an '&' the records _IS NOT_ found. So there seems to be a problem with non-alphanumeric characters.
- The same problem occurs in the 'address' field with the word 'most'
- The problem occurs both on our live server as my local setup.
- I tried to rebuild the catalog but that didn't help anyhting.
- I can reproduce the exact same behaviour on a different table as well.


Has anyone seen a similar behaviour? Or can anyone tell me how to solve this? Any suggestion would be very much appreciated!

Kind reagrds,
Thijs Nijhuis

View 11 Replies


ADVERTISEMENT

Displaying No Record Found Message

May 25, 2007

hi all,

i want to show a message when no rows is being returned from the data set,

i.e when there is no data to display the report should display

"No Record Found"

View 3 Replies View Related

How To Test If Record Is Found Or Not And Do Different Things Accordingly In A Query

Nov 15, 2007

 I want to do something likeif "Product_code" is Nullinsert dbo.t_Shopping_cart (Product_code,Name,Price,Product_group,Quantity,Total)select Product_code,Name,Price,Product_group,Quantity=1,Yhteensa=1FROM dbo.t_Shopping_cartWHERE Product_code='AHTU140213' elseupdate dbo.t_Shopping_cartset Quantity=Quantity+1where Product_code='AHTU140213'  In short: I cant test existence of a record.RegardsLeif 

View 3 Replies View Related

Delete Syntax To Delete A Record From One Table If A Matching Value Isn't Found In Another

Nov 17, 2006

I'm trying to clean up a database design and I'm in a situation to where two tables need a FK but since it didn't exist before there are orphaned records.

Tables are:

Brokers and it's PK is BID

The 2nd table is Broker_Rates which also has a BID table.

I'm trying to figure out a t-sql statement that will parse through all the recrods in the Broker_Rates table and delete the record if there isn't a match for the BID record in the brokers table.

I know this isn't correct syntax but should hopefully clear up what I'm asking

DELETE FROM Broker_Rates

WHERE (Broker_Rates.BID <> Broker.BID)

Thanks

View 6 Replies View Related

Can I Change Null Word In Report To Another Word

Feb 24, 2008

i have report with parameter and he can have a null in parameter ther is null word can i change it to another word like all or any thing else

View 4 Replies View Related

Sql Search Command Word By Word?

Mar 30, 2005

hi!
I'm just wondering does anyone know how to create an sql command that can search word by word?
what i mean is like I have a product with name 'harry potter broom'.
I want an sql command where if i type only 'harry broom' this 'harry potter broom' product will show up.
Does anyone have any idea?
Here's my sql comand: (I'm using asp.net vb script do develop this system)
-------------------------------------------------------------------------
query = "select distinct * from product where " & _
"(pname like '%" & keyword & "%' or " & _
"pdesc like '%" & keyword & "%' ) and " & _
"(price >= " & price1 & " and price <= " & price2 & _
") and status <> 'out of stock' order by price asc"
-------------------------------------------------------------------------
Thank you.

View 4 Replies View Related

Is The Word Name A Reserved Word?

Sep 24, 2007

 
Is the word "Name" a reserved word in SQL? look at line 10 of my stored procedure. When I use the word "Name"it is highlited in blue by SQL Server?
Note I only list part of the stored proc
1  CREATE PROCEDURE [dbo].[GetXMLPeopleNames] 23 (4 @Status nvarchar(3)5)6 AS7 SELECT8  PersonId,9  PersonDescription,10  Name,11  UpdateDate,12  UpdateAppUser13 FROM14  Customer WHERE Customer.PersonDescription=@Status15 ORDER BY

View 2 Replies View Related

The Connection Is Not Found. This Error Is Thrown By Connections Collection When The Specific Connection Element Is Not Found

May 1, 2007

I've got a package which reads a text file into a table and updates another. I set up configurations so that I could import it into the SSIS store on both my dev and live servers. Now, I'm getting this error. I tried removing the configs and am still getting it.

I've been through each step and everything looks okay. Does anyone have any idea (a) what's wrong, (b) how to localise the error or (c) get any additional information? Or do I just have to recreate the package from scratch?



TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at PartnerLinkFlatFileImporter: The connection "" is not found. This error is thrown by Connections collection when the specific connection element is not found.

Error at PartnerLinkFlatFileImporter [Log provider "SSIS log provider for SQL Server"]: The connection manager "" is not found. A component failed to find the connection manager in the Connections collection.

(Microsoft.DataTransformationServices.VsIntegration)

------------------------------
BUTTONS:

OK
------------------------------

View 20 Replies View Related

Convert Microsoft Word XML To PDF Without Using Microsoft Word

Jan 19, 2007

Hi all,

I work for a financial company where we send out lots of correspondence to clients on a daily and monthly basis. This would typically be something like a financial report, account statements, etc. We've decided to use PDF as the format which these documents must be in when our clients receive them.

Our marketing and sales departments designs the templates of these documents using Microsoft Word. They can save these MS Word documents in the Word XML format (either 2003 or 2007). We want it in XML format, because it is text based, and we can therefore string replace the content to update the template with a client€™s information. In the same token RTF would also do, but the file size when converted to RTF is a problem.

What I am looking for is a way to convert this XML into PDF using something like XSL-FO - i.e. we do not want to use the Word Interopt on our Production Server, firstly it is a little slow and secondly the production server is unmanned and we cannot allow a WinWord.EXE process to not close successfully for some or other reason.

I've tried a number of companies' evaluation software to try and achieve this (converting the WordML to PDF via XSL-FO), but so far no luck.

Does anybody know of a stylesheet out there with which I will be able to achieve this? Or an alternative method of converting MS Word files into PDF without using Word to do it?

Thank you in advance.

Regards

View 4 Replies View Related

TOUGH INSERT: Copy Sale Record/Line Items For Duplicate Record

Jul 20, 2005

I have a client who needs to copy an existing sale. The problem isthe Sale is made up of three tables: Sale, SaleEquipment, SaleParts.Each sale can have multiple pieces of equipment with correspondingparts, or parts without equipment. My problem in copying is when I goto copy the parts, how do I get the NEW sale equipment ids updatedcorrectly on their corresponding parts?I can provide more information if necessary.Thank you!!Maria

View 6 Replies View Related

How To Create An Copy Of A Certain Record Except One Specific Column That Must Be Different &&amp; Insert The New Record In The Table

Sep 1, 2006

Hi
I have a table with a user column and other columns. User column id the primary key.

I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key

Thanks.

View 6 Replies View Related

Ways To Make This Work: Several Selectable Related Record For One Main Record.

Apr 6, 2007

Hey all!



Sorry for the less then descriptive post title but I didn't find a better way to describe it. I'm developing an app in the express editions of VB and SQLserver. The application is a task/resource scheduler. The main form will have a datepicker or weekly overview and show all tasks scheduled per day. The problem is, I've got one or more people assigned to tasks and I wonder what's the best way to design this. Personally, I'd go for one Task table, a People table and a table that provides a link between them (several record per task, one for each person assigned linking TaskID and PplID). However, I don't see a nice way of showing this data to the end user, allowing him to edit/add etc on ONE screen.

To fix that the only way I see is just add columns to the Task table for every person with select boxes. This way everything can be done on one simple screen. This obviously does present some future issues.

On top of this, which people are available on a day varies and there should be an option to allow a user to set who is available on a specific day. Which would lead me to my first idea and add another table that would provide this. but then I'm having design issues again for the form.



I'm kinda stuck atm, can anyone shed some light on this. I'm sure there is an elegant way of doing this but I'm failing at finding it.



Thanks in advance,

Johan

View 5 Replies View Related

Query Timeouts When Updating A Record Retrieved Through A Websphere JDBC Datasource - Possible Record Locking Problem

Apr 7, 2008

Hi,

We're running a Sage CRM install with a SQL Server 2000 database at the back end. We're using the Sage web services API for updating data and a JDBC connection to retrieve data as it's so much quicker.

If I retrieve a record using the JDBC connection and then try and update the same record through the web services, the query times out as if the record is locked for updates. Has anyone experienced anything similar or know what I'm doing wrong? If I just use DriverManager.getConnection() to establish the connection instead of the datasource, and then continue with the same code I don't get these record locking problems. Please find more details below.

Thanks,
Sarah

The JDBC provider for the datasource is a WebSphere embedded ConnectJDBC for SQL Server DataSource, using an implementation type of 'connection pool datasource'. We are using a container managed J2C authentication alias for logging on.

This is running on a Websphere Application Server v6.1.

Code snippet - getting the record thru JDBC:


DataSource wsDataSource = serviceLocator.getDataSource("jdbc/dsSQLServer");
Connection wsCon = wsDataSource.getConnection();


// wsCon.setAutoCommit(false); //have tried with and without this flag - same results

Statements stmt = wsCon.createStatement();


String sql = "SELECT * FROM Person where personID = 12345";
ResultSet rs = stmt.executeQuery(sql);


if(rs.next()){
System.out.println(rs.getString("lastName"));
}

if (rs != null){
rs.close();
}
if (stmt != null) {

stmt.close();
}
if (wsCon != null) {

wsCon.close();
}

View 1 Replies View Related

SSIS: Multi-Record File Extract With 9 Record Types

Feb 26, 2008

I am attempting to create a multi-record file (as described in my last thread) and have found the following set of instructions very helpful:
http://vsteamsystemcentral.com/cs21/blogs/steve_fibich/archive/2007/09/25/multi-record-formated-flat-file-with-ssis.aspx

I have been able to create a sample file with two of my record types.

I now need to build on this further, because I have 9 record types in total that need to be extracted to a single flat file.

does anyone have any ideas how I might extend the example above to include more record types or know of another means of achieving this?

Thanks in advance for any help you might be able to provide.


View 3 Replies View Related

Add Date To Record In SQL Server Each Time Record Is Added

Mar 1, 2006

Hi
 
Can anyone advise me as to how I can add the date and time to 2 columns in the sql server database for each record that is added. I'd prefer not to use the webform. Can sql server add the date automatically to the row?
thanks

View 6 Replies View Related

Restrict Inserting Record If Record Already Exist In Table

Apr 17, 2014

Is that possible to restrict inserting the record if record already exist in the table.

Scenario: query should be

We are inserting a bulk information of data, it should not insert the row if it already exist in the table. excluding that it should insert the other rows.

View 2 Replies View Related

Delete Record Based On Existence Of Another Record In Same Table?

Jul 20, 2005

Hi All,I have a table in SQL Server 2000 that contains several million memberids. Some of these member ids are duplicated in the table, and eachrecord is tagged with a 1 or a 2 in [recsrc] to indicate where theycame from.I want to remove all member ids records from the table that have arecsrc of 1 where the same member id also exists in the table with arecsrc of 2.So, if the member id has a recsrc of 1, and no other record exists inthe table with the same member id and a recsrc of 2, I want it leftuntouched.So, in a theortetical dataset of member id and recsrc:0001, 10002, 20001, 20003, 10004, 2I am looking to only delete the first record, because it has a recsrcof 1 and there is another record in the table with the same member idand a recsrc of 2.I'd very much appreciate it if someone could help me achieve this!Much warmth,Murray

View 3 Replies View Related

Switch Record Background Color With Each Record In Report

Jan 14, 2008

Hi Everyone-

i have a matrix report
and i want to switch the record background color with each record in the value column in that matrix report
e.g 1st record background color is gray and next record background color is white
and then the next record background color is gray ... and so on

can anyone help?

thanx
Maylo

View 8 Replies View Related

Joining Record With The Most Recent Record On Second Table

Apr 23, 2008

Could anybody help me with the following scenario:

Table 1 Table2

ID,Date1 ID, Date2

I would like to link the two tables and receive all records from table2 joined on ID and the record from table1 that has the most recent date.

Example:

Table1 data Table2 Data

ID Date1 ID Date2
31 1/1/2008 31 1/5/2008
34 1/4/3008 31 4/1/2008
31 3/2/2008


The first record in table2 would only link to the first record in table1
The second record in table2 would only link to the third record in table1

Any help would be greatly appreciated.
Thanks

View 4 Replies View Related

How To Return First Record Child Record And Count

Jan 31, 2006

I've been looking for examples online to write a SPROC to get some data. Here are the tables.

Album_Category
AlbumCategoryID (PK, int, not null)
Caption (nvarchar(max), not null)
IsPublic (bit, not null)

Albums
AlbumID (PK, int, not null)
AlbumCategoryID (int, null)
Caption (nvarchar(max), not null)
IsPublic (bit, not null)

I need to return:
-[Album_Category].[AlbumCategoryID]
-[Album_Category].[Caption]
-[Albums].[Single AlubmID for each AlbumCategoryID]
-[Count of Albums in each AlbumCategory]

I hope I was fairly clear in what I'm trying to do. Any tips or help would be appreciated. Thanks.

View 3 Replies View Related

SQL Challenge - How To Return A Record Set Starting At A Particular Record?

Feb 25, 2007

I have a directory of user information. What I would like to do isallow someone to search for person X and then return not only theinformation for person X, but also the information for the next 15people following person X sorted alphabetically by lastname.So if someone searched for the lastname = "Samson", it would return:Samson, JohnSaxton, GregScott, HeatherSears, Rebecca.... (15 names following "Samson) ...How do you in SQL return a record set of X records starting atparticular record (e.g. lastname = "Smith)?Thanks in advance.

View 4 Replies View Related

Column Locked In Record Even Though No One Accessing Record

Mar 18, 2008



Hello. I have a database with a record that has two columns locked. descrip1 and descrip2. they are both nvarchar(max) columns. These are the only two columns of the record that remain locked. I am certain no user is accessing the record. I have even moved a backup of the database to my testing computer and the lock still exists. How do I remove the lock from these two columns on that particular record.

I can edit these two columns on other records. I have researched "Unlock" on MSDN but it doesn't seem to apply to t-sql. Any help would be greatly appreciated.

Thanks. Gary.

View 4 Replies View Related

Update A Record Based Of A Record In The Same Table

Aug 16, 2006

I am trying to update a record in a table based off of criteria of another record in the table.

So suppose I have 2 records

ID owner type

1 5678 past due

2 5678 late

So, I want to update the type field to "collections" only if the previous record for the same record is "past due". Any ideas?

View 5 Replies View Related

Keep Track Of When And By Who A Record Was Created And Also When And By Who The Record Was Last Updated

May 26, 2008

I have not yet succeeded in getting an aswer to this in a previous post, so I'll try again and rephrase the question

I have 2 fields, 1 called 'Created' the other 'Updated'

I would like to create a function, user procedure ,whatever in SQL something along the lines of...

FUNCTION myUID()
RETURN Date(Today)+Time(Now)+USERNAME
END FUNCTION


so that the value returned by the above pseudo code is something like '20080526T21:01:05.620SamL' where the date part is in yyyy0m0d format

I have got this working fine for the default 'Created' field but the calculated (and persisted) field comes up with something about being non-deterministic and refuses to play

Clearly something along these lines is a very straightforward requirement (I have it working fine in my 20+ year old database) , but have spent a week trying to get an answer (even from this forum) without success, so would be grateful for any help that you can provide me with to get round this barrier

View 10 Replies View Related

Lookup &&amp; Update Record &&amp; Insert Record

Mar 26, 2008

Hi All,

I am trying to create package something like that..

1- New Customer table as OleDB source component
2- Lookup component - checks customer id with Dimension_Customer table
3- And if same customer exist : I have to update couple fields on Dimension_Customer table
4- if it does not exist then I have insert those records to Dimension_Customer table

I am able to move error output from lookup to Dimension_Customer table using oledb destination
but How can I update the existing ones?
I have tried to use oledb command but somehow it didnt work
my sql was like this : update Dimension_Customer set per_X='Y', per_Y= &Opt(it should come from lookup)

I will be appreciated if you can help me...

View 3 Replies View Related

Multiple Record Insertion For Each Record From Source

Jan 10, 2008



Hi,

How can we insert multiple records in a OLEDB destination table for each entry from the source table.
To be more clear, for every record from source we need to insert some 'n' number of records into the destination table. this 'n' changes depending on the record.
how is this achieved.

thanks.

View 4 Replies View Related

Word And SQL 7.0

Feb 22, 2000

Ever store a word document in a sql table...? Just wondering how you did it...

Thanks!

Dean

View 1 Replies View Related

How To Get Last Word Of URL

Aug 5, 2013

DECLARE @url VARCHAR(1000)

SET @url ='http://www.microsoft.com/technet/security/bulletin/ms11-022.mspx';

How to get the result like 'ms11-022.mspx'

View 1 Replies View Related

Word Xp

Sep 30, 2005

I have Sql Server 2000 and Word from Office Xp. Since a few weeks, I cannotimport Data from my database towards a Word document. I follow theprocedure, but at the end, it tells me Word cannot find the data source. IfI use Excel, well it works perfectly. What is the gig?thanks

View 5 Replies View Related

Rdl To Word Doc ??

Jun 18, 2007

Hi,



Can anyone assist me to convert .rdl files into an word file ?

Shall i need to write a program ??





Regards

Harsh

View 1 Replies View Related

Key Word Like

Sep 5, 2007

Can anyone find what is wrong with this? I think I am using the keyword "Like" correctly. I am trying to enforce some rules by doing this this way. No obvious typos or syntax errors are jumping out at me.



CREATE DATABASE VetClinic

ON

(NAME='VetClinic',

FILENAME = 'c:Program FilesMicrosoft SQL ServerMSSQL.1mssqldataVetClinic.mdf',

SIZE = 100MB,

MAXSIZE = 500MB,

FILEGROWTH = 10MB)

LOG ON

(NAME = 'VetClinicLog',

FILENAME = 'c:Program FilesMicrosoft SQL ServerMSSQL.1mssqldataVetClinic.ldf',

SIZE = 5MB,

MAXSIZE = 25MB,

FILEGROWTH = 5MB)

GO

CREATE TABLE Customers

(

CustID int IDENTITY NOT NULL PRIMARY KEY,

FirstName varchar(15) NOT NULL,

LastName varchar(15) NOT NULL,

StreetAddress varchar(25) NOT NULL,

City varchar(20) NOT NULL,

CustState char(2) NOT NULL,

Zip varchar(10) NOT NULL,

Phone1 char(13) NOT NULL

LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",

Phone2 char(13) NULL

LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",

Email varchar(30) NULL,

DateInSystem smalldatetime NOT NULL

DEFAULT GETDATE()

)

GO

CREATE TABLE PetDetails

(

PetID int IDENTITY NOT NULL PRIMARY KEY,

CustID int NOT NULL

FOREIGN KEY REFERENCES Customers(CustID),

PetName varchar(20) NOT NULL,

BreedID int NOT NULL,

Gender char(1) NOT NULL

LIKE "m" OR "f",

Weight decimal NOT NULL,

DOB smalldatetime NULL,

DateFixed smalldatetime NULL,

DateLastSeen smalldatetime NULL,

VetLastSeen int NULL

)

GO

CREATE TABLE Employees

(

EmpID int IDENTITY NOT NULL PRIMARY KEY,

PositionID int NOT NULL

FOREIGN KEY REFERENCES Positions(PositionID),

FirstName varchar(15) NOT NULL,

LastName varchar(15) NOT NULL,

SSN char(11) NOT NULL

LIKE "[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]",

StreetAddress varchar(25) NOT NULL,

City varchar(20) NOT NULL,

CustState char(2) NOT NULL,

Zip varchar(10) NOT NULL,

Phone1 char(13) NOT NULL

LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",

Phone2 char(13) NULL

LIKE "([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]",

Email varchar(30) NULL,

DateInSystem smalldatetime NOT NULL

DEFAULT GETDATE(),

HireDate smalldatetime NOT NULL,

TerminationDate smalldatetime NOT NULL,

PaySatus char(6) NOT NULL

LIKE "hourly" OR "salary",

PayAmount money NOT NULL

)

GO

CREATE TABLE Appointment

(

ApptID int IDENTITY NOT NULL PRIMARY KEY,

EmpID int NOT NULL,

ApptDate smalldatetime NOT NULL,

ApptTime smalldatetime NOT NULL,

PetID int NOT NULL,

CustID int NOT NULL,



)

GO

CREATE TABLE PetProcedures

(



ProcedureID int IDENTITY NOT NULL PRIMARY KEY,

ProcedureDescrip varchar(20) NOT NULL,

Cost money NOT NULL



)





GO

CREATE TABLE Breed

(

BreedID int IDENTITY NOT NULL PRIMARY KEY,

BreedName varchar(20) NOT NULL

)

GO

CREATE TABLE Prescriptions

(

PrescriptionID int IDENTITY NOT NULL PRIMARY KEY,

PetID int NOT NULL,

MedID int NOT NULL,

EmpID int NOT NULL,

DatePrescribed smalldatetime NOT NULL

)

GO

CREATE TABLE Medications

(

MedID int IDENTITY NOT NULL PRIMARY KEY,

MedName varchar(30) NOT NULL,

MedType varchar(20) NOT NULL,

Dosage varchar(20) NULL,

Frequency varchar(10) NOT NULL

LIKE "daily", "weekly", "monthly" OR "annually"

)

GO

CREATE TABLE Positions

(

PositionID int IDENTITY NOT NULL PRIMARY KEY,

PositionName varchar(20) NOT NULL

LIKE "vet", "tech", "front desk" OR "office manager"

)

- -----------------------------------------------------------------------------------------------------------------

Here are the errors that I got


Msg 156, Level 15, State 1, Line 12

Incorrect syntax near the keyword 'LIKE'.

Msg 156, Level 15, State 1, Line 10

Incorrect syntax near the keyword 'LIKE'.

Msg 156, Level 15, State 1, Line 10

Incorrect syntax near the keyword 'LIKE'.

Msg 156, Level 15, State 1, Line 9

Incorrect syntax near the keyword 'LIKE'.

Msg 156, Level 15, State 1, Line 6

Incorrect syntax near the keyword 'LIKE'.

View 1 Replies View Related

Cutting To A Certain Word

Nov 29, 2006

Hi there, i need to know how to cut a string to the nearest word. For example, i've got an article and i need to extract just a part of the beginning, i could use LEFT([content], 250) but there is little chance this will cut on a word. Therefore i need to know if there is a function that will cut to the nearest word in T-SQL or i will simply put a summary field in the database. (I prefer to generate the summary on the fly if possible)

View 3 Replies View Related

How To Do A Word Search?

Dec 29, 2006

I need to be able to search article in several tables in a MSSQL DB. What is the best way to do a word search? Are there and freebies out there or code examples?
 
Dave

View 3 Replies View Related







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