Forum Replies Created

Viewing 15 posts - 541 through 555 (of 5,502 total)

  • RE: Alert Message - popup window

    You would need to mofiy the application that is used to delete the row. E.g. query the log table you mentioned.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Using sp_send_email getting recipents from one query and sending another query results

    I would use a stored procedure to get the list of users, select the results into a temp table and, using a *cough* while loop, send the sproc per...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Calculating the percentage of product revenues for reporting

    Replace A.TOTAL with A.TOTAL*1.00 to avoid an integer divsion (usually resulting in a zero value in such a scenario).

    Example:

    SELECT 1/2*100, 1/(2*1.00)*100



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Query options if variable not set

    I'd go with the IF statement.

    Otherwise, you might run in to a catch-all[/url] scenario.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Best approach to let users create and manage their own tables and data

    I would use a separate database just to make it easier for backup and restore.

    A join would simply be

    SELECT t1.col1, t2.col2

    FROM table1 t1 INNER JOIN YourOtherDatabase.Schema.Table2 t2 ON t1.col1=t2.col2

    As...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Stored proc to retrieve 1 value 20% of the time, another value 70%, and another 10% during a specified time range

    I would use an auxiliary table to hold the call information:

    CREATE TABLE calls

    (

    callid INT IDENTITY(1,1),

    appId INT,

    callTime DATETIME,

    ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Best approach to let users create and manage their own tables and data

    agustingarzon (2/29/2012)


    ...So, knowing this, what would you suggest ?

    I would use a web site that would allow to define a table name and a list of columns with data...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Best approach to let users create and manage their own tables and data

    If users will be allowed to create tables, they should know how to design a database (e.g. build an ERM based on business requirements).

    The issue with a separate schema vs....



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Getting two different rows as columns

    @dwain:

    What query do you refer to when you write:

    Also, the first solution is a bust because it doesn't return the correct row set in this scenario.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: update query

    Please provide some ready to use sample data as described in the first link in my signature together with your expected result.

    (Having more than 20 reads on no reply usually...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Protecting Stored Procedures and Where to Put Processing

    Would you please clarify the scenario you're dealing with:

    If it's a web app, you should be the one hosting the database. In that case, the question is: who don't you...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Getting two different rows as columns

    Looks like a classic CrossTab problem (see the related link in my signature for details).

    SELECT

    T.Name,

    MAX(CASE WHEN t.id=1 THEN T.Title ELSE NULL END) AS Title,

    MAX(CASE WHEN t.id=2 THEN T.Title ELSE...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Running dates

    Are you looking for something like a self-join?

    DECLARE @tbl TABLE

    (

    Recordid INT , contact_date DATE

    )

    INSERT INTO @tbl

    VALUES (1,'20110401'),(2,'20110501');

    WITH cte AS

    (

    SELECT *, ROW_NUMBER() OVER(ORDER BY Recordid...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Grouping on CASE statements = slow query?

    Looking at the execution plan it seems like the statistics for PostingYTD are "slightly" off (estimated 43k rows vs. actual 2.000k rows).

    Is there any index maintenance performed regulary?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Concurrency Issue

    Engr Shafiq (2/27/2012)


    I am writing sqlserver queries from a long time....can you help me how to write insert/update and delete queries in a good and professional way?

    New question - new...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 541 through 555 (of 5,502 total)