Why I would create another Catalog beside the default one? - sql

I am new to Full Text Search of Sql server. Why I would create another Catalog beside the default one?
I actually don't understand how exactly catalog organize full text indices, I had impression that it is just like a schema to a table. please verify that to me.
Thanks

It appears that it is not possible to add a second Full Text catalog to the same table. On SQL Server 2008R2, once I've added a catalog, the button to add another is disabled:
You can add 2 eligible columns to the same catalog though:
More advice on FTS:
Database Journal - Setting up full text search: A step-by-step guide
MSDN - SQL Server Best Practices - Full Text Search

Related

SQL Server full text indexing not fully updating since table edit

Setup info:
SQL Server 2019 running on Windows Server 2019
Using SSMS to setup full text
Document table
Content column (varbinary); this contains different file types pdf, doc, txt, Excel etc....
Extension column (nvarchar)
I added a column SignTag (nvarchar) to the table and after that is when the problem started happening.
Full text indexing was running fine on our server for a while now, however once the table was edited it stopped adding as much to the catalog.
Before it was sitting around 200k results but after the edit it only shows around 86k which is causing search results to either not have results or not show all results.
Example searching for "overtime" will only bring up one file instead of the four files it used to show.
I have tried a few things:
Disable then enable FTI
Delete FTI then setting it back up (this includes the catalog file)
Clicking full populate, rebuild, and update non of which changed anything.
I am not sure why the full text suddenly stopped collecting as much as it did before the change.
SQL wise nothing has changed the only that one table edit above.
Has anyone else also run into this?
After some digging i found out the Microsoft office filter pack was uninstalled however we never noticed since the index catalog was already built from when it had the pack.
It only showed up now when adding a new column it will rebuild the FTS catalog causing the issue.
With the filter pack missing not all document types are available for FTS which is why we only got 86k instead of the 200k before. Just to name two major file type missing for us. pptx xlsx
Fix:
1: Install Microsoft Office 2010 Filter Packs (64bit for my server)
2: run this query to update sql document types.
EXEC sp_fulltext_service 'update_languages';
EXEC sp_fulltext_service 'load_os_resources', 1;
EXEC sp_fulltext_service 'restart_all_fdhosts';
3: Go to services find SQL Full-text filter daemon launcher(MSSQLSERVER) then right click restart.
4: Tell FTS catalog to rebuild.
After that you can run this query to confirm all document types are added again.
SELECT * FROM sys.fulltext_document_types

Ignoring schema name on sql select?

using SQL server 2014 I am able to select without specifying the schema name when it is NOT DBO.
We are now switching over to SQL 2016 and I am no longer able to select without adding the schema name?
Problem: Going back into each stored proc to add the schema name in would take a lot of time so I was wondering if it is possible to ignore the schema name somehow? I have been searching google but haven't found anything..
The procs are used in our SSRS reports, which there are over 100 and some are embedded into the reports so if there is a way to avoid having to change each one that would be great!
It seems the default schema is a property of the connecting user. Maybe you should check how the new "migrated" user has been defined.

show Create commands for table in SQL Management Studio (2008)

I've just started with SQL Management Studio and I am wondering if I can show create commands for already existing tables, I've been able to do that in Oracle SQL Developer.. I've tried to ask uncle google but maybe used just wrong search command.. Anyway.. could someone give me quick hint as I stuck with this for like 25 minutes?
Thanks
In Object Explorer, expand your server/database, expand Tables, right-click the table in question, and choose Script Table as > CREATE To > New Query Editor Window.
If you want to script multiple tables, you can turn on Object Explorer Details (F7 or from the View menu), highlight "Tables" on the left, then use Shift+ or Ctrl+ to select multiple tables in the right pane (just like you would select multiple files in Windows Explorer). Then you can do the same thing, right-click, Script Table as > ...
If you want to generate script for one table, right click a table and select "Script table as", you get all sorts of options including creating the create script of the table.
If you want to generate scripts for more than one table, you have option
to generate for many at once. Just follow the wizard instructions.

SQL Server 2008 : Cannot Insert new column in the middle position and change data type

My OS is Windows server 2008.
I've already installed SQL Server Express 2008.
I have several problems:
I can't insert a new column in the middle position. If I insert in the last one, I can save the table design.
I can change the column name but I can't change the data type.
I got error message :
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent saving changes that require the table to be re-created.
Example:
I have ID, Name, Phone, and Status columns. I am unable to add Address between Name and Phone.
But, I can add Address if i place it after Status.
Is there any way to solve this problem?
Thanks before.
In SSMS Tools -> Options -> Designers you would need to uncheck the option "Prevent Saving Changes that require table re-creation" to allow you to do this in SSMS.
This will rebuild the table and so generally isn't worth the hassle if the table is at all large and will make deployment to production trickier.
If there are columns which logically you would prefer to have next to each other to make writing queries easier you can create a View with the desired column order.
Column order doesn't matter either in the designer or in sys.columns.
The on disk storage will be the same regardless: Inside the Storage Engine - Anatomy of a record.
There is no performance benefit either.
I think using query it's not possible, but you do using UI of SSMS. right click on selected table and Insert Column whenever you want.
Think it does not matter columns order.
If you want a script to do this, all you need to do is select the data out into a temporary table, drop the table, recreate it with the columns in your preferred order and then reinsert the data from the temporary table in the right order.

How do I use SQL to Drop a Column from a MS ACCESS Database if that column is a replication ID?

I had a notion to use a database column of type replication ID, but have since changed my approach and want to use this column for another purpose.
However, I'm unable to use SQL to drop the column to remove it from my database.
My SQL is:
ALTER TABLE foo_bar DROP COLUMN theFoo;
However, I get a "syntax error" and I'm assuming this has something to do with this column being a replication ID.
I'd rather not download the file and edit it directly using the MS Access application, but not sure if that's my only recourse.
Thanks so much in advance.
Regards,
Kris
If you have access to the database in a command shell, Michael Kaplan's Replication System Removal Fields utility should do the trick. However, I've found that in some circumstances, it's unable to do the job. Also note that the utility will only work with a Jet 4 format database (MDB), not ACE format (ACCDB).
If all else fails, you can recreate the table structure and append the existing data to it. That can get messy if you have referential integrity defined, though, but it will get the job done, and likely most of it is scriptable (if not all possible using just DDL).
Here is a link that may help you, I had a similar idea but when browsing the web found this
AccessMonster - Replication-ID-Field-size
EDIT: Well I don't have much time but what I was thinking of first was if you could alter the column to make it different (not a replication ID) and then drop it. (two separate actions). But I have not tested this.