>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.