Forum Replies Created

Viewing 15 posts - 16 through 30 (of 239 total)

  • RE: Linking Job from one server to view on another

    BOL = Books OnLine aka SQL help

    The message is telling you exactly what to do.

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_NULLS ON

    GO

    SET ANSI_WARNINGS ON

    GO

    Also, my advice if you don't want to...

  • RE: group by 1/2 hour

    You can play with the format of the minutes to be anything you like.

    Try something like this:

    declare @sample table (id int, fax_date datetime)

    insert @sample values(1, '2006-02-25 00:28:00.000')

    insert @sample values(2, '2006-02-25...

  • RE: Linking Job from one server to view on another

    You need to implement a linked server.  Check out BOL.

    Also, it is a VERY bad idea to have server with no SA password.

  • RE: Insert missing rows

    Here is a start:

    --Build a table of numbers, you may want to make it a real table because it is a good tool to use

    select top 8001 Identity(int, 0,1) As...

  • RE: Grouping with formula

    First, the else statements that I added don't work, they only ever return the initial state of the @Output table.

    After the first "Languages" row is applied to the @OutPut table...

  • RE: Grouping with formula

    The query wasn't to fix it, it was to point out the problem.  The query produces the following output:

    Cert_Male Cert_Female Diploma_Male Diploma_Female Major        Course_Level Male Female

    15       41         NULL         NULL           Languages       Certification 15   41

    NULL     NULL       7            ...

  • RE: Grouping with formula

    Becuase when the second row of the subquery is being processed, the CERT* columns are being set to null because the case is returning null for them.

    Check out the following...

  • RE: Grouping with formula

    Bill,

    15 are of level "cert" and 7 are of level "diploma" which are broken out into separate columns.

  • RE: Grouping with formula

    Try this:

    declare @tblmystudent table(records char(1),course varchar(20),course_level varchar(10),major varchar(20),male int,female int)

    insert @tblmystudent values('I','English','Cert','Languages','10','34')

    insert @tblmystudent values('I','ChildCare','Diploma','SocialSc','45','12')

    insert @tblmystudent values('I','HumanThink','Diploma','SocialSc','2','23')

    insert @tblmystudent values('E','Psychology','Diploma','SocialSc','56','23')

    insert @tblmystudent values('E','Counselling','Diploma','SocialSc','23','12')

    insert @tblmystudent values('G','Motivation','Diploma','SocialSc','2','12')

    insert @tblmystudent values('G','BrainDev','Diploma','SocialSc','3','9')

    insert @tblmystudent values('E','France','Cert','Languages','5','7')

    insert @tblmystudent values('I','AdvEnglish','Diploma','Languages','7','4')

    select major

    , sum(case...

  • RE: Outer Join w/ NOT NULL

    Do the following:

    SELECT MAIN_TABLE.key_no,

    COMMENT_TABLE.comment

    FROM MAIN_TABLE

    LEFT OUTER JOIN COMMENT_TABLE

    ON MAIN_TABLE.key_no = COMMENT_TABLE.key_no and COMMENT_TABLE.display_order is NOT NULL

    where MAIN_TABLE.key_no = 'XYZ'

    Note, the old style (*=, =* and *=*) outer join syntax has...

  • RE: Merge two tables

    update b

    set b.ColumnX = a.ColumnY

    from tableB b

    inner join tableA a

    on b.ID = a.ID

  • RE: IS there a better way to write this query

    Try this

    select csuflxideb,csddedcode,csddeds2code

    from checksumm

    inner join checksummded

    on csuflxid=csdflxidcsu and csupayperiod like '2005%'

    group by csuflxideb,csddedcode,csddeds2code

    having count(*) > 1

    order by 1, 2, 3

  • RE: Table Variable as SP Parameter?

    You can't.  Check out this post, about 3 below yours: http://qa.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=287381

  • RE: SQL Code Question (Temp Table?)

    It is all too common due to a person's misconception that their abbreviation scheme "makes sense" to everyone.

    When developing data models, I follow standards that I believe are best practices...

  • RE: Transaction lvel isolation with INSERT/UPDATE

    According to BOL:

    "READUNCOMMITTED, and NOLOCK, cannot be specified for tables modified by insert, update, or delete operations. The SQL Server query optimizer ignores the READUNCOMMITTED and NOLOCK hints in the...

Viewing 15 posts - 16 through 30 (of 239 total)