Forum Replies Created

Viewing 15 posts - 9,886 through 9,900 (of 13,460 total)

  • RE: Is it normal to not specify any relationships between tables?

    definitely not normal. foreign key relationships are a best practice.

    I've encountered this before, and it seems the companies think that their schema would reveal their business processes ro something, so...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create global "database wide" Identity-columns

    here's a second table with an instead of trigger:

    CREATE TABLE EXAMPLE2(KEYID BIGINT REFERENCES MASTERKEYS(KEYID),

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create global "database wide" Identity-columns

    i got curious on this and built a prototype.

    man what a pain to have to code a zillion triggers, just to have a master id someplace.

    i could

    I ended...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create global "database wide" Identity-columns

    to actually implement this, I think each trigger would have to insert into a mastertable with a bigint identity() column, and use an OUTPUT clause for the collection of values,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to create global "database wide" Identity-columns

    just to clarify the whole Oracle thing, Oracle doesn't have a native identity() function like SQL does; instead, you use a SEQUENCE and a TRIGGER to duplicate the functionality, and...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: calling stored procedure from case statement- Sql Server2000

    yeah pseudo code is bad. your placeholder proc implied something completely different.

    it is absolutely not possible to call a procedure with an update statement.

    you can call a function, which returns...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: calling stored procedure from case statement- Sql Server2000

    ok, here's some working code, witht eh update you seem to need; but here's the rub:

    this is what it does:

    for each matching record, if today happens to be sunday,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: calling stored procedure from case statement- Sql Server2000

    ok great that helps a lot...i can do the table and the joins.

    just need one more piece of information.

    what do you want to do to RESULTDATE? i thought you either...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: dynamic sql in a stored procedure and sql injection attacks?

    the problem is the @in_name.

    since you are executing a string you put together, it is possible that instead of the expected customer name being 'dba-vb'

    i could pass ''';DELETE FROM CUSTOMERS;DELETE...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: calling stored procedure from case statement- Sql Server2000

    if you have two logical steps, you'll need to update statements, each witha WHERE statement to control which rows get updated.

    what does the stored procedure do?

    your pseudo code doesn't have...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: calling stored procedure from case statement- Sql Server2000

    with a CASE statement, you can't. case statements return data or help filter a WHERE statement.

    a case helps goes something like this:

    SELECT

    CASE

    WHEN status=1

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Data relationship mapping without having declared Foreign Keys

    tfader is there any common themes applied to the parent-child fields, even when no FK is created?

    for example, if the following are all true, i have a script i call...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Long runing query

    same issue that i saw in the other thread i think;

    the mix of old vs new style joins is causing a cross join and increasing the rows processed:

    select distinct a.empnumber,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: table scan problem

    ...from Vwrevenue as a inner join #revdates as b on a.empnumber = b.empnumber, #daterange

    i think because you inner join one table, and then use a comma to join the old...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Tally table and substring error

    Thanks Wayne;

    I think the minor tweak Lynn suggested is better; the change you made gives some inaccurate/unexpected results, even though the code runs without error:

    i think it's because i was...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 9,886 through 9,900 (of 13,460 total)