Forum Replies Created

Viewing 15 posts - 2,746 through 2,760 (of 5,502 total)

  • RE: Automating .sql Scripts

    I would use a Windows scheduled task with the related sqlcmd.



    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: datetime based query

    I would use a CTE together with ROW_NUMBER() OVER(PARTITION BY SensorID ORDER BY DateTime) AS row and do a self (outer?) join on it based on Sensorid and cte1.row=cte2.row-1

    If 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: Create XML Fragment for each row of data

    Will something like this help:

    SELECT *

    FROM Students s

    CROSS APPLY

    (

    SELECT

    (

    SELECT *

    FROM Students t

    WHERE t.DisplayName = s.DisplayName

    FOR XML RAW

    ) x1

    )x



    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: Add the columns values and put the values in one of the row of the same column

    Something like this?

    DECLARE @tbl TABLE

    (

    idtype CHAR(1), id INT, VALUE INT

    )

    INSERT INTO @tbl

    SELECT 'A', 1 ,0 UNION ALL

    SELECT 'B', 2 ,1 UNION ALL

    SELECT 'B', 3 ,1...



    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: Add the columns values and put the values in one of the row of the same column

    Would you please clarify your requirement? What would be the criteria to do the aggregation?

    Based on your rather vague example it seems like you want to count the rows with...



    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: Time duration in mm:ss

    Using Perrys sample:

    SELECT RIGHT(CONVERT(CHAR(8),@dtime,8),5)



    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 Rewrite

    It depends.

    What's the data type of routing?

    As a side note: is there a specific reason for that heavy usage of IN clauses instead of joins or CTEs?



    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: exclude BIT column from the Group By clause

    You could convert it to integer to use it for aggregation:

    MIN(CAST(YourBitCol AS TINYINT))

    or the lazy-dev version:

    MIN(YourBitCol + 0) -- force an implicit conversion

    Edit: @Gail: the echo was not intentional...



    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: Are the posted questions getting worse?

    Steve Jones - Editor (9/28/2010)


    LutzM (9/28/2010)


    If you're a customer/client: How often did you have a chance to talk to the dev team directly to clarify your requirements (or what 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: Runing some SQL statment inside stored procedure and out side stored procedure

    Sounds like parameter sniffing[/url]. Please follow the link and read all three related articles. It's well worth it!



    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: Import XML into SQL datatypes and XML datatype

    mstevens92 (9/28/2010)


    LutzM (9/27/2010)I know, the XML stuff looks weird compared to what we're used to... 😉

    Probably doesn't help that I haven't touched SQL in about 6 months, been up to...



    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: Are the posted questions getting worse?

    Steve Jones - Editor (9/28/2010)


    I am not sure I've had many projects at all in my lifetime that were on budget/on time unless they were trivial (< 1 week). It...



    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: read only user

    CirquedeSQLeil (9/27/2010)


    Very interesting. I have learned something new.

    Even with an explicit deny on the table for update, delete, and insert as well as the denydatawriter - the user that...



    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: Import XML into SQL datatypes and XML datatype

    I know, the XML stuff looks weird compared to what we're used to... 😉

    OPENROWSET is a lot closer...

    DECLARE @xml xml

    SET @xml =(

    SELECT * FROM OPENROWSET(

    BULK 'C:\YourFolder\YourFileName',

    ...



    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: Import XML into SQL datatypes and XML datatype

    Something like this?

    SELECT

    c.value('@NAME[1]','varchar(50)') AS a,

    c.value('@OPTIONS[1]','varchar(10)') AS b,

    c.value('DESCRIPTION[1]','varchar(50)') AS c,

    c.query('SHEET'),

    c.query('RECIPIENT')

    FROM @xml.nodes('FORM') T(c)



    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 - 2,746 through 2,760 (of 5,502 total)