> From: [EMAIL PROTECTED]
> 
> Want to generate temp table name in VFP via SYS(2015) and then create temp 
> table in SQL Server.  I've got a function called CreateTempTable that takes a 
> parm but it's wrong as it creates a temp table that is named the actual parm! 
>  Here's the failed attempt:
> 
> CREATE PROCEDURE dbo.mc_CreateTempSelected (@tcTempName varchar(12))
> AS
> 
> CREATE TABLE [EMAIL PROTECTED] (iMailCampaignID INT)
> GO

Your out foxing yourself.  You have a private temp table for this SP and
then it's gone.  Call it #T1  

You are confusing the use of vars in a macro based language that don't
work in TSQL.  It just doesn't work that way.  Niether do things in
that other M$ language.

This works fine.

CREATE PROCEDURE dbo.mc_CreateTempSelected (@tcTempName varchar(12))
 AS
 
 CREATE TABLE #T1 (iMailCampaignID INT)
 GO








_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to