dba

Shrink data base SQL Server 2008

HI I have made a maintenance package in that have used shrink database task for specific database, it ran successfully, found slight increase in previous db size. Initial size(129 gb) after running the package(130gb). I am expecting after shrinkning it should shrink? what might be happen? am sure package scheduled to run and check the...

How to create an index for Wildcard search on an Int Column in SQL Server ?

I've got a table with millions of rows. The PK of that table is an Int column. User wants to be able to do wildcard search on rows of that table by that PK. When doing this query the trivial way, it will be horribly slow, as Sql server does an implicit conversion of the column value from int to char in order to apply the wildcard every s...

Database sorting SQL Server

Hi folks! I made a windows app and I need to add a "sort" by selected column. The grid has 4 columns and lot of records (paged of course). The question is: Should I consider to add an index for every column that need sorting in the grid? thanks in advances. Regards ...

Can you create a user-defined INFORMATION_SCHEMA view in SQL Server 2008?

Back in SQL Server 2000, you could create your own custom information_schema views using an undocumented stored procedure called sp_ms_upd_sysobj_category. The trick seems to have been introduced to the world by Ken Henderson in his book, The Guru's guide to SQL server stored procedures, XML, and HTML. I used it to create two handy vie...

Database: Does the appendix 'HX' have significant value?

I'm working with a legacy application with surprise surprise, next to no useful documentation on naming convensions or over all data structure. There are similarly named tables in the database with one of them ending in HX. Does this hold any significance in anyones database experience? The data seems to be replicated so I would assume...

How to automatically move specific MySQL tables from one machine to another?

I have a MySQL database with tables in the form of "shard_0", "shard_1", "shard_2", etc. These are virtual shards. Now I want to add another DB server and move the even-numbered shards ("shard_0", "shard_2", "shard_4", ...) to the new machine. What is the best way to do that? There are many tables so ideally I wouldn't have to type out...