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 > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php