Multitenancy HowTo-MoveCompanyToTenant Error with SQL 2012
postsaurav
Member Posts: 708
Hi all,
Please reply if anyone know about it.
Implementing Multitenancy in NAV 2013 R2 and SQL Server 2012.
When i am trying to run the Command -
The Power shell is giving me error -
Invoke-Sqlcmd : Incorrect syntax near '-'.
At C:\Multitenancy\HowTo-MoveCompanyToTenant.ps1:112 char:9
+ Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database master -Query $C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Poweshell is Run as administrator.
And to add in it, the command is working fine with SQL Server 2008 R2.
I read there have been some changes in Invoke-SqlCmd in SQL SErver 2012 but there is no update for same in respect to Multitenancy Scripts. I also tried same with the Multitenancy script with Cummulative Update 6 for NAV 2013 R2.
Nothing seems to work.
Please suggest what changes i need to do in HowTo-MoveCompanyToTenant.ps1 so that it can get executed.
Please reply if anyone know about it.
Implementing Multitenancy in NAV 2013 R2 and SQL Server 2012.
When i am trying to run the Command -
HowTo-MoveCompanyToTenant -ServerInstance TEST -DatabaseServer S000 -FromDatabase 'HEAD' -CompanyName 'CHILD' -OldTenantName 'HEAD' -NewTenantName 'CHILD' -ServiceAccount 'NT AUTHORITY\NETWORK SERVICE' -RemoveCompanyWhenMoved
The Power shell is giving me error -
Invoke-Sqlcmd : Incorrect syntax near '-'.
At C:\Multitenancy\HowTo-MoveCompanyToTenant.ps1:112 char:9
+ Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database master -Query $C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Poweshell is Run as administrator.
And to add in it, the command is working fine with SQL Server 2008 R2.
I read there have been some changes in Invoke-SqlCmd in SQL SErver 2012 but there is no update for same in respect to Multitenancy Scripts. I also tried same with the Multitenancy script with Cummulative Update 6 for NAV 2013 R2.
Nothing seems to work.
Please suggest what changes i need to do in HowTo-MoveCompanyToTenant.ps1 so that it can get executed.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 250 Dynamics CRM
- 102 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions