Forum Replies Created

Viewing 15 posts - 526 through 540 (of 2,894 total)

  • RE: Design of database table and PK update

    I guess your StudentAddress table is a link table between Address and Student tables, right?

    If so, when you edit the link you better delete and insert "link" rows if they...

    _____________________________________________
    "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: table naming conventions

    sqlfriends (3/19/2013)


    Eugene Elutin (3/19/2013)


    sqlfriends (3/19/2013)


    ...when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: 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: Help with the query!

    raym85 (3/19/2013)


    I must admit the guy who wrote the query qith the XML logic was an eye opener for me, I reallyed liked that method best. The way I have...

    _____________________________________________
    "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: table naming conventions

    sqlfriends (3/19/2013)


    ...when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: City, County instead of...

    _____________________________________________
    "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 make a stored procedure return a value when there are no available values

    Yes it can. Just use CAST function.

    _____________________________________________
    "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 make a stored procedure return a value when there are no available values

    klineandking (3/19/2013)


    Thanks but i want the stored procedure to reture a single column 'GetExtractSiteExtractFileBatchPreviousSuccessInd' with the value, your script would only return the result as the return value

    My last post...

    _____________________________________________
    "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 to divide one row by another row based on formula or rule.

    Lynn Pettis (3/19/2013)


    Eugene Elutin (3/19/2013)


    Most of OP output results do not match relevant formulas, eg:

    B/A 3/19/2013= 7/ 2 = 3.5 not 0.285714286!

    Try flipping the division: 2/7 = 0.2857142857142857.

    Yep, I know,...

    _____________________________________________
    "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 to divide one row by another row based on formula or rule.

    Most of OP output results do not match relevant formulas, eg:

    B/A 3/19/2013= 7/ 2 = 3.5 not 0.285714286!

    Any way thank's to Lowell for data setup:

    declare @MySampleData table (Date datetime, Name...

    _____________________________________________
    "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 make a stored procedure return a value when there are no available values

    Even shorter version:

    CREATE PROCEDURE [dbo].[GetExtractSiteExtractFileBatchPreviousSuccessInd]

    @BatchStatusCd NVARCHAR(5)

    ,@ExtractSiteCd NVARCHAR(10)

    ,@ExtractAsOfDate DATETIME

    AS

    SELECT MIN(Res) AS ExtractSiteExtractFileBatchPreviousSuccessInd

    FROM

    (

    SELECT 1 AS Res

    UNION...

    _____________________________________________
    "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 make a stored procedure return a value when there are no available values

    Ough, I can see now!

    You need to learn and use proper terminology!

    The stored procedure you have does return an integer value (as I've pointed out in the previous post...

    _____________________________________________
    "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 make a stored procedure return a value when there are no available values

    klineandking (3/19/2013)


    i tried it still returns no value

    What do you mean it returns no VALUE?

    Regardless of what you have in stored proc it always return a value! By...

    _____________________________________________
    "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 the query!

    kl25 (3/19/2013)


    Eugene Elutin (3/19/2013)


    Are you sure that OP wants one column with all subjects concatenated?

    Agreed. 🙂 My query just presents the results in the format the OP listed at...

    _____________________________________________
    "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 the query!

    Are you sure that OP wants one column with all subjects concatenated?

    If not, then he might want dynamic cross-tab:

    SELECT dow.[DAY], s.[Subject], ROW_NUMBER() OVER (PARTITION BY dow.[DAY] ORDER BY...

    _____________________________________________
    "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 syntax error with datepart??

    jbalbo (3/19/2013)


    Hi

    I am getting a syntax error on the following:

    case

    DATEPART(mm,APPT_RPT_APPOINTMENT.START_DATETIME)

    when 07

    then (APPT_RPT_APPOINTMENT.DURATION / 60)

    end...

    _____________________________________________
    "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: Cascading

    Do you have CDC enabled for this table?

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