c# - How to get table/view name (i.e. remove schema prefix) -


given 1 of following strings (which represent table/view name in sql server):

var x = "[my-table.request]";  var x = "[dbo].[my-table.request]"; var x = "dbo.[my-table.request]"; 

i table name (by c# code): my-table.request

any ideas? have missed possible representations here?

quite via parsename in tsql:

parsename(@x, 1) 

with edit want in c#, you'd have write scratch in c#, tokenizing ., [, ]. afaik there no pre-canned implementation you.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -