>E' possibile sapere, leggendo la struttura della tabella, se
>una determinata colonna e di tipo "Colonna Calcolata"?
Ciao Vincenzo,
Puoi ricorrere alla funzione COLUMNPROPERTY come nel seguente esempio:
USE tempdb;
CREATE TABLE dbo.Students(
StudentID int NOT NULL PRIMARY KEY,
FirstName varchar(10) NOT NULL,
LastName varchar(10) NOT NULL,
FullName AS FirstName + ' ' + LastName
);
INSERT dbo.Students VALUES
(1, 'Lorenzo', 'Benaglia')
, (2, 'David', 'De Giacomi')
, (3, 'Alessandro', 'Alpi');
SELECT *
, COLUMNPROPERTY(OBJECT_ID('Students'), 'FirstName', 'IsComputed') AS IsFirstNameComputed
, COLUMNPROPERTY(OBJECT_ID('Students'), 'FullName', 'IsComputed') AS IsFullNameComputed
FROM dbo.Students;
/* Output:
StudentID FirstName LastName FullName IsFirstNameComputed IsFullNameComputed
----------- ---------- ---------- --------------------- ------------------- ------------------
1 Lorenzo Benaglia Lorenzo Benaglia 0 1
2 David De Giacomi David De Giacomi 0 1
3 Alessandro Alpi Alessandro Alpi 0 1
(3 row(s) affected)
*/
DROP TABLE dbo.Students;
Per maggiori informazioni consulta i Books Online:
http://msdn.microsoft.com/en-us/library/ms174968.aspx
>Grazie per l'aiuto
Prego.
Ciao!
--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo/
http://italy.mvps.org