Forum Replies Created

Viewing 15 posts - 721 through 735 (of 2,452 total)

  • RE: Insert values into single record

    Empidd1shiftd1shifttyped2shiftd2shifttype d3shiftd3shifttype d4shiftd4shifttype d5shiftd5shifttype

    21902 4 2 4 2 4 1 1 1 1

    is this expected output to be in separate columns for each result...or is it just one single column?

    if...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Insert values into single record

    ganapathy.arvindan (5/11/2016)


    CREATE TABLE dbo.ShiftScheduler(FromDate DATETIME,Shift INT,ShiftType INT ,Emp_Code VARCHAR(50))

    CREATE TABLE dbo.Emploee(FromDate DATETIME,Shift INT,ShiftType INT ,empid VARCHAR(50))

    INSERT INTO dbo.Emploee values('1/1/2015','1/4/2015',1,1,3321)

    INSERT INTO dbo.Emploee values('1/7/2015 ','1/8/2015 ',1,1,3321)

    INSERT INTO dbo.ShiftScheduler VALUES('1/5/2015','1/6/2015',2,4,3321)

    INSERT INTO dbo.ShiftScheduler VALUES('1/9/2015','1/10/2015',2,4,3321)

    did...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Insert values into single record

    your sample data set up doesnt work......plus I would suggest you extend it to include all possible variants ,

    CREATE TABLE dbo.ShiftScheduler(FromDate DATETIME,Shift INT,ShiftType INT ,Emp_Code VARCHAR(50))

    CREATE TABLE dbo.Employee(FromDate DATETIME,Shift...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Are the posted questions getting worse?

    Luis Cazares (5/10/2016)


    Lynn Pettis (5/10/2016)


    Eirikur Eiriksson (5/10/2016)


    Michael L John (5/10/2016)


    Lynn Pettis (5/10/2016)


    Red Letter Day! Silver Spoon posted a helpful response to a question. Of course, it could just...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: help required with sql query

    hlsc1983 (5/10/2016)


    i have a table MARKS with the following columns:

    Studentid int as foreign key ,

    Subjectid int as foreign key,

    Grade int,

    Gradetype int as foreign key,

    Grade_pk int as primary ke

    A subject can...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sessions and members with data gaps and pivoting

    SELECT

    m.MEMBERID,

    MAX(CASE WHEN s.SESSIONID = 1 and m.MEMBERID > 0 THEN 'x' ELSE '-' END) as [01/01/2016-GROUP A],

    MAX(CASE WHEN...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: what Workday number is today in the month today is may 9th but the workday number is 6

    one way is...Gooogle for others....this doesnt auto magically know about your own national holidays / work holidays ....yadda yadda

    DECLARE @StartDate DATETIME

    DECLARE @EndDate DATETIME

    SET @StartDate = '20160501'

    SET @EndDate = GETDATE()

    SELECT

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: what Workday number is today in the month today is may 9th but the workday number is 6

    kat35601 (5/9/2016)


    what Workday number is today in the month today is may 9th but the workday number is 6

    I need away to get the workday number using getdate()

    what code...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Hi Sergiy

    I have looked at your trigger and I am not seeing any benefits at all.....perhaps when you have time you can run thro the following set up and suggest...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Sergiy (5/9/2016)


    J Livingston SQL (5/8/2016)


    ok.

    The original code was found on the web http://www.nigelrivett.net/SQLTriggers/AuditTrailTrigger.html

    can you please provide sample to code to explain what you mean?

    Many thanks

    Sorry, did not have much time...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Jeff Moden (5/8/2016)


    J Livingston SQL (5/8/2016)


    Sergiy (5/8/2016)


    J Livingston SQL (5/6/2016)


    R.P.Rozema (5/6/2016)


    mock up some example table and generate a significant volume of test data into it

    some test data......and yeah the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Today's Random Word!

    HappyGeek (5/8/2016)


    Revenant (5/7/2016)


    TomThomson (5/7/2016)


    crookj (5/6/2016)


    DonlSimpson (5/6/2016)


    Ray K (5/6/2016)


    Ed Wagner (5/6/2016)


    Multiplication

    Division

    Integration

    Amalgamation

    Incorporation

    [Corporate] tax

    Income

    Lack of

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Sergiy (5/8/2016)


    J Livingston SQL (5/6/2016)


    R.P.Rozema (5/6/2016)


    mock up some example table and generate a significant volume of test data into it

    some test data......and yeah the generic audit is slow.

    It's only...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Vacant Days Per Month

    ok....so what do you want to see when it has been 'let' for two months and then after two month is vacated (Void)?

    do you still want 'CFWD' or something else

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Rod did you run the test script I posted?

    1 Million row table

    -- update 6 columns on 100 000 rows

    --run 10 iterations of update with trigger on

    --then disable trigger and repeat

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 721 through 735 (of 2,452 total)