Posts

Showing posts from January, 2012

Notes from Pluralsight course - SQL Server Questions and Answers

In the Pluralsight course "SQL Server Questions and Answers" , Pinal & Vinod debunk some SQL Server misconceptions with examples and highlight uncommon facts - Use SCOPE_IDENTITY() instead of @@IDENTITY or IDENT_CURRENT("tablename") to get the latest IDENTITY value for the table in the session @@IDENTITY returns the last IDENTITY value produced on a connection SCOPE_IDENTITY() returns the last IDENTITY value produced on a connection (explicity created by you rather than a trigger) and by a statement in the same scope IDENT_CURRENT("tablename") returns the last IDENTITY value produced in a table, regardless of the connection Identity column value can be positive or negative Identity column can be reseeded with DBCC CHECKIDENT command Deleting records from table using DELETE does not reset Identity values whereas deleting records from table using TRUNCATE resets Identity values. TRUNCATE statements are logged and can be part of transaction. Such ...

Explore console.log if you use JavaScript alert extensively for debugging

Image
The JavaScript alert method is something that most web developers use to debug their code. However, now with all popular browsers incorporating Developer tools within them, there are easier ways to debug client-side code. Firebug is an optional add-on for Firefox that adds richer features to those natively available & probably the motivator for browsers to develop their own Developer tools. I guess, it was IE that started using F12 as keyboard shortcut to start up Developer tools and now that's synonymous with Developer tools on almost all browsers. Within the Developer tools, a Console panel exists for executing script statements on-the-fly. You can make use of Console methods to expose information that is flowing through your scripts. The console.log method can be used as an alternative to the obtrusive JavaScript alert method to track what's going on within your code without having to click OK for every dialog box that alert th...