select unique characters of a column in sql server ...
select distinct [Character], unicode([Character]) as Value from ( select substring(ColumnName, v.number + 1, 1) as [Character] from ( select * from TableName ) ibm join master..spt_values v on v.number < len(ColumnName) where v.type = 'P' ) temp order by [Character]
developer are essentially gods
Gods are creators. They create things, and to create they need power. The more power they have, the more they can turn their will into the final product and creation. That's a simple formula of being a god. If you're a mighty god, you will/wish/desire/intend something to come into the existence, and that thing comes into the existence. Developers are just like gods. Because they create things, which in their cases are software and applications. I believe that a good framework/utility ...
my company rules
You can't make employees happy, unless their lives become happy. I don't like to be judged, thus I should not judge other people.
sql server index disk usage statistics
select object_schema_name(i.[object_id]) as [Schema], object_name(i.[object_id]) as [Table], i.name as [Index], sum(used_page_count) * 8 AS [KiloBytes] from sys.indexes i join sys.dm_db_partition_stats p on p.object_id = i.object_id and i.index_id = p.index_id where [type] = 2 and object_name(i.[object_id]) not in ('sysdiagrams') and i.[object_id] in ( select [object_id] from sys.tables where [type] = 'U' ) group by i.[object_id], i.name order by [Schema], [Ta ...
select random record in sql server
select top 1 * from TableName order by NewID()
names are not the reality
What was there, before we call it "Sun"? That's a fundamental question I have in mind. Sun existed, thousands, if not millions of years, before we even create language. So, "Sun" is not real, but the object that is being referred to as "Sun" is real. "Sun" is subjective to our mind, and the star that is in the middle of the Solar System, is objective, thought we still used other names to point to it. So, let's not forget that names are just "handles" that we attach to objects the we comprehend ...
some useful shortcuts in windows
Ctrl + Alt + N => create a new folder in Windows Explorer Ctrl + N => New file Ctrl + T => New tab (specially in browsers) Ctrl + C => Copy something Ctrl + V => Paste something Ctrl + X => Cut something Ctrl + Z => Undo something Ctrl + Y => Redo something Windows + E => Opening a new Explorer window (E means explorer) Windows + L => Locking Windows (L means lock) Windows + D => Showing desktop (D means desktop) Windows + R => Run window (R ...
stuff about betrayal
I saw betrayal, and these things that I found on the Internet helped me understand it, so that I could move on. I hope it can help something else too. There is perhaps no greater insult to relationship than betrayal. Betrayal robs us of a sense of security. Someone close to us has proven untrustworthy. Most of us have felt the sting of betrayal; likely most of us have even inflicted it. So what do we do about it? There are obvious dangers in not overcoming the pain betrayal cause ...
music and predictability
I believe that we enjoy order. It's just a belief, based on phenomenological analysis (inductive reasoning) of my personal experiences. I define order as the power of predictability. Symmetry and periodicity are two of the most ordered systems. Yet an ordered system is not necessarily symmetric, or periodic. It however should be highly predictable, which denotes the fact that we should be able to formulate it. When we say predictability, it encompasses relativism. In other words, something tha ...
sql server row count of each table
declare @table table ( TableFqn nvarchar(100), RowsCount int ) declare @tableFqn nvarchar(100) declare @query nvarchar(max) declare @tableRowsCount int set @tableRowsCount = 0; declare @allRowsCount int set @allRowsCount = 0; declare tablesCursor cursor for select quotename(object_schema_name([object_id])) + '.' + quotename(name) from sys.tables order by object_schema_name([object_id]), name open tablesCursor fetch next from tablesCursor into @tableFqn while @@fe ...