Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store fields info into one field?
Message
 
To
13/07/2006 16:23:46
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01136213
Message ID:
01136228
Views:
9
>Not so simple Borislav :-)
>
>I need to select all fields, but I don't know the name of all fields... because it could be any table... my function must be general...
>
>I have already did the following, but I cannot store the result into a field or at least into a variable. How can I do that?
>
>
>SELECT * FROM inserted FOR XML AUTO
>
>
>In SQL Help, I found this:
>For example, subselect as shown in this example is NOT supported:
>
>
>DECLARE @doc nchar(3000)
>SET @doc = (SELECT * FROM Customers WHERE CustomerID = 'ALFKI' FOR XML RAW)
>
Pity,
I thought I would get stars here :-))))


Here what works.
Unfortunately I have only SQL 2005 installed on my computer and can't test this on SQL 2000
DECLARE @doc nchar(3000)
SELECT @doc = (SELECT * FROM Customers WHERE CustomerID = 'ALFKI' FOR XML RAW)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform