sql server table value constructor
Instead of: declare @table table ( Id int not null, Name nvarchar(100) ); insert into @table values (1, 'saeed'); insert into @table values (2, 'hamid'); select * from @table; You can write: declare @table table ( Id int not null, Name nvarchar(100) ); insert into @table values (1, 'saeed'), (2, 'hamid'); -- This is called table-value-constructor select * from @table; Even better than that: select * from ( values (1, 'saeed'), (2, 'h ...
change management two dimensions
I do believe that any change management has these two dimensions, alongside other dimensions it might have: Cost of change + impact of change That is, a change might be very cheap (like changing the name of a table in database), but its impact can propagate to many code files, even affect the name of methods in classes to reflect the new name of the table, which in turn initiate another change wave. This can be called change-chain. In the other extreme, a change might be very expensive a ...
- painting of my niece parimah
sql server merge
merge Students s -- this table is our target using TempStudents ts -- this table is our source of data on s.FullName = ts.FirstName + ' ' + ts.LastName -- any join clause when matched then update set t.Age = ts.Age when not matched by target then insert (FullName, Age) values (ts.FirstName + ' ' + ts.LastName, ts.Age) when not matched by source then delete ;
clean code and gordian knot
The process of turning a smelly hairy complicated code into a clean code, is just like trying to open untie a Gordian knot. It's a slow, step by step process which might work in 90% of times, and of course in some circumstances may leave you frustrated and angry. Take these steps: Correct naming as much as you can, wherever you find them. Make names more deductive and more understandable. Extract simple block of codes into well-named methods. Give conditional statements good names and e ...
putting evelutionism and creationism together
The fact now is: Evolutionism stands in front of creationism The question is: Can we make them go alongside? Can we merge them? Do they not overlap, but complement each other? Some thoughts in my mind say: Maybe creationism precedes evolutionism. That is, maybe universe first created (in a tiny superhot point), alongside some formulas for it that never changed over billions of years, and then evolutionism took place over those formulas to create what we see today, and what exis ...
applications you have to have on your server
These applications all are must to have on any Windows server: WinDirStat 7 Zip Beyond Compare Everything Notepad++
the true value of hisotry
For years I was wondering what could be the real value of the history classes and history books. I could see that as a human beings, we could extract patterns out of it, and try to predict future based on those patterns in an inductive approach. But it wasn't enough for me to consider it a valuable thing. This went on till I watched the Cosmos, a Space Time Odyssey, and only then I think I found the true value of history. The true value of history is: To inspire people for the future. T ...
constellations and gestalt movement
We know that our ancestors have drawn many constellations over stars in clear night sky. Some of them believed to be Gods. Recently I saw a movie in which tens of these constellations were shown, and the more I looked, the less I found out a clear relationship between stars, and the final shape. I think here, Gestal movement is in flow. That is, stars are so abundant in a clear sky night, that you can connect them however you like to form your favorite shape. Just try your imaginations on this ...
why i hate some development tools
SQL Prompt from RedGate won't show column nullability in its intellisence, while SQL Server shows that.