4Learning
asked on
creating tempdb from sybase
Hi,
I am unable to create a temporary table in the tempdb database from within a stored proc in a test database. However when I go directly to the tempdb database I am able to create temp tables. Can anyone tell me what is going wrong...
Eg:
Use my_test_db
create proc procname
as
----- procedure code
create table tempdb..mytemptable1 ( col1 int null)
go
<<<<Result: Stored Proc not created>>>>
When I switch to tempdb and give the following command
create table tempdb..mytemptable1 (col1 int null)
... the table is successfully created in tempdb database.
Please help...
Thanks!
I am unable to create a temporary table in the tempdb database from within a stored proc in a test database. However when I go directly to the tempdb database I am able to create temp tables. Can anyone tell me what is going wrong...
Eg:
Use my_test_db
create proc procname
as
----- procedure code
create table tempdb..mytemptable1 ( col1 int null)
go
<<<<Result: Stored Proc not created>>>>
When I switch to tempdb and give the following command
create table tempdb..mytemptable1 (col1 int null)
... the table is successfully created in tempdb database.
Please help...
Thanks!
What is the error message you receive?
ASKER
Yes, I did try and #mytemptable1( col1 int null) works fine. The reason I am trying to use tempdb instead of # is because I want to see the values in those tables during my development phase.... even after the stored proc has finished execution.
I am not getting any error messages. As I mentioned earlier, I am able to create tempdb tables when I directly log into tempdb, but cannot create those same tables from within a stored procedure with a create table command.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solution available
create table #mytemptable1 ( col1 int null)