[Solved] Which table contain this data+ SQL

ypercube’s suggestion is exactly correct. Here is an implementation: DECLARE @searchText VARCHAR(100) SET @searchText=”Assumed Life Claims” DECLARE @sqlText VARCHAR(8000) DECLARE @MaxId INT DECLARE @CurId INT DECLARE @possibleColumns TABLE (Id INT IDENTITY(1, 1) NOT NULL PRIMARY KEY ,sqlText VARCHAR(8000)) INSERT INTO @possibleColumns(sqlText) SELECT ‘IF EXISTS (SELECT * FROM ‘ + c.TABLE_NAME + ‘ WHERE ‘ + … Read more

[Solved] SQL Server fragmentation

1.create a table with some GUID as primary Key 2.do inserts and check fragmentation 3.Rebuild check Fragmentation you also can do search like below for more SO Examples sql server fragmentation site *.stackexchange.com simple Demo: create table test1 ( id varchar(255) primary key default newid() ) insert into test1 default values go 100 –check fragmentation … Read more

[Solved] ms sql query on count occurence of words in text column

You could create a table-valued function to parse words and join it to your query against qQuestion. In your schema, I recommend using varchar(8000) or varchar(max) instead of text. Meanwhile, the following should get you started: create function [dbo].[fnParseWords](@str varchar(max), @delimiter varchar(30)=’%[^a-zA-Z0-9\_]%’) returns @result table(word varchar(max)) begin if left(@delimiter,1)<>’%’ set @delimiter=”%”+@delimiter; if right(@delimiter,1)<>’%’ set @delimiter+=’%’; … Read more