Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Friday, March 23, 2012

Front-end website search using Full-Text

I am building a front-end search on a website to serach through the
contents of a full-text enabled databsae. I have everything set-up and
working using FREETEXTTABLE.

Here is what I want to do. When a user types in a search phrase that
has a couple words in quotes, I want it to do an AND for those instead
of the normal OR that freetexttable seems to do. Is there something
built into SQL Server that can handle this or do I need to parse the
phrase myself and build up some sort of logical operation with the
words and a combination of AND's and OR's. Has anyone done this or
have freeware that handles it or any suggestions at all.

Thanks in advance for any help.FREETEXTTABLE doesn't match exact words, so if you need that
functionality you'll probably need to check out CONTAINSTABLE as well.
>From what little I know of fulltext searching, there seems to be very
limited support for variables and parameters, so you might find you
have to build up your queries yourself. Having said that, it would
probably be worth posting to microsoft.public.sqlserver.fulltext to see
if people there have more specific advice.

Simon

Wednesday, March 21, 2012

Front end website full-text search

I have a front-end search set up that takes the users input and runs a
stored procedure that uses FREETEXTTABLE to get the results. I want it
so that when a user types in a search that has words grouped together
inside quotes (i.e. "sql server") it does an AND instead of an OR. I
know that CONTAINSTABLE can have this kind of logic but I was wondering
if there is a way to handle this without having my script (ASP)
building the search phrase by parsing the user input.
Any ideas? Or has someone done this and have some advice.
Thanks.
But if it does an AND it will not be the same as "sql server" which searches
for the two words occurring adjacent to each other.
Here is a proc which you can set whether you want the entire phase, an OR,
or an AND.
CREATE PROCEDURE SearchSQL (@.stringin varchar(200), @.BooleanType int= NULL)
AS
-- a @.boolean type of null means a phrase based search
-- a @.boolean type of 0 means an OR type search
-- a @.boolean type of 1 means an AND type search
DECLARE @.holdingString VARCHAR(2000)
DECLARE @.whitespace INT
DECLARE @.boolean VARCHAR(10)
--returning a syntax message if no search phrase is passed
IF LEN(@.stringin)=0
BEGIN
PRINT 'usage is SimpleSQLFTSSearch ''Your Search Phrase goes here'''
RETURN -1
END
SET @.boolean=case WHEN @.booleantype=1 THEN char(34)+' OR ' + char(34)
WHEN @.booleantype=2 THEN char(34)+' AND ' + char(34)
ELSE ' ' END
DECLARE @.counter INT
DECLARE @.posold int
DECLARE @.posnew int
SET @.holdingstring='SELECT * FROM authors AS a JOIN
CONTAINSTABLE(authors,*,'''+char(34)
SELECT @.whitespace=LEN(@.stringin) - LEN(replace(@.stringin,' ',''))
SELECT @.posold=0
SELECT @.posnew=Charindex(' ',@.stringin)
WHILE @.whitespace >=0
BEGIN
IF @.whitespace=0
BEGIN
SELECT
@.holdingString=@.holdingString+SUBSTRING(@.stringin, @.posold+1,LEN(@.stringin)-@.
posold+1)+char(34)+char(39)+',200) AS t ON '
END
ELSE
BEGIN
SELECT @.holdingString = CASE WHEN LEN(SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1))>0 THEN @.holdingString+SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1)+@.boolean ELSE @.holdingstring END
SELECT @.posold=@.posnew, @.posnew=Charindex(' ',@.stringin, @.posold+1)
END
SELECT @.whitespace=@.whitespace-1
END
SELECT @.holdingString = @.holdingString + 't.[KEY]=a.au_id ORDER BY RANK
DESC'
--PRINT @.holdingstring
EXEC(@.holdingstring)
RETURN @.@.rowcount
Usage is:
DECLARE @.returncode int
EXEC @.returncode=SearchSQL 'this is a test'
PRINT @.returncode
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"JT" <jtreuting@.gmail.com> wrote in message
news:1112316885.228212.171380@.f14g2000cwb.googlegr oups.com...
> I have a front-end search set up that takes the users input and runs a
> stored procedure that uses FREETEXTTABLE to get the results. I want it
> so that when a user types in a search that has words grouped together
> inside quotes (i.e. "sql server") it does an AND instead of an OR. I
> know that CONTAINSTABLE can have this kind of logic but I was wondering
> if there is a way to handle this without having my script (ASP)
> building the search phrase by parsing the user input.
> Any ideas? Or has someone done this and have some advice.
> Thanks.
>

from sql2005express to sql2000 & vice versa

My asp.net website is using sqlexpress2005. I am planning to use sql2000 with this existing website. My questions:

1. How can I transfer the database definitions and actual data from 2005 to 2000? is this possible?
2. What if I have exisiting database in sql2000, can I convert it to be used in sql2005?
3. should I manually recreate the database when converting from one version of sqlserver to another? and how abt the actual data?

PLS HELP. big thanks!

There are lots of options and lots of caveats...

When a SQL2000 database is attached/touched by a SQL 2005 instance it can not easy be moved back. To go from SQL2000->SQL2005 its as simple as back/restore or detach, move file, attach.

Moving data from one place there are lots of options, DTS is probably the easiest but it is not included in SQL2005 express, but it is included in full SKUs of SQL 2000 and the dev edition of SQL 2005.

Its also possible to use scripting to move meta data definitions, a 2000 script should work really easily with 2005, going back the other way is harder and there will be some enhancements coming in a future service pack of SQL Server 2005 to make the generate script wizard more useful here.

|||thanks for the info man! :)sql

Monday, March 19, 2012

From local to Inet server

Hi..

First of all im a super newb in asp.net and MSSQL.
I had a guy program a website with database, but the guy just stood me up and left me with the files and the server as a file.

Now I need to get them online and working.

The files are FTP on the server so I "just" need the server running

I got the following files:

Justgeek_data.mdf and Justgeek_log.ldf

The server admin interface is:myLittleAdmin.

Any walktrough help or simular would be highly appreciated.

The web is:http://www.bodyplanning.dk

have alook at SQL Server "attach database" process on MSDN

http://msdn2.microsoft.com/en-us/library/ms190794.aspx

|||

Got the database up and running but still errors:

Main page:http://www.bodyplanning.dk/default.aspx

Sub pages:

http://www.bodyplanning.dk/frmLogin.aspx

|||

It is likley that there is a user set up in the database, which also needs to exist at the global level in SQL Server.

Look in Security/Logins in SQL server, then add any users in the database you have attached, and set the passwords.

In the web.config file for the site, ensure that the usernames and passwords match up

Friday, February 24, 2012

Free CVT for SQL Server Database Admin.

Hi all,

Is there any website provides free CVT for SQL Server Database Admin .

What do you mean by CVT? If you're talking about training, that's here:

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

http://msdn.microsoft.com/vstudio/express/beginner/

http://www.microsoft.com/sql/techinfo/default.mspx

And here are some more:

http://www.eggheadcafe.com/videodemo/default.asp

|||

Hi,

Thanks alot man.

sorry That is CBT not CVT. mean Free Video Series for SQLserver Enterprise edition for DBA. As like ur url http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx ( this is SQL Server 2005 Express Edition for Beginners) but i need SQL Server (2000/2005) Enterprise Edition for DBA.

i waiting for ur replay......

Free CVT for SQL Server Database Admin.

Hi all,

Is there any website provides free CVT for SQL Server Database Admin .

What do you mean by CVT? If you're talking about training, that's here:

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

http://msdn.microsoft.com/vstudio/express/beginner/

http://www.microsoft.com/sql/techinfo/default.mspx

And here are some more:

http://www.eggheadcafe.com/videodemo/default.asp

|||

Hi,

Thanks alot man.

sorry That is CBT not CVT. mean Free Video Series for SQLserver Enterprise edition for DBA. As like ur url http://msdn.microsoft.com/vstudio/express/sql/learning/default.aspx ( this is SQL Server 2005 Express Edition for Beginners) but i need SQL Server (2000/2005) Enterprise Edition for DBA.

i waiting for ur replay......