SQL Server 2008 Repopulate Index "Update" Option - sql-server-2008

I have created a single catalog named EntryCatalog. I assigned a table named Entry to the catalog and selected Notes and Title columns (both nvarchar max) with Track Changes set to Automatic.
I did not put anything in the Population Schedule options thinking there has to be some way to have it populate automatically and kind of "manage itself." So in the FTI properties for the Entry table there is an Actions checkbox. I checked that and selected the UPDATE radio button (rather than Incremental or Full) because the docs say "The full-text index is updated whenever the data in the base table is modified." I think that's what I want...does this apply to when inserts are made to the Entry table?
Maybe I'm fundamentally misunderstanding how FTI works. I'm hoping I can just set up a catalog to index the 2 columns in this table and when new records are inserted they are indexed as well automatically. Can this be done, or do you HAVE TO have some kind of scheduling option set up? Is that what repopulating really is?
Thank you.

Well, To implement full-text indexing in SQL Server, you should take the following steps:
Create a full-text catalog, if required.
Create the full-text index.
Modify the list of noise words (SQL Server 2005) or stop words (SQL Server 2008), if necessary.
If required, Modify the thesaurus for the language being used.
"The full-text index is updated whenever the data in the base table is
modified." I think that's what I want...does this apply to when
inserts are made to the Entry table?
Answer: YES
I'm hoping I can just set up a catalog to index the 2 columns in this
table and when new records are inserted they are indexed as well
automatically. Can this be done, or do you HAVE TO have some kind of
scheduling option set up? Is that what repopulating really is?
If I'm not wrong you don't have to any such thing. Things will be managed by SQL Server 2008 automatically. First you need to create Full-Text Catalog and after you create your full-text catalog, you’re ready to create your full-text index. You can then associate the index with the new catalog. Then modify stop words. You are done.
The following link will help you to understand the basic of "Full-Text Indexing in SQL Server".
http://www.simple-talk.com/sql/learn-sql-server/understanding-full-text-indexing-in-sql-server/
Hope this helps!

Related

If I update a SQL table Scheme. Do I have to update all users DBs linked tables?

I updated the SCHEMA of a live table in MySQL for use in my multi-user database. Each user has their own db and links to the production tables through ODBC.
I have been receiving a write error while trying to test my schema updates. I cannot find the core reason. I hypothesized that because the other users are in the production table but have not been relinked to update the table SCHEMA; That it is causing a conflicting write error on my relinked table.
I added a TINYINT with No NULLS and default value of 0
I double checked all datatypes for incompatibility & have tested the "non relinked" tables in a older version of the DB and confirmed it is working as intended with no errors
I expect/want to be able to edit records without a write error, but am hesitant to update the other users to the new table if it is currently having write errors
After changing the schema of a linked table, it's required to refresh the link on all Access databases connected to it.
You can do this on the ribbon through external data -> linked table manager.
Unfortunately, either all users that have a database need to do this manually, unless you automate the task on startup through vba.
You have two separate issues. To "see" new columns, then yes, you must re-link the tables.
(so above is separate question and separate issue). You thus as a general rule can add new columns to the database (even while in use). However, the client side linked tables will not see the new columns until such time you re-link. This approach (adding new columns, but not yet re-linked from Access) is certainly ok and fine - the only downside is end users can't see nor use the new columns until such time you link. From a developer point of view, this good - since your users will not see nor find new columns until such time you roll out a new front end to each work station.
Ok, now problem and issue number two.
As for adding a new column, then re-linking, and THEN having some issue is really a separate issue. In most cases, if you attempting to use a tiny int as a Boolean (and I think that is your case), then you need to ensure several things:
Do not allow nulls (you seem to have this ok).
Make sure you set a default of 0 (server side) for this column. (you might have not allowed nulls, but without a default, then Access likely will still complain. And this default is important during creating time - since the new column needs to be "filled" with zeros.
Make sure the table has a PK defined.
Consider adding a row version column (I think mySQL has these, not sure but they can help immensely).

How to manage schema changes on many identical schema-based databases with mysql?

I'm developping a web platform to manage student registrations in schools of my region. For that I have 17 databases running on MySQL (5.7.19) where there is one which is the main database and the 16 others represent schools. Schools databases (must) have the exactly the same schema, each containing data corresponding to the associated school. I separated this way to avoid latency as each school can register many applications (16k on average), so the requests could get heavier over time.
Now I have a serious problem: when I change the schema of a school's database, I have to manually do it for those of other schools to keep the schema consistency because my sql requests are made independently of the school. For example, if i add a new field in table_b of database_school5, i have to manually do the same on table_b of all remaining databases.
What can I do to manage theses changes efficiently? Is there an automatic solution? Is there an adapted DBMS for this problem?
Somebody told me that PostgreSQL can achieve this easily with INHERITANCE, but this only concerns the tables, unless I've done some poor research.
I want every time I make a change to a database schema, whether it is adding a table, adding a field, removing a field, adding a constraint, etc., the changes are automatically transferred to the other databases.
Thanks in advance.
SELECT ... FROM information_schema.tables
WHERE schema_name LIKE 'database_school%'
AND table_name != 'the 17th table'
AND schema_name != 'database_school5' -- since they have already done it.
That will find the 16 names. What you put into ... is a CONCAT(...) to construct the ALTER TABLE ... statements.
Then you do one of these:
Plan A: Manually copy/paste those ALTERs into mysql commandline tool to perform them.
Plan B: Wrap all of it in a Stored Procedure that will loop through the results of the SELECT and prepare+execute each one.

How to retrieve the definition behind statistics added to tables

In Sql Server, is there a way to progra-matically retrieve the definition of each STATISTICS added to table columns (and indexes). For both user added and system created indexes. There are many STATISTICS like '__WA_Sys_*' that are added by Sql Server.
I need to re-write some of them and add more. But there are too many to do them manually with Management Studio.
Thanks,
_UB
I don't really understand what you want to do, but the SMO Statistic class lets you create and manipulate statistics. From TSQL, there are several relevant views and procedures: sys.stats, sys.stats_columns, DBCC SHOW_STATISTICS, CREATE/UPDATE STATISTICS etc.
If by 're-write' you mean 'update' then UPDATE STATISTICS would be the place to start.

Is it possible to change a database table's engine after the table has been created?

I created a test database for a CakePHP tutorial I'm working through, and just used phpMyAdmin's default settings for the engine (MyISAM.) Now that I'm several days into the tutorial, it indicates that to use some of the features, the tables need to use InnoDB.
Is it possible (either in phpMyAdmin itself or via a SQL file import) to change the tables' engine choice after they've already been created? They currently have data in them, but it's only a few records each so I don't care if I have to empty the tables out. I just don't want to have to completely recreate the tables, if at all possible.
I can't seem to find any way to do this in phpMyAdmin - the only place I can find a choice of engines is when I'm creating a brand-new table.
EDITED TO ADD SCREENSHOT AFTER RUNNING QUERY:
Use this query:
ALTER TABLE my_table ENGINE = InnoDB;
where "my_table" is your table name.
In phpMyAdmin, navigate to the table and click the "SQL" tab at the top. Then paste the above query and click "Go/Execute".

How to version control data stored in mysql

I'm trying to use a simple mysql database but tweak it so that every field is backed up up to an indefinite number of versions. The best way I can illustrate this is by replacing each and every field of every table with a stack of all the values this field has ever had (each of these values should be timestamped). I guess it's kind of like having customized version control for all my data..
Any ideas on how to do this?
The usual method for "tracking any changes" to a table is to add insert/update/delete trigger procedures on the table and have those records saved in a history table.
For example, if your main data table is "ItemInfo" then you would also have an ItemInfo_History table that got a copy of the new record every time anything changed (via the triggers).
This keeps the performance of your primary table consistent, yet gives you access to the history of any changes if you need it.
Here are some examples, they are for SQL Server but they demonstrate the logic:
My Repository table
My Repository History table
My Repository Insert trigger procedure
My Repository Update trigger procedure
Hmm, what you're talking about sounds similar to Slowly Changing Dimension.
Be aware that version control on arbitrary database structures is officially a rather Hard Problem. :-)
A simple solution would be to add a version/revision field to the tables, and whenever a record is updated, instead of updating it in place, insert a copy with the changes applied and the version number incremented. Then when selecting, always choose the record with the latest version. That's roughly how most such schemes are implemented (e.g. Wikimedia does it pretty much this exact way).
Maybe a tool can help you to do that for you. Have a look at nextep designer :
https://github.com/christophefondacci/nextep-designer
With this IDE you will be able to take snapshots of your database structure and data and put it under version control. After this you can compute the differences between any 2 versions and generate the appropriate SQL that can insert / update / delete your data.
Maybe this is an alternative way to achieve what you wanted.