Forum Replies Created

Viewing 15 posts - 31 through 45 (of 79 total)

  • RE: Using timestamp to identify updated rows in table

    Is your "timestamp column" a column with the timestamp datatype? It is simply a unique value within the database that automatically changes whenever the the row is updated. It does...

  • RE: Display or Limit Records Based Upon Users Credential

    You need more details.

    These appear to be basic sql questions. I recommend reading a book or taking a course.

  • RE: Display or Limit Records Based Upon Users Credential

    It looks like emplID and password are the inputs to the stored procedure. You want the procedure to verify the credentials. If valid, you want the procedure to update userlogins...

  • RE: Can I do this

    You would put looping code like that into a user defined function, and be able to use it in a select statement returning many rows.

  • RE: Display or Limit Records Based Upon Users Credential

    You need to refine your first question. Are you asking about implementing security, or are you asking for a query to return data for a particular person? The query is...

  • RE: Can I do this

    The forum messed up the spaces in the post; but you get the idea.

  • RE: Can I do this

    select

     replace(

      replace(

       replace(

        replace(

         'I ...

  • RE: Trigger question

    Assuming primary/unique key on UPR00100 is EmployID:

    Create Trigger Tg_UpdateIndication On UPR00100

    AS

    IF UPDATE (LASTNAME) or update (FRSTNAME) or update(ADDERSS1) or update (CITY) or update (Phone1)

    BEGIN

    update UPR00100

    set Update_Ind=1

    from inserted

    where (inserted.EmployID = UPR00100.EmployID)

    END

  • RE: sql reporting

    Do you have a table listing departments for each company?

    Assuming there are always 4 depts for each company as in your example:

    SELECT counts.company_no, counts.dept_no, counts.count

    FROM (

       SELECT dept_no =...

  • RE: Difference between Two -ISNULL() and IS NULL

    Generally use "is null" in a conditional.

    Use isnull() to change the value from null to something else.

    If null and 0 mean the same thing in your application, then isnull(@var,...

  • RE: Duplicate rows

    See previous thread.

  • RE: How to retrieve data from two sql queries??

    I think this is a reporting issue, not a SQL issue.

    Look for help with whatever tool you're using for reporting. What will be executing the two queries?

  • RE: DE-DUP ROWS

    Still don't understand.

    Post create table statements, insert statements to fill the tables with sample data, and what you want the table data to look like.

  • RE: DE-DUP ROWS

    Your message has some ambiguities. But maybe this will get you started. I'm assuming Table2 is on the left (even) and Table1 is on the right (odd).

    update Table1

    set Notes =...

  • RE: Validating Stored Procedure results

    Do the work outside of sql server (jscript, vbscript, vb, etc.). Those languages are completely dynamic when looking at query results.

    You could also use the sp_OAxxx procedures with ADO to...

Viewing 15 posts - 31 through 45 (of 79 total)