Project Title:
SQL Server Backup Strategy and Dynamic Search Query Optimization for CratesL BoatManager CRM
Client:
Brian Brinks, Canada
Problem Statement:
The client required a reliable backup/duplication system between two SQL Server databases hosted on separate networks (shared hosting). Additionally, the client needed an advanced full-text keyword search feature across five CRM-related tables with custom filter logic based on user input patterns.
Objective:
- a) Develop a script-driven method for duplicating live database content from Server A to Server B.
- b) Implement robust full-text search across multiple tables returning distinct crmClientIDs.
- c) Support advanced keyword handling with search filters like:
1) “a-” (admin/all records),
2) “t-” (tag-specific search),
3) Default (user-specific general search).
- d) Integrate search results with existing stored procedure outputs for consistency.
Tools & Technologies:
- a) SQL Server Management Studio (SSMS)
- b) Microsoft SQL Server (Shared Hosting)
- c) Visual Studio (Schema Compare, Manual Scripting)
- d) T-SQL / Stored Procedures
- e) VPN for Secure DB Access
- f) Dropbox (backup transfer)
Methodology & Execution:
Phase 1: Backup & Duplication Plan
- a) Analyzed limitations of shared hosting (no replication/mirroring).
- b) Used Visual Studio’s schema comparison to duplicate schema.
- c) Manually inserted 2M+ records across key tables (e.g., stats) using batch operations.
- d) Addressed schema conflicts due to different default owners (dbo vs custom).
- e) Created a partial backup solution for lightweight synchronization via .bak files.
Phase 2: Keyword Search Stored Procedure
- a) Designed a flexible procedure: Get_crmClientID_By_MultiSearch
- b) Split input string into keywords using a table-valued function.
- c) Searched across yellow-highlighted columns in 5 tables.
- d) Ensured all keywords must match across any columns/tables.
- e) Added keyword weighting logic to rank more relevant results.
Phase 3: Conditional Filters and Custom Prefix Logic
- a) Created 3 distinct stored procedures:
1) Get_crmClientID_By_ApplicationNuserID_General
2) Get_crmClientID_By_ApplicationNuserID_A (admin/all records)
3) Get_crmClientID_By_Tags (tag-only search)
- b) Input prefix (a-, t-) detected dynamically to redirect logic.
- c) Returned full result sets based on original CRM stored proc s_CRMGetClientListSortedByDateLastEdited.
Results:
| Metric |
Before |
After |
| Redundancy Strategy |
None |
Manual Scheduled Script |
| Search Response Time |
>10s |
<1.5s |
| Supported Keyword Search Depth |
1–2 |
Unlimited |
| Query Accuracy |
Low |
98%+ |
| Total Development Time |
~20 hours |
|
| Total Billed |
$200 USD |
|
Key Challenges:
- a) Schema inconsistencies across shared-hosted databases.
- b) Missing full control due to no FTP access to SQL directories.
- c) Text-search complexity across multiple tables without full-text indexing.
- d) Dynamic parameter handling for filtering by user role and tag conditions.
Outcome:
Successfully implemented a semi-automated database backup solution and built a high-performance SQL search engine for CRM data with multiple filtering modes. The solution was modular and scalable for future enhancements. Client was satisfied and compensated the full amount with the intention of long-term collaboration.
Tags:
SQL Server, T-SQL, Database Replication, Stored Procedure, CRM, Search Optimization, Backup Strategy, Shared Hosting, Keyword Matching, Data Integration