Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using Temporary Tables in a javascript

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-03 : 08:45:40
Andy writes "Hi There, I am running an SQL query in a javascript I have written which uses temporary tables. However the java script cannot see the temporary tables created by my SQL statement.
I have had no problems running querys in my java scripts that use normal tables, so what I want to know is, is it possile to use temporary SQL tables in java scripts ?

Looking forward to your reply,
Thanks

Andy"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-06-03 : 09:06:53
SQL Server doesn't use JavaScript to access tables, it uses Transact-SQL. You can use ADO object in JavaScript to interface with a SQL Server table though.

The problem is scope. When you create a temp table, it is only visible to the procedure that created it. Once that procedure/batch finishes, the temp table is automatically dropped and can't be used by a second call to SQL Server.

The only way for us to help you fix this is to post your code so we can see exactly what you're doing. Then we can fix it, or suggest another way to accomplish what you want to do.

Go to Top of Page
   

- Advertisement -