9 Ocak 2016 Cumartesi

The column name "" is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name "" may appear twice in the view definition.

Merhaba arkadaşlar


The column name ” is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name ” may appear twice in the view definition.


hatasını sql server 2005 2008 2008 r2 ve sql 2012 içerisinde karşılaşabiliriz.Hatta bu hata ile c# ile sqlcommand yada sqldataadaptor kullanımınızda karşılabiliriz.


Çözüm :


Öncelikle datagirişi yaptığınız yani çalıştığınız veritabanındaki ilgili tablonun yapısını kontrol etmeniz gerekecektir.

1-Column içerisinde formula kullanılmış ise formülasyonların doğru yapıldığına emin olmalısınız.

2-


Script olarak sql serverda çalıştırmalısınız.


—–


Öncelikle , mevcut veritabanı, Çalışan tablo varsayalım. Daha sonra SQL sorgusu çalıştırmak SQL server ise:


[php]

SET UPDATE tabloadi

colonadi= ‘sqlogren’,

[/php]


//yaparak tablodaki kolonu güncelleyip güncellemediğini kontrol edelim.Eğer güncellemiyor ise bir constraint tanımlanmış olabilir constraint olup olmadığını kontrol etmeliyiz.


veya


CREATE VIEW viewolustur

AS(

SELECT

colonadi= ‘sqlogren’,

AS Localisimneise

FROM tabloadi

)


UPDATE viewolustur SET

colonadi= ‘sqlogren’,


Eğer aşağıdaki hatayı alıyorsanız ;

The column name ” is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name ” may appear twice in the view definition.


Sebep: Biz aynı sütunda birden fazla güncellemek için bir SQL Server UPDATE bildirimde bulunmuş olabiliriz.


Çözümü


Açıklamada UPDATE, ancak son zamanlarda bir tablonun herhangi bir sütun değerini ayarlayın. örneğin:


UPDATE tabloadi SET

kolon= ‘Scott’


Or


UPDATE tabloadi SET

kolon= ‘sqlogren’


3-Eğer C# The column name ” is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name ” may appear twice in the view definition. hatasını alıyorsanız ;


kullandığınız sqlcommand yada sqldataadapter için; veya entity yapısı için kullandığınız komut cümlesinde 2 kere aynı kolon ismi kullanmadığınız emin olmalısınız.


Hepsi bu kadar kolay gelsin.



The column name "" is specified more than once in the SET clause. A column cannot be assigned more than one value in the same SET clause. Modify the SET clause to make sure that a column is updated only once. If the SET clause updates columns of a view, then the column name "" may appear twice in the view definition.

Hiç yorum yok:

Yorum Gönder