Re: Creating temp tables in MSSQL
| From: | Frank M. Kromann | Date: | Tue, 16 Dec 2003 22:29:14 +0000 |
| Subject: | Re: Creating temp tables in MSSQL | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32089@lists.php.net to get a copy of this message | ||
Hi,
Any table that starts with # is a temp table. You can use
create table #mytemp (...) or you should be able to use the query you
suggest. You just have to make sure you have enough space in tempdb (a
system database)
- Frank
> Hi all,
>
> I've been handed a query which I'm trying to get to work. I'm using PHP
> to talk to MSSQL 7.
>
> My question is this: Can I create temp tables with mssql without
> executing the code in a stored procedure?
>
> The simplified version of the query is as follows:
> $query = "SELECT distinct convert(varchar(36),traineeID)";
> $query.=" INTO #tempdata1";
> $query.=" FROM tblSignIn_trainee a";
>
>
> Later on I could make a stored procedure, but at the moment I would like
> to just work with the query directly in the code if at all possible.
>
> Thanks,
> John
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>