[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=”%”[email protected]; if right(@delimiter,1)<>’%’ set @delimiter+=’%’; … Read more