Skip to content

Instantly share code, notes, and snippets.

Darshan Joshi joshids

Block or report user

Report or block joshids

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshids
joshids / per database table size
Created Sep 27, 2016
Script to calculate table and index sizes for all databases that login has access to.
View per database table size
--sqlserver 2005 +
EXECUTE master.sys.sp_MSforeachdb
'USE [?];
select getdate() as snapdate,serverproperty(''MachineName'') svr,@@servicename sv, ''?'' _dbname, nomTable= object_name(p.object_id),p.partition_id,p.partition_number,
lignes = sum(
CASE
When (p.index_id < 2) and (a.type = 1) Then p.rows
Else 0
END
@joshids
joshids / Fix_Found_shared_references_to_a_collection.cs
Created Jul 27, 2015
How to get "Found shared references to a collection"
View Fix_Found_shared_references_to_a_collection.cs
var coll = new UIRColl();
var u1 = new user();
//u1.uircolllection = coll;
u1.uircolllection = new UIRColl();
u1.uircolllection .AddRange(coll);
var u2 = new user();
//u2.uircolllection = coll;
u2.uircolllection = new UIRColl();
@joshids
joshids / Found_shared_references_to_a_collection
Created Jul 27, 2015
How to get "Found shared references to a collection
View Found_shared_references_to_a_collection
var coll = new UIRColl();
var u1 = new user();
u1.uircolllection = coll;
var u2 = new user();
u2.uircolllection = coll;
session.flush();
You can’t perform that action at this time.