|
Thread: hi!
-
Nov 7th, 2000, 01:46 PM
#1
Thread Starter
Fanatic Member
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!!
-
Nov 7th, 2000, 03:10 PM
#2
Frenzied Member
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..
-
Nov 7th, 2000, 05:01 PM
#3
Thread Starter
Fanatic Member
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??
-
Nov 7th, 2000, 09:42 PM
#4
Frenzied Member
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..
-
Nov 8th, 2000, 08:09 AM
#5
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|