Forum Replies Created

Viewing 15 posts - 5,506 through 5,520 (of 8,761 total)

  • RE: Trigger syntax error

    Quick suggestion

    😎

    Create Trigger trgInsertSalesForce

    on dbo.CustomerQuote

    AFTER Insert

    as

    begin

    Update CQ

    set CQ.SalesForceId = (select

    ...

  • RE: Running Balance Updation

    Quick suggestion, check the articles on this page Solving the "Running Total" & "Ordinal Rank" Problems in SS 2k/2k5[/url]

    😎

  • RE: creating range between values in query

    Quick suggestion, use CROSS JOIN, here is a quick example

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID(N'dbo.TBL_GROUP') IS NOT NULL DROP TABLE dbo.TBL_GROUP;

    CREATE TABLE dbo.TBL_GROUP

    (

    [Group] ...

  • RE: split a comma separated string into columns

    Jeff Moden (4/24/2015)


    To be honest, the front end is storing the data incorrectly. The data should be sorted with just one IP address per row and, once the table...

  • RE: Reducing Index Fragmentaion during Inserts

    The problem here is that the inserts are not in an ever increasing order, possible option would be adding an Identity column for the primary key and then a unique...

  • RE: Using a Window Aggregate in an Aggregate Query

    Stewart "Arturius" Campbell (4/26/2015)


    Never thought of doing it this way

    This is a very efficient method when aggregating with different grouping / level of details, comes close to the divide and...

  • RE: How can I rewrite this in better performance

    MotivateMan1394 (4/26/2015)


    You could try something like this ...

    Your Query Return Only One record

    And My Query Return records equal the T1 Records Number.

    First of all, Phil's query does not only return...

  • RE: How can I rewrite this in better performance

    MotivateMan1394 (4/25/2015)


    Hi

    How can I rewrite this in better performance :

    select *, ( SELECT TOP 1 Code FROM T2 WHERE T2.Id=T1.Id ...

  • RE: Using a Window Aggregate in an Aggregate Query

    palotaiarpad (4/26/2015)


    Hmm. According to BOL, if OVER used with a SUM, then an order by clause is required...

    That is incorrect, it is the partition clause and in this case the...

  • RE: Where and or

    Quick thought, I think you are over complicating this, consider this code

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @SAMPLE_SIZE INT = 1000;

    IF OBJECT_ID(N'dbo.TBL_GENDER_SEEKING') IS NOT NULL DROP TABLE dbo.TBL_GENDER_SEEKING;

    ;WITH T(N) AS (SELECT N...

  • RE: The Elusive Conditional WHERE Clause

    Sorry for the delay, work got in the way and of course I got a little carried away too:

    Having read the article and already looking into a similar problems,...

  • RE: To create login in many servers.

    Ed Wagner (4/25/2015)


    Eirikur Eiriksson (4/24/2015)


    Quick trick, in SSMS press CTRL+ALT+G to view Registered Servers, if they are grouped you can right click on the group, new query and that instance...

  • RE: language translation in SQL Server 2008 R2

    gracebite1981 (4/24/2015)


    Hi All,

    I am looking to help on Language translation option in SQL Server 2008 R2

    Here is my requirement

    I have one database (Table name...

  • RE: Grant Showplan error

    demin99 (4/24/2015)


    Hi All,Iam able to view showplan when Iam using dbo schema but when I use userdefined schema then I

    get an error SHOW PLAN denied on database.

    select * from...

  • RE: To create login in many servers.

    Quick trick, in SSMS press CTRL+ALT+G to view Registered Servers, if they are grouped you can right click on the group, new query and that instance of the query will...

Viewing 15 posts - 5,506 through 5,520 (of 8,761 total)