sreenivasa k

sreenivasa k

  • 883
  • 893
  • 33.9k

Altering a SQL View from C#, Ado.Net

May 20 2023 11:25 PM

Hi, I would like to alter a sql view from C#, Ado.net. I am using frontend as c# and backend as SQL Server.

I tried below options:

option#1:  alter view vw_employeesbyId as select ename,location,email from dbo.employees where empid = @empid 

 

option#2:

var sql = @"alter view vw_employeesbyId as select ename,location,email from dbo.employees where empid = @empid ";

Exec sp_ExecuteSql (sql)

Option3: 

Drop the view and create view from c#

all 3 options not worked. any other thougths are appreciated

 

Thanks,

Sreenivasa Rao K

 


Answers (4)