Showing posts with label automatically. Show all posts
Showing posts with label automatically. Show all posts

Monday, March 26, 2012

Gaps in my key ID field

Greetings,

I am new to SQL Server. I've created a database with a key ID field that is set to automatically increment. Well, after adding records I've got some gaps in my numbering and want to renumber from 1 to eof.

What is the best way to do this in SQL Server 2005?

Thank you.

I have covered it in the thread below. Hope this helps.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2072438&SiteID=1

|||Thank you!|||

Elizabeth Davis wrote:

Thank you!

I am glad I could help.

Friday, February 24, 2012

fulltext search in sql express 2005

I had problem when change database from sqlserver 2000 to sql express 2005.

The fulltext index does not create automatically.

Example:

i use sqldatasource to insert new name to my table.

and then i find it by query like this : select count(*) from mytable where contains(mycol,'newname')

the result is 0

but if i run query to start full index : exec sp_fulltext_catalog 'myfulltext','start_full' and run query

select count(*) from mytable where contains(mycol,'newname')

again. The result is 1.

So i alway run exec sp_fulltext_catalog 'myfulltext','start_full' after insert or update, delete to create fulltext index. When i use sql server 2000 , i didn't need do that, it automatic.

Pls help me !!! how to make fulltext index create auto in sql express 2005 .


You need to set "Change Tracking" to automatic.

The index update will not be instantaneous, but it will be automatic.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=680500&SiteID=1

http://technet.microsoft.com/en-us/library/ms187317.aspx

Full-text search does not automatically update index when CHANGE_TRACKING AUTO

On Sql Server 2005 Standard if I insert a new row into SomeTable that has a full-text index:

insert SomeTable(keywords)values('this is a test')

and then query:

SELECT * FROM Message WHERE Contains(keywords, ' "test" ');

I get the expected rows all rows that have "test" in the keyword.

On Sql Server 2005 Express new rows are not returned unless I rebuild the catalog.

Is this a known limitation of Express?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CREATE TABLE [dbo].[SomeTable](
[key] [int] IDENTITY(1,1) NOT NULL,
[keywords] [nvarchar](255) NOT NULL
CONSTRAINT [PK_SomeTable] PRIMARY KEY CLUSTERED

CREATE FULLTEXT CATALOG ft AS DEFAULT;

CREATE FULLTEXT INDEX ON [dbo].[SomeTable] KEY INDEX [PK_SomeTable] ON [ft] WITH CHANGE_TRACKING AUTO
ALTER FULLTEXT INDEX ON [dbo].[SomeTable] ADD ([keywords])
ALTER FULLTEXT INDEX ON [dbo].[SomeTable] ENABLE

Are you rebuilding the catalog everytime to get the new rows?