Forum Replies Created

Viewing 15 posts - 136 through 150 (of 2,894 total)

  • RE: Removing not necessary joins

    I don't think that there is any "generic" approach.

    Nothing usefull can be advised without knowing any sort of details.

    Providing invloved table's and other objects DDLs, query itself and its...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Need assistance with recursive query (XML)

    That is the first step to get the answer you need:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    If you follow the above, you most likely will get relevant help quite promptly...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Inserting multiple records from a single variable

    ...

    Why are you making a copy of the table? Why not just use Table2?

    And if you really want a complete copy of Table2 in Table1 then you can do...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: get column names

    I guess the first step whould be reading this:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Merging of another DB's data

    Not enough details to suggest a solution.

    What do you mean by merge in your case?

    1. May you have the same data in both databases?

    If Q#1 = Yes:

    2....

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: count from multiple tables for same column exists in database

    Create a temp table to hold results in a way you need.

    Then decalre a cursor over your query which lists db names, table names and column names

    Then you will need...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Difference between two dates (Excluding Weekends)

    The best way would be using pre-build calendar table. The following example creates on-fly calendar containing weekend days for 100 years starting from 1 Jan 2000.

    declare @sample table (StartDate datetime,...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Count days per month per year between 2 dates

    or without calendar table:

    declare @dtFrom date

    declare @dtTo date

    select @dtFrom = '2013-12-15'

    ,@dtTo = '2014-02-18'

    select year(dt) [Year], month(dt) [Month], count(*)

    from (select top(datediff(d,...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to get the email address from the varchar column?

    It's almost impossible to build solution which will cover all posible permitations of something which looks like the free-text.

    He is a bit more comprehensive logic which cover most of your...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Help with hierarchical structure without hierarchical relation field...

    You can try

    SELECT a.accountId

    ,(SELECT SUM(m.debit) FROM accountMovs m WHERE m.accountId LIKE a.accountId + '%') Debit

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Reading match pair of descandats of XML elements in xquiry through T-Sql

    declare @XML xml

    set @XML =

    '<Recordset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <Products>

    <Productdetails>

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Update from Select Statment

    1. Wrong syntax

    2. Danger of converting date into non ISO formatted date string (code 101, means that potentially you may have something like 05/06/2014. Now tell me is it 5th...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Help with Query

    mandrewthebarbarian (2/20/2014)


    The presented results are not exceptions that should be returned. How do I modify the query to exclude orders where the same SKU is present on multiple...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Sum values on periods

    ...

    I need to split (2014-02-01, 2014-02-05) into (2014-02-01, 2014-02-02) and (2014-02-03, 2014-02-05) because on 2014-02-03 stock increases +5 pieces

    FROM_DATETO_DATESTOCK

    2014-02-012014-02-0210

    2014-02-032014-02-0515

    2014-02-062014-02-145

    2014-02-152014-02-2825

    2014-03-01null20

    What in your "sample data " indicates that the stock changed on...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Sum values on periods

    I cannot see from your example, what kind of logic splits set of dates:

    FROM 2014-02-01 TO 2014-02-05

    FROM 2014-02-03 TO 2014-02-28

    FROM 2014-02-15

    to

    FROM 2014-02-01 TO 2014-02-02

    FROM 2014-02-03 TO 2014-02-05

    FROM 2014-02-06 TO 2014-02-14

    FROM...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 136 through 150 (of 2,894 total)