Forum Replies Created

Viewing 15 posts - 2,731 through 2,745 (of 3,543 total)

  • RE: Use ARRAY for CASE statements

    How about this

    CREATE TABLE tblLocationGradeTeacher (Location2 int, Grade int, T_id int, TeacherID int)

    INSERT INTO tblLocationGradeTeacher VALUES (371, 2, 1, 10371)

    INSERT INTO tblLocationGradeTeacher VALUES (371, 2, 2, 121371)

    INSERT...

  • RE: Cursor

    All the update does is to set Z_Id to an incrementing number starting at 1 for each Booking. The order of the data is done by the INSERT statement, add columns to the ORDER...

  • RE: Week in month

    aw shucks, Antares beat me to it, this is my explanation

    SQL Server stores its dates in binary and the lowest value allowed is 0. Any time you use a number...

  • RE: Cursor

    You will need to put a loop around the fetch, create and insert statements to do each row selected.

    But why are you using a cursor, this should do the same

    Create...

  • RE: Display column output over two or more rows

    SELECT (CASE WHEN seq = 1

    THEN CAST(job_id1 as varchar)

    ELSE '' END) AS job_id,

    job_desc

        FROM (SELECT job_id AS job_id1, 1 as seq, LEFT(job_desc,500) AS job_desc

        FROM...

  • RE: how getting numbers with 2 digits behind ,

    What wizard? How do you want to store the values. Are they numbers (some locales use comma instead of full stop as decimal separator).

    If you want to store the values...

  • RE: Updating multiple rows.

    The inserted table will contain 1 or more rows depending on how many rows are being inserted.

    with this staement

    INSERT INTO dbo.myTable (IDField, IDField) VALUES ('A','B')

    the trigger will have an inserted...

  • RE: Runnigs a Stored Procedure with ADO

    Check the contents of gintSite to make sure it contains a value. You will get this message if no value is put in the parameter. Can be a result of...

  • RE: SQL7 Upgrade to SP4

    To quote Microsoft

    'Because SQL Server Service Packs are cumulative, SP4 includes all fixes from previously released Service Packs, and can be applied to an original installation or to one where...

  • RE: Turning off Column Headers in an Stored Procedure ?

    The column headers are an intrinsic part of the recordset output and cannot be removed. Only the application that receives it can  choose not to display them. wz700 is correct...

  • RE: how can i get the number with prefixing zeors in a select query

    SELECT REPLACE(REPLACE(STR(col1,15,2),'.',''),' ','0')

    SELECT REPLACE(CONVERT(varchar,col2,103),'/','')

  • RE: Query problem

    UPDATE p

    SET PriceName = (CASE

    WHEN p.Price IS NULL THEN CAST(FLOOR(a.Price) AS varchar) + ' & Above'

    ELSE CAST(FLOOR(ISNULL(a.Price,0)) AS varchar) + '-' + CAST(FLOOR(p.Price) AS varchar)

    END)

    FROM...

  • RE: Help: Triggers to insert records

    CREATE TRIGGER AfterInsertSysData

    ON SystemDataTest

    AFTER INSERT

    AS

    INSERT INTO Books (rid,fname,book_date)

    SELECT s.rid,s.fname,s.book_date

    FROM inserted i

    INNER JOIN SystemData s

    ON s.rid = i.rid

    INNER JOIN res_test r

    ON...

  • RE: String Aggregate

    Thats OK Frank,

    Thought there was an echo

    there was an echo

    was an echo

    an echo

    echo

    echo

  • RE: String Aggregate

    Jonathan, as usual, in on the ball here. His solution is the answer to your question (I overlooked the word sum doh )....

Viewing 15 posts - 2,731 through 2,745 (of 3,543 total)