Forum Replies Created

Viewing 15 posts - 61 through 75 (of 284 total)

  • RE: BEGIN and END in stored procedure

    But this would:

    create procedure procname

    as BEGIN

    statement 1

    statement 2

    ...

    statement n

    END

    grant execute to procname to role1

    grant...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: DBA as commodity in future

    Loner (8/19/2008)


    A lot of DBA job description these days includes T-SQL, SSIS and Business Intelligence experiences.

    As a matter of facts, a lot of companies hire DBA/Developer instead of just DBA.

    Which,...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: BEGIN and END in stored procedure

    As for preferences, I always use the Begin/End in IF/ELSE constructs but also for stored procs and, yes, I indent the entire block of code. This is personal preference but...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: MAX() Function Call from Application

    The index is the best solution, except that as you are querying for the MAX date, then I would override the default and define the index as descending.

    create index IX_Name...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: UDF or stored procedure?

    It's not so much that you're not returning a value from a function. You could hard code a return value if you want and it still won't compile. However, the...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Variables in Derived Tables

    I think that one of the methods you could use to make this code a lot easier to work with is to write out just exactly what it is doing...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Please help me in writing a query to retreive data from three tables

    You have a many-to-many relationship between stations and categories but have not modeled the intersection table correctly. Instead of

    Table2 : StationCategoryLink

    SampleData : StationCode ...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: ChangeDateTpFirstOfNextMonth

    You can truncate the time part and simplify the calculation in one swell foop:

    select DateAdd( m, DateDiff( m, 0, @NextMonth ) + 1, 0 );

    Leave out the "+ 1" and...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Track data change in a table.

    You may want to version the table (see the link in my sig to get a document explaining the details). But that allows you to query the table to see...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: if-else

    You don't have begin-end delimiters after the else. So only the first print statement (print @pallet) is getting executed when the ifcondition is false. The statements from the second print...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: @@IDENTITYin very busy site - if many insert in same time What happend?

    Valentin Petkov (8/7/2008)


    ...it is SIMPLE INSERT INTO then SELECT @INDENTITY as ID ....but NULL

    You have got to get off the track you are on or it will be very difficult...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Money vs. Decimal Data type

    Jeff Moden (8/6/2008)


    Heh... provided that an inter rate, tax rate, discount rate, or any other rate is never used.

    None of which are Money. All those rates will be Decimal, Numeric,...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: @@IDENTITYin very busy site - if many insert in same time What happend?

    By any chance, would there be an Instead Of trigger defined on the table?

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Money vs. Decimal Data type

    meichner (8/6/2008)


    I took a seminar a while back where they suggested using decimals and money to avoid rounding issues. I guess they were wrong.

    Not exactly. The problem is not quite...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

  • RE: Insert a record and use new ID value to populate FK field in another table

    Obviously, what you are trying to do can be done and it makes for a good exercise in solving problems using SQL. However, my advice is don't do it at...

    Tomm Carr
    --
    Version Normal Form -- http://groups.google.com/group/vrdbms

Viewing 15 posts - 61 through 75 (of 284 total)