Results 1 to 5 of 5

Thread: hi!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617
    If one writes a stored procedure
    1.) with a drop table statement

    SQL SERVER will not let u create the stored proc
    warning u that the particular table does not exist
    if it is not there

    So, you would need create some form of it

    2) with a select into table statement
    It will tell u that the table already exists (if it exists already)

    Now, how does one create a stored proc with these
    two above statements

    drop table mytable

    select * into mytable from oo

    Thanks in advance!!

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Why would you do that?

    Use temporary tables if you need to create and drop tables within a stored proc. They exist only in the server's memory and live only as long as the proc runs.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    hmm..

    There are good reasons to do this kind of thing especially
    when optimizing queries...

    I solved the prob by splitting the stored proc in 2

    Monte... Thanks for responding...

    P.S Why 96 and not 2000??

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Better model years....

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  5. #5
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Maybe what you really needed to do here was 'Truncate' the table..........or else I missed the point

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width