DECLARE @tablename varchar(100)
SET @tablename = N'myTable'
SELECT
clmns.name AS [Name],
usrt.name AS [DataType],
ISNULL(baset.name, N'') AS [SystemType],
CAST(CASE WHEN baset.name IN (N'nchar', N'nvarchar') AND clmns.max_length <> -1 THEN
clmns.max_length/2 ELSE clmns.max_length END AS int) AS [Length],
CAST(clmns.precision AS int) AS [NumericPrecision]
FROM
sys.tables AS tbl
INNER JOIN sys.all_columns AS clmns ON clmns.object_id=tbl.object_id
LEFT OUTER JOIN sys.types AS usrt ON usrt.user_type_id = clmns.user_type_id
LEFT OUTER JOIN sys.types AS baset ON baset.user_type_id = clmns.system_type_id and
baset.user_type_id = baset.system_type_id
WHERE
(tbl.name=@tablename and SCHEMA_NAME(tbl.schema_id)=N'dbo')
ORDER BY
clmns.column_id ASC
Bilgi Bankası Makalelerinde Ara
SQL Kolon Karşılaştırma
Bu makaleyi yararlı buldunuz mu?
İlişkili Makaleler
-
İki Farklı Server Aktarım
INSERT INTO OPENDATASOURCE('SQLNCLI','Data source=192.168.1.6;initial catalog=NETSIS;persist securit... -
could not continue scan with nolock due to data movement
Data s*çmış demektir. Korkma hallolur. Çözümü ise Şöyledir; 1- ... -
SQL INDEX BAKIM
CREATE FUNCTION dbo.index_name (@object_id int, @index_id int)RETURNS sysnameASBEGINRETURN(SELECT na... -
DBCC CHECKDB ILE VERTABANI KONTROLU
DBCC CHECKDBParametre olarak verilen veritabanının bütünlük kontrolleri yapılır. Veri... -
Sql Mail Gönderme
DECLARE @email nvarchar(250) DECLARE @GECIKMISBAKIYE VARCHAR(20) DECLARE @GUN VA...