[英]create sql table in SQLServer with the name of the current session variable c#
我正在用C#開發應用程序。 Net,我需要使用當前會話變量的名稱在sql中創建一個表。 如何將會話變量的值發送到當前sql服務器以創建此查詢? 我的想法是這樣的:在sql server中:
CREATE TABLE Customer_ + 'current user name' // current session variable in c#
(First_Name char(50),
Last_Name char(50),
Address char(50),
City char(50),
Country char(25),
Birth_Date datetime);
非常感謝您的幫助。
您要在C#中將查詢創建為字符串並通過sqlcommand發送嗎? 如果是這樣,請使用
System.Environment.UserName
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.