Skip to main content

Posts

Showing posts from March, 2011

I'm not an Idiot. Are you?

I heard my PM saying today "Their are two types of Idiots. One who will take multiple trips to the database to compare value. Others who will take the values in memory and compare then their". We have a situation. We need to take values from one table and check if it exists in the second table. Depending on weather it exists in the second table or not, we need to display with / without highlight it in the datagrid. There is one catch. The query is written by the user in one of the application screen and the user has no idea that the 2nd condition table needs to be applied. I know you would debate that we need to create a screen, so that the user will select what is required instead of writing the query. I know... but we need this asap. Screen will be in the next release. Let me elaborate: Consider that we have table A and table B. Both these tables have ID column. The user writes (on the application screen) SELECT * FROM A   I can check that this ID does not exist in

Activity Monitor in SQL

Activity Monitor is new tool in SQL Server which displays activity in five sections. 1) Overview, 2) Processes, 3) Resources Waits, 4) Data File I/O, 5) Recent Expensive Queries. It is one of the new and very useful tool introduced by SQL Server. Activity Monitor captures all the information at server level. To start Activity Monitor: From Standard Toolbar (Standard Toolbar can be made visible from here : Menu >> View >> Toolbar >> Standard) and from “Right Click” on SQL Server Node and select Activity Monitor If on starting activity server you do not see any info , then give the “View Server State” permission to user name to view data of Activity Monitor. We can give permission either using T-SQL or using SSMS. T-SQL to give permission to user to view Activity Monitor: GRANT VIEW SERVER STATE TO <username> SSMS to give permission to user to view Activity Monitor: Right click on server name -> Properties - > Permissions -> username-&