Forum Replies Created

Viewing 15 posts - 301 through 315 (of 2,894 total)

  • RE: Red lines under third occurance of a table name

    IntelliSense is not a strongest point of SSMS...

    You will use to it.

    BTW. SQL2012 adds more annoying features in to it eg. pinky UPDATE...

    _____________________________________________
    "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 Joins.....

    Same as Jeff, I'm not sure what do you mean by employee having several EmpId's, however, your current query

    SELECT Distinct a.*,

    b.Station,

    c.EmpID

    FROM #NoStaffID as a

    Left JOIN #Station b

    On a.City =...

    _____________________________________________
    "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: Is this syntax guaranteed to continue working?

    Nothing is certain but death and taxes

    You should hope that it will work for ever.

    Right now, there is nothing in MS BoL which suggests that they might change this...

    _____________________________________________
    "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: Fun task for the afternoon - grouping data

    Try this:

    SELECT DISTINCT

    STUFF((SELECT ',' + m2.Region

    ...

    _____________________________________________
    "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: getting all the days of week eevn if data doesnt exist

    In order to display records for dates which are not found in the table you are reporting on, you should build you query based on your calendar table aux.date which...

    _____________________________________________
    "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: Require help to retrieve data from a table

    try this:

    ;WITH cteModules

    AS

    (

    SELECT ModuleId

    FROM Course_Module

    WHERE CourseID = 4

    )

    , cteQualifyingCources

    AS

    (

    ...

    _____________________________________________
    "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: Stored Procedure is not responding, i am executing but does nothign and donot execute

    I wonder, do NHS operating surgeons ask questions on innet forums while inside of someone body?

    OP:

    Hi guys, I've just cut the man and I'm not sure what to do with...

    _____________________________________________
    "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: SQL Varchar(max)

    Oops!

    Somehow, I only could see other replies after I've posted my one.

    _____________________________________________
    "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: SQL Varchar(max)

    you would google it out faster than post this question!

    http://msdn.microsoft.com/en-us/library/ms176089.aspx

    It's 2^31-1 bytes (2 GB).

    _____________________________________________
    "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: Query help

    elee1969 (7/3/2013)


    Luis Cazares (7/3/2013)


    You can use a CASE statement.

    SELECT q.Course_Code, CASE WHEN res.[4a] = 0 THEN 0 ELSE 6-res.[4a] END as [4a],

    ...

    ah thanks luis. 🙂 i knew it would be...

    _____________________________________________
    "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: Query help

    like this:

    SELECT q.Course_Code, 6-res.[4a] as [4a],6-res.[4b] as [4b], 6-res.[4c] as [4c], 6-res.[5a] as ,res.[5b],res.[5c],res.[6a],res.[6b],res.[6c],res.[7a],res.[7b],res.[7c],res.[7d],res.[7e] as converted

    FROM

    The above willnot compile as has quite few errors. You should be more accurate.

    Basically, in...

    _____________________________________________
    "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: Query help

    just replace first line of your SELECT query to:

    SELECT q.Course_Code, 6-res.[4a] as [4a], 6-res.[4b] as [4b], 6-res.[4c] as [4c], 6-res.[5a] as [5a] ... etc.

    _____________________________________________
    "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: Query help

    6 - X formula will work for you:

    SELECT v, 6-v as converted_v

    FROM (VALUES (1),(2),(3),(4),(5)) v(v)

    _____________________________________________
    "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: Query help

    Steve Jones - SSC Editor (7/3/2013)


    In addition to Eugene's notes, you can use a CASE statement to change things around.

    case

    When x = 5 then 1

    when x = 4 then 2

    end

    If...

    _____________________________________________
    "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: Query help

    elee1969 (7/3/2013)


    Hello - I was handed a script to modify. I am an accidental DBA. I am confused on how to modify a query to return certain results. For...

    _____________________________________________
    "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 - 301 through 315 (of 2,894 total)