Forum Replies Created

Viewing 15 posts - 121 through 135 (of 389 total)

  • RE: How to convert this procedure as dynamic SQL

    I would use dynamic sql if you need to make a query Sargable and the where clause is, I quote from Gail, " Looks like it was drawn up by...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Help required in query.

    amitsingh308 (4/7/2016)


    Create table Script is as under:

    Create table OrdersDetails(OrderNo varchar(30),ItemNo Varchar(20),ItemName Varchar(50))

    insert script is as under:

    Insert into OrdersDetails (OrderNo,ItemNo,ItemName) Values('122314','1','sdfasfasd123')

    Now I want to change sequence number for order number...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Where to start?

    lnoland (4/6/2016)


    MadAdmin (4/5/2016)


    In SSMS, Click on

    VIEW\Template Explorer OR Ctrl+Alt+T

    and you will have a list of most stuff.

    So you dont have to remember syntax of how to create table,...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Where to start?

    In SSMS, Click on

    VIEW\Template Explorer OR Ctrl+Alt+T

    and you will have a list of most stuff.

    So you dont have to remember syntax of how to create table, index, view...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: please fine tune this query

    Let us have an execution plan so that we can see important info.

    Also, do set statistics io,time on

    Then execute and let us see the output of that and also the...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: TSQL query to get employee name from employee table by using id from user table

    Hugo Kornelis (4/5/2016)


    MadAdmin (4/5/2016)


    Ed Wagner (4/2/2016)


    If the employees table has lots of rows, you shouldn't be using table variables, as they t get the benefit of statistics.

    If these were physical...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: TSQL query to get employee name from employee table by using id from user table

    Ed Wagner (4/2/2016)


    If the employees table has lots of rows, you shouldn't be using table variables, as they t get the benefit of statistics.

    If these were physical tables, I'd suggest...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Restore help needed for 1.5 TB database.

    try setting buffercount and max transfer size.

    Don't leave it at default if you have 1.5 TB to have to wait for.

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Spatial Data: finding the closest point to a geographical point. Populating a distance field in a table.

    Taking a wild monkey stab in the pitch of darkness here.

    I tried this but am unable to verify the data.

    I tried matching the addresses in adventureworks2012.Person.address to its nearest address...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Cached Plans of Stored Procedure

    it increased by 1 because you ran it twice with the same parameter.

    Looking at the embedding of the value in the sql string, if you change the parameter, you will...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Advice on query optmization - Multiple Unions

    Is there a table on a linked server?

    If so, it may be better to pull the necessary data into a temp table and then do the unions.

    Also, the subselects with...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: sp_whoIsActive 101 help...

    Do you need a script which will give you top 10 costliest procedures or costliest queries? Added them below just incase.

    This is the first route. whoisactive will only tell you...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: sp_whoIsActive 101 help...

    If you have high cpu usage, it smells to me like queries which aren't able to use indexes, either because they are not there, or they are but the query...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Optimizing Queries

    Frank Cazabon (3/10/2016)


    SELECT DISTINCT [PNRStatus] FROM [Transactions] ORDER BY [PNRStatus]

    SELECT DISTINCT [AgentID] FROM [Transactions] ORDER BY [AgentID]

    SELECT DISTINCT [ScriptResult] FROM [Transactions] ORDER BY [ScriptResult]

    Are these queries perhaps to populate a...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • RE: Rebuild Index Task doesn't completes in Maintenance Plan

    ZZartin (3/15/2016)


    If you're running the rebuild index task built into SQL server it will run slower and slower and use more and more log space as the DB grows as...

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

Viewing 15 posts - 121 through 135 (of 389 total)