only My site

Friday, December 30, 2011

Search Center & Search Control Related Topics

http://sharepointlogics.com/2009/02/creating-scope-and-tab-for-moss-search.html

http://waelmohamed.wordpress.com/2011/05/31/add-custom-search-properties-in-your-advanced-search-sharepoint-2010/

http://dhondiyals.wordpress.com/2010/03/07/steps-to-search-a-specific-custom-list/

http://sharepointgeorge.com/2010/configuring-enterprise-search-sharepoint-2010/

http://sharepointsearch.com/cs/blogs/sanjaya/archive/2009/06/12/create-and-configure-a-scope-to-return-only-documents-in-search.aspx

Signing PowerShell Scripts

http://www.hanselman.com/blog/SigningPowerShellScripts.aspx

Sunday, December 11, 2011

SharePoint 2010 Search - Server Name Mapping

SharePoint 2010 - MySites

Working with the User Profile DataSource Parameter

Sharepoint 2010 - Search Scope config

Sharepoint 2010 - Search Shared Folders/Files

Sharepoint 2010 - Search Concepts

Sharepoint 2010 - Search




The following are some of the basic Search features in SharePoint 2010

  • Cast a wider net through the use of built-in wildcard search functionality (wildcard searches were not possible previously)


  • Narrow down the list of search results a lot faster with the metadata-driven refinement panel (based on managed properties, like author, file type, create data, and update date)


  • Add your own metadata property mappings and make them part of search result refinement options


  • Enjoy an easier to use and more powerful query syntax - use AND, NOT and OR in your search queries


  • Scale your search and index up to 10 million items with sub-second response times (3 million was the limit previously)


  • Receive helpful "Did you mean?" suggestions for misspelled queries

  • Thursday, November 24, 2011

    Wednesday, November 2, 2011

    Sharepoint - Application page with Codebehind

    <a href='http://www.microsoft.com/?from=mscomsharepoint&videoId=b6cc2714-9476-445d-9486-2caa5c333ff8&src=v5:embed::uuids' target='_new' title='Creating an Application Page in Windows SharePoint Services 3.0' >Video: Creating an Application Page in Windows SharePoint Services 3.0</a>

    Sharepoint - Custom Filter webpart

    <a href='http://www.microsoft.com/?from=mscomsharepoint&videoId=88d70f1b-f131-434b-9ae6-92c4ca6e47fc&src=v5:embed::uuids' target='_new' title='Writing a Filter Provider Web Part for Windows SharePoint Services 3.0' >Video: Writing a Filter Provider Web Part for Windows SharePoint Services 3.0</a>

    Workflow - Initiation and Association Form

    <a href='http://www.microsoft.com/?from=mscomsharepoint&videoId=4f09c35e-38ab-44e6-bf4d-67a7414a2b1b&src=v5:embed::uuids' target='_new' title='Accessing Data from Workflow Association and Initiation Forms in Windows SharePoint Services 3.0' >Video: Accessing Data from Workflow Association and Initiation Forms in Windows SharePoint Services 3.0</a>

    Integrating ASP.NET App in Sharepoint

    <a href='http://www.microsoft.com/?from=mscomsharepoint&videoId=220408a4-e927-4bd1-9457-08e2d40eadca&src=v5:embed::uuids' target='_new' title='Deploying ASP.NET Web Applications in the Windows SharePoint Services 3.0 _layouts Folder' >Video: Deploying ASP.NET Web Applications in the Windows SharePoint Services 3.0 _layouts Folder</a>

    Wednesday, October 12, 2011

    Tuesday, October 11, 2011

    Wednesday, September 14, 2011

    .NET Good URLs

    http://wiki.lessthandot.com/index.php/ASP.NET_Hacks

    Entity Framework 4.1 - Code First

    The Entity Framework 4.1 includes two new main features: DbContext API and Code First.

    The DbContext API is a simplified abstraction over the existing ObjectContext type and a number of other types that were included in previous releases of the Entity Framework. The DbContext API surface is optimized for common tasks and coding patterns. Common functionality is exposed at the root level and more advanced functionality is available as you drill down through the API.

    Code First is a new development pattern for the Entity Framework that provides an alternative to the existing Database First and Model First patterns. Code First lets you define your model using CLR classes; you can then map these classes to an existing database or use them to generate a database schema.

    Source : http://www.sandeepsachan.com/

    Tuesday, September 13, 2011

    Thursday, September 8, 2011

    P2P

    PC Assembling



    Items required to assemble the PC.

    1. Case & power supply
    2. CPU - Processor (AMD or Intel)
    3. CPU Coolers and Case Fans
    4. Mother board
    5. Video card
    6. Sound Card
    7. Card reader
    8. LCD Monitor
    9. RAM - DDR, SDR
    10. HDD
    11. Optical drive - DVD
    12. Mouse-KB-Speaker-Printer

    http://www.mysuperpc.com/build.shtml

    Wednesday, September 7, 2011

    Risk Management - Vocabularies

    Critical event
    Corporate governance
    – CG relates to how well the company is managed – Good corporate governance, is about Responsible and Transparent decision making and Leadership.
    Ex : Good corporate governance is especially important in times of Economic Instability.

    Compliance – Following rules, regulations and laws is compliance.
    Eg : Our lawyers have reviewed the contract to ensure that we are in full compliance with Industry regulations.

    Due Diligence
    When we do all the necessary research before make a decision or signing a contract, we are performing due diligence
    Due diligence might show that people were not honest about profit or potential risk
    Ex: Before buying a business, you must perform due diligence on both business and seller.

    Exposure – In Risk management, exposure is about how much risk you face.
    High exposure means you face a lot risk and a potential damage.

    Risk appetite – The amount of risk or level of exposure, that a company is willing to accept is its risk appetite.
    Ex : people or company with a high risk appetite such as venture capitalists, usually anticipate great future profit.

    Public scrutiny – Scrutiny is close examination or study
    Ex: After scandals in companies such as Enran, corporate accounting is subject to much greater public scrutiny.
    Diagnose – When we diagnose the problem, we find the cause or reason for the problem.
    Critical Incidence Analysis- Is a set of techniques that are used to find and solve the problems in a company, a process or a System.
    Ex: CIA has provided our company with the tools to deal with big problems when they happen.

    Volatility

    Natural disaster

    External and Internal Risks
    There may be a risk management strategy for the organization as a whole, which attempts to account for External and Internal risks to the company.
    Ex
    External risk – Global Economic condition / Competitor
    Internal risk – Problem employees / Budget overrun.

    Project Appraisal

    When you examine a project to figure out whether Good or Bad, Risk or safe, you are doing Project appraisal.
    Conducting project appraisal will help a company determine which project or product will make money.

    Predict / foresee – To predict or foresee is to look into the future and try to guess what will happen. Ex : Smart investors try to predict the changes in the market before they happen.

    Hazard - The specific situation that might cause damage or harm to the company in future are called Hazards.
    Ex : Employee dissatisfaction / Product failure / Increased competition.

    Avoid Risk – Ex avoid invest in a particular country

    Transfer Risk – When we share or give it to another company, we are transferring that risk. Risk transfers almost and always means buying Insurance.

    Mitigate risk - Another way to deal with risk is mitigate it or decrease the potential damage of a risk that can be avoided.
    Ex: Companies use antivirus software to reduce the probability and damage of computer virus.

    Retain Risk : A company may retail or Accept risk if they see the potential from profit or advantages.

    Disclosure : It is showing or revealing Information, usually negative Information about a situation.

    Reputation management : Companies must pay close attention to their public image and what people think.

    Tuesday, August 30, 2011

    JSON & .NET

    using System.Web.Script;

    Employee oEmployee1 = new Employee { Name = "Pini", ID = "111", Age = "30" };
    Employee oEmployee2 = new Employee { Name = "Yaniv", ID = "Cohen", Age = "31" };
    Employee oEmployee3 = new Employee { Name = "Yoni", ID = "Biton", Age = "20" };

    List oList = new List() { oEmployee1, oEmployee2, oEmployee3 };

    Serialization.JavaScriptSerializer serializer = new Serialization.JavaScriptSerializer();

    string jsonString = serializer.Serialize(oList);
    List oListNew = new List();

    oListNew = serializer.Deserialize>(jsonString);
    //ser.Deserialize(new StreamReader(response.GetResponseStream()).ReadToEnd());

    Saturday, August 20, 2011

    Thought of the day

    There are two forces in the world. one is to keep them top and make others suppress. these force will not recognize and accept the other one. This makes the world unbalanced and this is the cause for the instability in the universe. One have more than they required, and others don't have the basic needs...If you watch the world politics this situation is common across the world.

    Oh God! Make the world better place to live in.

    Tuesday, August 16, 2011

    JQuery - Found Solution for Nested Droppable items

    http://www.designerstalk.com/forums/programming/64268-jquery-droppable-div-created-fly-not-working.html#post777326


    $(".myDropClass").droppable(
    {
    accept: '.myDragClass',
    drop: function (event, ui) {
    //remove old item
    alert('Dropped');
    $(this).find(".myDragClassPlaceHolder").remove();

    var listHtml = "
  • " +
    "
    " +
    "New Droppable area" + ui.draggable.text() + "
  • ";
    alert('Added1');
    $(this).append(listHtml);
    alert('Added');
    $(this).find('#ontheflyDiv').droppable({
    drop: function(event, ui)
    {
    alert('Set the droppable behavior to the newly created element');
    $(this).append("hello");

    }
    });

    }
    });

    Wednesday, June 22, 2011

    SharePoint Industry Requirement

    1. In depth understanding of the capabilities of Microsoft Office SharePoint Server 2003/2007/2010 and SharePoint Designer.
    2. Knowledge must include architectural design, web parts, management and troubleshooting with a focus on planning, deploying and supporting enterprise SharePoint implementations.
    3. In depth experience with Collaboration, Portals, Enterprise Search, Enterprise Content Management, Business Process and Forms, and/or Business Intelligence.
    4. SharePoint experience must include SharePoint Designer workflows, effective use of the data view web part , content query web part, data form web part, navigation customization, and some branding customization.
    5. Experience with SharePoint templates (site templates, list templates, master page customization) is required.
    6. Experience configuring and working with Microsoft Internet Information Server (IIS) and SQL Server 2005 is required.

    Thursday, June 16, 2011

    Event Receiver Error Handling - Redirect

    http://msdn.microsoft.com/en-us/gg620547

    http://gopinathonline.com/post/SharePoint-Event-Receivers-Redirect-to-Custom-Page-or-URL-from-Item-Events.aspx

    Saturday, May 21, 2011

    MSSQL T-SQL DB Table column info



    select distinct

    TBL.name as TableName,

    COL.Name as ColumnName, TYP.name as Type, COL.max_length as Length,

    COL.precision as Precision, CASE COL.is_nullable WHEN 1 THEN 'Null' ELSE 'Not Null' end as 'Null' from sys.columns COL

    inner join sys.objects TBL on COL.object_id= TBL.object_id

    inner join sys.types TYP on TYP.system_type_id= COL.system_type_id

    where TBL.type ='u' and TBL.name != 'sysdiagrams'

    and TYP.name !='sysname' order by

    TBL.name,

    COL.name





    select

    distinct

    --TBL.name as TableName,

    COL.Name as ColumnName, TYP.name as Type, COL.max_length as Length,

    COL.precision as Precision, CASE COL.is_nullable WHEN 1 THEN 'Null' ELSE 'Not Null' end as 'Null' from sys.columns COL

    inner join sys.objects TBL on COL.object_id= TBL.object_id

    inner join sys.types TYP on TYP.system_type_id= COL.system_type_id

    where TBL.type ='u' and TBL.name != 'sysdiagrams'

    and TYP.name !='sysname' order by

    --TBL.name,

    COL.name

    Friday, May 6, 2011

    Friday, April 29, 2011

    Adobe Flash Live Straming Technology

    WPF Good Links

    http://msdn.microsoft.com/en-us/library/cc296381.aspx

    http://karlshifflett.wordpress.com/2008/04/10/wpf-sample-series-wpf-mdi-task-switching/

    http://blogs.msdn.com/b/llobo/archive/tags/wpf+samples/

    http://blogs.msdn.com/b/llobo/archive/2008/02/26/drag-drop-library-updated.aspx

    SQL Best practices and Tips

    1. Avoid DISTINCT



    2. TOP 1 ORDER BY ID desc (to get the last record) - Use WHERE ID = (SELECT (MAX(ID) FROM Tbl) - TOP N * or TOP N PERCENTAGE or TOP N WITH TIES (tank)



    3. Table Scan needs to eliminate if the cost is high... Always Table Seek is better for IO operation and Performance.



    4. INNER join is better than Equi join ECT col1, col2, col3... FROM table_name1, table_name2 WHERE table_name1.col2 = table_name2.col1;



    5. Use PRIMARY key and then use Non clustered index as Non clustered index uses the Clustered index key



    6. Use Order by only if required



    7. Use composite index keys if the Where condition using more than one filters CDN



    8. Use INCLUDE
    CREATE NONCLUSTERED INDEX [] ON [dbo].[order] ([Contract_No],[Delete_Flag],[Status]) INCLUDE ([Order_No],[Exchange_Id])



    Index fragmentation - Health check



    SELECT CAST(DB_NAME(database_id) AS varchar(20)) AS [Database Name],CAST(OBJECT_NAME(object_id) AS varchar(20)) AS [TABLE NAME], Index_id, Index_type_desc, Avg_fragmentation_in_percent, Avg_page_space_used_in_percentFROM sys.dm_db_index_physical_stats(DB_ID('SOLO'),OBJECT_ID('dbo.order'),NULL,NULL,'Detailed')
    SELECT index_id, index_depth, cast(avg_fragmentation_in_percent as int), page_count FROM sys.dm_db_index_physical_stats(DB_ID('SOLO'), OBJECT_ID('dbo.order'), NULL, NULL, 'DETAILED') order by 1,2




    replace the NOT IN clause with a != , if you are comparing with 1 value
    Avoid Index for a fixed value columns such as "Boolean", "Status" which will not give a great benifit.




    WHERE SUBSTRING(firstname,1,1) = 'm'
    can be rewritten like this:
    WHERE firstname like 'm%




    If you currently have a query that uses NOT IN, which offers poor performance because the SQL Server optimizer has to use a nested table scan to perform this activity, instead try to use one of the following options instead, all of which offer better performance:
    -Use EXISTS or NOT EXISTS -Use IN -Perform a LEFT OUTER JOIN and check for a NULL condition




    WHERE clauses that use NOT are not sargable, but can often be rewritten to remove the NOT from the WHERE clause, for example:
    WHERE NOT column_name > 5
    to
    WHERE column_name <= 5





    if you can rewrite the WHERE clause so that the column and function are separate, then the query can use an available index, greatly boosting performance. for example: Function Acts Directly on Column, and Index Cannot Be Used:
    SELECT member_number, first_name, last_nameFROM membersWHERE DATEDIFF(yy,datofbirth,GETDATE()) > 21
    Function Has Been Separated From Column, and an Index Can Be Used:
    SELECT member_number, first_name, last_nameFROM membersWHERE dateofbirth < DATEADD(yy,-21,GETDATE





    SELECT column_name FROM table_nameWHERE LOWER(column_name) = 'name'
    SELECT column_name FROM table_nameWHERE column_name = 'NAME' or column_name = 'name'
    This code will run much faster than the first example.



    Here are the key operators used in the WHERE clause, ordered by their performance. Those operators at the top will produce results faster than those listed at the bottom.
    = >, >=, <, <= LIKE <>This lesson here is to use = as much as possible, and <> as least as possible.





    Carefully evaluate whether your SELECT query needs the DISTINCT clause or not



    While is most cases, using either option works equally efficiently, there are some instances (such as rows returned from an unsorted heap) where the TOP operator is more efficient than using SET ROWCOUNT. Because of this, using the TOP operator is preferable to using SET ROWCOUNT to limit the number of rows returned by a query.





    Whenever SQL Server has to perform a sorting operation, additional resources have to be used to perform this task. Sorting often occurs when any of the following Transact-SQL statements are executed:
    ORDER BY GROUP BY SELECT DISTINCT UNION CREATE INDEX (generally not as critical as happens much less often)In many cases, these commands cannot be avoided. On the other hand, there are few ways that sorting overhead can be reduced. These include:
    Keep the number of rows to be sorted to a minimum. Do this by only returning those rows that absolutely need to be sorted. Keep the number of columns to be sorted to the minimum. In other words, don't sort more columns that required. Keep the width (physical size) of the columns to be sorted to a minimum. Sort column with number datatypes instead of character datatypes.When using any of the above Transact-SQL commands, try to keep the above performance-boosting suggestions in mind.





    USE NorthwindSELECT OrderIDFROM [Order Details]WHERE UnitPrice > 10GROUP BY OrderID
    or
    USE NorthwindSELECT DISTINCT OrderIDFROM [Order Details]WHERE UnitPrice > 10
    Both of the above queries produce the same results, but the second one will use less resources and perform faster.





    It is fairly common request to write a Transact-SQL query to to compare a parent table and a child table and find out if there are any parent records that don't have a match in the child table. Generally, there are three ways this can be done:
    Using a NOT EXISTS
    SELECT a.hdr_keyFROM hdr_tbl aWHERE NOT EXISTS (SELECT * FROM dtl_tbl b WHERE a.hdr_key = b.hdr_key)
    Using a Left Join
    SELECT a.hdr_keyFROM hdr_tbl aLEFT JOIN dtl_tbl b ON a.hdr_key = b.hdr_keyWHERE b.hdr_key IS NULL
    Using a NOT IN
    SELECT hdr_keyFROM hdr_tblWHERE hdr_key NOT IN (SELECT hdr_key FROM dtl_tbl)





    Here's how you might use COUNT(*):
    IF (SELECT COUNT(*) FROM table_name WHERE column_name = 'xxx')
    Here's a faster way, using IF EXISTS:
    IF EXISTS (SELECT * FROM table_name WHERE column_name = 'xxx')
    The reason IF EXISTS is faster than COUNT(*) is because the query can end immediately when the text is proven true, while COUNT(*) must count go through every record, whether there is only one, or thousands, before it can be found to be true.






    Performing UPDATES takes extra resources for SQL Server to perform. When performing an UPDATE, try to do as many of the following recommendations as you can in order to reduce the amount of resources required to perform an UPDATE. The more of the following suggestions you can do, the faster the UPDATE will perform.
    If you are UPDATing a column of a row that has an unique index, try to only update one row at a time. Try not to change the value of a column that is also the primary key. When updating VARCHAR columns, try to replace the contents with contents of the same length. Try to minimize the UPDATing of tables that have UPDATE triggers. Try to avoid UPDATing columns that will be replicated to other databases. Try to avoid UPDATing heavily indexed columns. Try to avoid UPDATing a column that has a reference in the WHERE clause to the column being updated. Of course, you may have very little choice when UPDATing your data, but at least give the above suggestions a thought. [6.5, 7.0, 2000]
    If you have created a complex transaction that includes several parts, one part of which has a higher probability of rolling back the transaction than the others, better performance will be provided if you locate the most likely to fail part of the transaction at the front of the greater transaction. This way, if this more-likely-to-fail transaction has to roll back because of a failure, there has been no resources wasted on the other less-likely-to-fail transactions.





    you often need to INSERT the same value into a column. For example, perhaps you have to perform 100,000 INSERTs a day into a particular table, and that 90% of the time the data INSERTed into one of the columns of the table is the same value.If this the case, you can reduce network traffic (along with some SQL Server overhead) by creating this particular column with a default value of the most common value. This way, when you INSERT your data, and the data is the default value, you don't INSERT any data into this column, instead allowing the default value to automatically be filled in for you.





    we discussed various T-SQL discovery, optimization and tuningtechniques using the SET and DBCC commands. SQL Server performance is acomposite of many factors. And while T-SQL p

    Friday, April 22, 2011

    FaceBook - My view

    Hi All,

    I am new to Face book (FB) and understood the wonderful features of the FB application. It helps us to remind the birthday of friends, send messages, and share information across the group.

    The downside is it tempts us to login to the application multiple times a day to read the comments and messages, eventually makes us addict to it.

    Most of you are adding YouTube movie songs, which we are seeing it in all TV music channels, which is ultimately not useful, and waste of bandwidth and time.

    I gradually reduced my time in FB and using my time in reading books which will focus the mind in one direction. Whereas In web, we jump from one link to another and finally we will do noting.

    I suggest the youngsters not to spend more time in FB. This is the right age for you to focus on your career and studies.

    Facebook in a part of life and not the heart of life.

    Warm Regards
    Balakrishnan G.

    Thursday, April 21, 2011

    SQL COALESCE & Top N within Group By

    CREATE TABLE EMPLOYEE(
    [EMPLOYEEID] INT PRIMARY KEY,
    [NAME] NVARCHAR(50),
    [MANAGERID] INT
    )

    GO

    INSERT INTO EMPLOYEE VALUES(101,'Mary',102)
    INSERT INTO EMPLOYEE VALUES(102,'Ravi',NULL)
    INSERT INTO EMPLOYEE VALUES(103,'Raj',102)
    INSERT INTO EMPLOYEE VALUES(104,'Pete',103)
    INSERT INTO EMPLOYEE VALUES(105,'Prasad',103)
    INSERT INTO EMPLOYEE VALUES(106,'Ben',103)

    GO

    SELECT E1.[NAME],COALESCE(E2.[NAME],'No Manager') AS [MANAGER NAME]
    FROM EMPLOYEE E1
    LEFT OUTER JOIN EMPLOYEE E2
    ON E2.EMPLOYEEID =E1.MANAGERID


    SQL Select Top N within Group By

    drop table #test
    create table #test (testid int identity(1,1), personid int, persondate int)

    insert into #test (personid, persondate) values (1, 1)
    insert into #test (personid, persondate) values (1, 2)
    insert into #test (personid, persondate) values (1, 3)
    insert into #test (personid, persondate) values (1, 4)
    insert into #test (personid, persondate) values (1, 5)

    insert into #test (personid, persondate) values (2, 1)
    insert into #test (personid, persondate) values (2, 2)
    insert into #test (personid, persondate) values (2, 3)
    insert into #test (personid, persondate) values (2, 4)
    insert into #test (personid, persondate) values (2, 5)

    insert into #test (personid, persondate) values (3, 1)
    insert into #test (personid, persondate) values (3, 2)
    insert into #test (personid, persondate) values (3, 3)

    insert into #test (personid, persondate) values (4, 1)
    insert into #test (personid, persondate) values (4, 2)

    SELECT * FROM #test

    SELECT b.testid, b.personid, b.persondate, count(1) AS RowOrder
    FROM #test a, #test b
    WHERE a.persondate >= b.persondate AND a.personid = b.personid
    GROUP BY b.testid, b.personid, B.persondate
    HAVING Count(1) BETWEEN 1 AND 1
    ORDER BY 1 DESC

    Tuesday, April 5, 2011

    Query Tuning Steps

    Most of the DBA’s new to query tuning would wonder where to start in order to tune a query. Step 1: Run the query in Management Studio and view the actual execution plan. To view the execution plan, press Ctrl+M and then execute the query in SSMS. Step 2: In Execition plan next to results ,Check if there are any table scans or Clustered index scan or Index scan involved in the execution plan. If yes, then you should analyze that table’s info thoroughly in the execution. Step 3: Identify the actual rows in the table where there is scan involved. If the table is slightly larger i.e. greater than 2000 rows I would suggest you to check if there are proper indexes in the table. If the table has less than 2000 records table scan wouldn’t be a problem and I would rather prefer a table scan on those tables. Step 4: If there is already an index you have to analyze why the optimizer preferred a Clustered index scan or an Index scan rather than Seeks. The reason may be due to fragmentation or outdated statistics or due to the least selectivity or the query cost. Step 5: The following query will give the exact % of fragmentation in the indexes for a particular table. The below query will display the fragmentation status in the table “Person.Address” in Adventureworks database. SELECT CAST(DB_NAME(database_id) AS varchar(20)) AS [Database Name], CAST(OBJECT_NAME(object_id) AS varchar(20)) AS [TABLE NAME], Index_id, Index_type_desc, Avg_fragmentation_in_percent, Avg_page_space_used_in_percent FROM sys.dm_db_index_physical_stats(DB_ID('AdventureWorks'),OBJECT_ID('person.address'),NULL,NULL,'Detailed') If the avg_fragmentation_in_percent is > 40% rebuild the index (using Alter index rebuild command) to eliminate fragmentation. It’s recommended to have a rebuild index job for all the tables scheduled to run on a weekly basis. Please NOTE that rebuilding an index is an expensive operation and ensure that it’s done only during OFF-Production hours. Step 6: If the indexes are fine, then check the statistics. Sometimes the index will be fine but the query would still continue to be slow since the optimizer wouldn’t be able to use the correct indexes due to outdated statistics. The following query gives the last time when the statistics for an index was last updated. SELECT Name AS Stats_Name, STATS_DATE(object_id, stats_id) AS Statistics_update_date FROM sys.stats WHERE object_id=OBJECT_ID('person.address') The statistics should be updated either weekly or daily or on alternate days depending on the frequency of modifications in the table. The more frequent the table is modified the more frequent the statistics should be updated. Sometimes for high transactional tables you can schedule a job to update the statistics on a regular basis. Please NOTE that rebuilding the index will automatically update the statistics as well. Hence avoid updating the statistics if you are rebuilding the index. Step 7: If you see any key lookups happening in the execution plan, make use of Included columns to create a covering Nonclustered index to avoid expensive lookup operation. This will help in improving the query performance as the logical reads would be reduced to a great extent. Step8: Ensure that each table has a clustered index preferably on primary key columns (by default there is one unless you explicitly mention Nonclustered) or on Identity columns. The clustered index should always be defined on unique valued columns like primary keys or identity. Step9: If you have a composite index, ensure to have the most selective field (the ones which have unique values) as the leading column in the index. Step10: If you couldn’t tune the query further or if you are clueless, try to use Database Tuning Advisor (DTA). Provide the SQL query as input file and run the DTA. It will provide a list of recommendations to reduce the query cost. Please do NOT blindly implement the suggestions doing so would certainly improve the query performance but you would end up creating numerous indexes which will be difficult to maintain during maintenance operations. You have to take the call of creating indexes as suggested by DTA, check whether the index will be used in most cases or if you can rewrite the query to make use of the existing indexes. Step11: While tuning stored procedures you need to ensure that the query plan for stored procedures is cached. The following query will help in providing the caching info for the stored procedures. SELECT usecounts, cacheobjtype, objtype, [text] FROM sys.dm_exec_cached_plans P CROSS APPLY sys.dm_exec_sql_text(plan_handle) S WHERE cacheobjtype = 'Compiled Plan' AND objtype='Proc' AND [text] NOT LIKE '%dm_exec_cached_plans%' AND S.DBID=11 --MENTION THE DATABASE ID FOR THE RESPECTIVE DATABASE (USE SP_HELPDB TO GET THE DBID) The value of usecounts will increase every time you run the same stored procedure.If there is a problem in caching check if there is any SET options as most of them will cause a recompile in query plan. Also the plan will be flushed out every time you run DBCC Freeproccache or DBCC FlushprocinDB. Never use both of them in production environment as it will remove the cache for all the procedures and they (SP) will have to be recompiled the next time they are run. If you suspect there might be some problem in the query plan, you can try to use WITH RECOMPILE option which will recompile the particular stored procedure every time it runs and see how the performance is. CREATE PROC Test WITH RECOMPILE AS Statement 1 Statement 2 Step12: Finally if all the above options are fine and the query couldn’t be tuned, try to rewrite the query. In few cases as soon as you view the query such as the ones below we need to rewrite the query: Creating a view with TOP 100% in order to include the ORDERBY clause in view definition where the view will not be sorted unless we explicitly sort the view by issuing <!--[endif]--> Select * from view order by column1 –Result will be sorted Select * from view – Result will NOT be sorted Thus there is a extra cost involved in sorting by using the ORDER BY clause in view definition even though the result is NOT sorted. Hence we should avoid ORDER BY in view definition and instead use it as Select * from view order by column1 <!--[endif]-->Using correlated sub queries will cause RBAR – Row by agonizing Row and will affect the performance. Avoid using Scalar functions in select statements and instead use Inline or Table valued function. Since Scalar function behaves like a cursor we need to avoid it being referenced in the Select statement Source : http://thedbadelight.blogspot.com/2011/01/normal-0-false-false-false-en-us-x-none.html

    Tuesday, March 8, 2011

    திருப்த்தி

    ஒரு ஊர்ல கணவர்கள் விற்கப்படும் கடை திறக்கப்பட்டது....அந்த கடை வாசலில் கடையோட விதிமுறை போர்டு வச்சுருந்தாங்க ..

    அது என்னன்னா...!

    1.கடைக்கு ஒரு தடவை தான் வரலாம்.

    2. கடைல மொத்தம் 6 தளங்கள் இருக்கு...ஒவ்வொரு தளத்துளயும்
    இருக்குற ஆண்களோட தகுதிகள் மேல போக போக அதிகமாகிட்டே போகும்.

    ஒரு தளத்துல இருந்து மேல போயிட்டா மறுபடி கீழ வர முடியாது ..

    அப்டியே வெளிய தான் போக முடியும்.

    இதெல்லாம் படிச்சுட்டு ஒரு பெண்மணி கணவர் வாங்க கடைக்கு போறா...."மச்..கணவர் வாங்குறது என்ன காய்கறி வாங்குற மாதிரி கஷ்டமா என்ன...ச்சே ச்சே அப்டி எல்லாம் இருக்காது

    முதல் தளத்துல அறிக்கை பலகைல "முதல் தளத்தில் இருக்கும் கனவான்கள் வேலை உள்ளவர்கள்; கடவுள் நம்பிக்கை உள்ளவர்கள்" அப்டின்னு போட்டுருந்துச்சு

    இது அடிப்படை தகுதி அப்டின்னு நினைச்சுட்டு இன்னும் மேல போக முடிவு செய்றா


    இரண்டாம் தளத்துல அறிக்கை பலகைல "இந்த தளத்தில் இருக்கும் கனவான்கள் வேலை உள்ளவர்கள்; கடவுள் நம்பிக்கை உளளவர்கள் மற்றும் குழந்தைகள் மேல் அன்பு செலுத்துபவர்கள் " அப்டின்னு போட்டுருந்துச்சு

    இதுவும் அடிப்படை தகுதி அப்டின்னு நினைச்சுட்டு இன்னும் மேல போறா.

    மூன்றாம் தளத்துல அறிக்கை பலகைல "இந்த தளத்தில் இருக்கும் கனவான்கள் வேலை உள்ளவர்கள்; கடவுள் நம்பிக்கை உளளவர்கள் மற்றும் குழந்தைகள் மேல் அன்பு செலுத்துபவர்கள் அது மட்டுமல்லாமல் வசீகரமானவர்கள். " அப்டின்னு போட்டுருந்துச்சு

    அந்த பெண்மணி வசீகரமானவர்கள்னு பார்த்ததும் ஆஹா மூணாவது தளத்துலையே இவ்வளவு தகுதிகள் இருந்தா மேல போக போக இன்னும் என்ன எல்லாம் இருக்குமோ அப்டின்னு நினைச்சு மேல போவதாக முடிவெடுத்தாள்.

    நாலாவது தளத்துல அறிக்கை பலகைல "இந்த தளத்தில் இருக்கும் கனவான்கள் வேலை உள்ளவர்கள்; கடவுள் நம்பிக்கை உளளவர்கள் மற்றும் குழந்தைகள் மேல் அன்பு செலுத்துபவர்கள் அது மட்டுமல்லாமல் வசீகரமானவர்கள்.

    வீட்டு வேலைகளில் மனைவிக்கு உதவி செய்யும் விருப்பம் உளளவர்கள் " அப்டின்னு.

    இதை விட வேற என்ன வேணும்...நல்ல குடும்பம் அமைக்கலாமே?

    கடவுளே...மேல என்ன இருக்குன்னு தெரிஞ்சே ஆகணும்." அப்டின்னு முடிவு பண்ணிட்டு மேல போனாள்.

    ஐந்தாவது தளத்துல அறிக்கை பலகைல "இந்த தளத்தில் இருக்கும் கனவான்கள் வேலை உள்ளவர்கள்; கடவுள் நம்பிக்கை உளளவர்கள் மற்றும் குழந்தைகள் மேல் அன்பு செலுத்துபவர்கள் அது மட்டுமல்லாமல் வசீகரமானவர்கள்.

    வீட்டு வேலைகளில் மனைவிக்கு உதவி செய்யும் விருப்பம் உளளவர்கள்.மிகவும் ரொமாண்டிக் ஆனவர்கள் " அப்டின்னு.

    அவ்ளோ தான்.....அந்த பெண்மணியாள முடியல...[ வடிவேலு ஸ்டைலில்] ...சரி இங்கயே யாரையாவது தேர்வு செய்யலாம்னு நினைச்சாலும் இன்னொரு தளம் இருக்கே..அங்க என்ன இருக்குன்னு பார்க்காம எப்டி முடிவு எடுக்குறது...சரி மேல போயி தான் பார்ப்போம்னு போறா ..

    ஆறாவது தளத்துல அறிக்கை பலகைல

    "இந்த தளத்தில் கனவான்கள் யாரும் இல்லை..வெளியே செல்லும் வழி மட்டுமே உள்ளது ..இந்த தளத்தை அமைத்ததற்கு காரணமே பெண்களை திருப்த்திப்படுத்தவே முடியாதுங்குறது நிரூபிக்கத் தான் .

    எங்கள் கடைக்கு வந்தமைக்கு நன்றி ...

    பார்த்து பதனமாக கீழே படிகளில் இறங்கவும் " அப்டின்னு போட்டிருந்தது .

    ///நீ ஒரு பெண்ணைக் காதலித்தால் அவளை அவளெண்ணப்படிவிடு... அவள் உன்னிடம் திரும்பி வந்தால் அவள் உன்னுடையவள்...அவள் வராவிட்டால் அவள் எப்போதும் உன்னுடையவளாக இருந்ததில்லை...///

    Friday, February 25, 2011

    WPF : Restrict Multiple Instance

    protected override void OnStartup(StartupEventArgs e){

    // Get Reference to the current Process

    Process thisProc = Process.GetCurrentProcess();

    // Check how many total processes have the same name as the current one

    if (Process.GetProcessesByName(thisProc.ProcessName).Length > 1)

    {

    // If ther is more than one, then it is already running.

    MessageBox.Show("Another Instance is already running.");

    Application.Current.Shutdown();

    return;

    }

    base.OnStartup(e);

    }

    Vandalore Zoo, Chennai




    Saturday, February 12, 2011