我正在使用此代碼:SQL數據庫到另一臺PC-SQL數據庫
SqlCommand cmd = new SqlCommand(" MERGE customermaster AS target USING Tamio.dbo.memberform AS source ON target.id = source.id WHEN MATCHED THEN UPDATE SET target.name = source.name WHEN NOT MATCHED THEN INSERT (id, name) VALUES (source.id, source.name);", con);
我想從我的本地數據庫中進行選擇。
我嘗試這一點,但它說,不正確的語法
SqlCommand cmd = new SqlCommand(" MERGE customermaster AS target USING [local]Tamio.dbo.memberform AS source ON target.id = source.id WHEN MATCHED THEN UPDATE SET target.name = source.name WHEN NOT MATCHED THEN INSERT (id, name) VALUES (source.id, source.name);", con);
而且這是我的本地連接
SqlConnection con = new SqlConnection(@"Data Source=(local);Initial Catalog=Tamio;Integrated Security=True");
,這是我的客戶端PC連接
SqlConnection conn = new SqlConnection(@"Data Source=192.168.1.101;Initial Catalog=Imatismos;user ID=admin;Password=1234");
你想要存檔什麼? –