General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Have you tried...
SET FMTONLY ON
SELECT ... (no where filter)
SET FMTONLY OFF
BOb
>Hello all!
>
>I am having trouble with accomplishing a specific task. I have poured over the help file and through some books, and by all accounts, what I'm attempting in T-SQL should work. But perhaps there is something else I am missing, so let me explain a little regarding my scenario:
>
>I need to generate an XML structure (no records) for any given table. The problem is, if I query SQL Server through a URL that has a zero record result set, all I get back is the root node. I need this structure so that I can create a new record for any table.
>
>I know that I could query the system tables and perform a stylesheet translation to convert the result set of fields into the desired structure. However, I have my concerns about performance to do this.
>
>I know that I could insert a new blank record into the table and query it back out. However we are in a stateless environment and there is no guarantee that the inserted record would actually be committed. (Someone might lose their internet connection, etc.)
>
>So I thought I could create a temporary table with no records based on the structure of the given table. I DO NOT want to explicitly create the structure. So I thought I might do this with SELECT INTO. That seems to work fine. However, when I attempt to insert an empty record into the temporary table, I receive an error stating that the Temporary Table is an invalid object.
>
>What am I missing here?
>
>TIA.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only