Kod Kütüphanem ama elime ne gelirse burada dursun diye…

SQL ve XML

DECLARE @XML XML='<IDLIST><ID VALUE="00000000-0000-0000-0000-000000000000"/></IDLIST>'

DECLARE @docHandle INT
CREATE TABLE #tmp
(
ID UNIQUEIDENTIFIER 
)
EXEC sp_xml_preparedocument @docHandle OUTPUT, @XML

INSERT INTO #tmp
SELECT  *
FROM OPENXML (@docHandle, '/IDLIST/ID', 1) WITH(VALUE UNIQUEIDENTIFIER)
EXEC sp_xml_removedocument @docHandle

 

Related articles

STUFF ile istenilen alana ait değerleri “,” ile bir araya getirme

SELECT T2.FieldSomething, STUFF(( SELECT ‘,’ T1.Field FROM Table1 T1 WHERE T1.IDField =T2.IDField ORDER BY T1.Field FOR XML PATH(”) ), 1, 1, ”) AS FieldName FROM Table2 T2  

Learn More

Group by Day – Örnekleri ile

Grouping By Day Of month: In order to group the data by day you can use sql server in built DAY() funtion. Grouping By Day Of week: For this you can use DATEPART(weekday,[date column]) Grouping By week: For this you can use DATEPART(week,[date column]) Grouping By DAY of Year: For this you can use DATEPART(dayofyear,[date […]

Learn More

Veritabanındaki Tablodan Class Üretmek (Generate Class from database table)

declare @TableName sysname = ‘TableName’ declare @Result varchar(max) = ‘public class ‘ + @TableName + ‘ {‘ select @Result = @Result + ‘ public ‘ + ColumnType + NullableSign + ‘ ‘ + ColumnName + ‘ { get; set; } ‘ from ( select replace(col.name, ‘ ‘, ‘_’) ColumnName, column_id ColumnId, case typ.name when ‘bigint’ […]

Learn More

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir