Try to search your question here, if you can't find : Ask Any Question Now ?

Cannot escape $ in table name within SQL query in powershell script

HomeCategory: stackoverflowCannot escape $ in table name within SQL query in powershell script
Avatarbhawya asked 1 month ago

I am trying to run a SQL query in my powershell script. Unfortunately some of the tables in the database contain $’s. in this case one of the tables is

ServiceManager.dbo.MT_System$WorkItem$Incident

without any thing changed the table in the SQL Query becomes

ServiceManager.dbo.MT_System

If i use the standard escape character of ‘ it then becomes

ServiceManager.dbo.MT_System”

If i add another $ it becomes

ServiceManager.dbo.MT_System’}WorkItem’}Incident

I tried surrounding the $ with qoutes which results in

ServiceManager.dbo.MT_System’$’WorkItem’$’Incident

any help would be apreciated

1 Answers
Best Answer
AvatarFernando answered 1 month ago
Your Answer

1 + 6 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com