Unable to delete trace in SSAS - sql-server

I created a trace in SSAS but I'm unable to delete it.
Fairly new to SSAS and not really sure how to get around this.
Version: 14.0.249.83
Tried deleting it with this:
<Delete xmlns="https://schemas.microsoft.com/analysisservices/2003/engine" xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/">
<Object>
<TraceID>12345</TraceID>
</Object>
</Delete>
But I end up with this error.
Executing the query ...
The Delete element at line 7, column 146 (namespace https://schemas.microsoft.com/analysisservices/2003/engine) cannot appear under Envelope/Body/Execute/Command.
Run complete

Related

Why is AM XML file re-shuffling when adding a VO to it?

I am using Oracle ADF and JDeveloper 12c (12.2.1.12.54). I added a new VO to an existing AM via the JDeveloper GUI. Usually, when I do that, it just adds three new lines to the source XML of the AM, stating the local VO name and package name. Something like this:
<ViewUsage
Name="TestVO1"
ViewObjectName="com.user.view.TestVO"/>
When I added the new VO, other than adding these three lines, it was also re-shuffling the rest of the XML, like moving some methods from line 400 to 600 and vice-versa. Not sure why it is doing that. Also, the line count reduces from 1200 to 800.
I am new to the framework and the IDE and cannot post the actual code. Any help is much appreciated. Thank you.

ColdFusion 9.01 -> Lucee 5.3.3.62 and <cfinsert> / <cfupdate>

I’ve inherited a big application which is running on CF 9.01.
I’m in the process to port it to Lucee 5.3.3.62, but have some problems with and
I know that I should replace it with , but this application has ~1000 source files (!!), and replacing all those tags is currently not obvious for timing reasons.
Lucee is throwing errors like:
“An object or column name is missing or empty. For SELECT INTO
statements, verify each column has a name. For other statements, look
for empty alias names. Aliases defined as “” or are not allowed.
Change the alias to a valid name.”
At first, I thought there were problems with date field, because Lucee is handling them differently than CF 9.01, but this is not the case.
So, I created a test table (on MS-SQL Server 2008R2):
CREATE TABLE [dbo].[LuceeTest01](
[Field1] [nvarchar](50) NULL,
[Field2] [nvarchar](50) NULL ) ON [PRIMARY]
In Lucee, I’m using as datasource: Microsoft SQL Server (Vendor Microsoft), called “one”
This is my test application:
<cfset Form.Field1 = "Field1">
<cfset Form.Field2 = "Field2">
<cfoutput>
<cfinsert datasource="one"
tablename="LuceeTest01"
formfields="Field1, Field2">
</cfoutput>
When I run this, I get the same error. Any idea why?
Full trace here: https://justpaste.it/6k0hw
Thanks!
EDIT1:
Curious. I tried using “jTDS Type 4 JDBC Driver for MS SQL Server and Sybase” as datasource driver, and now the error is:
The database name component of the object qualifier must be the name
of the current database.
This traces back to this statement:
{call []..sp_columns 'LuceeTest01', '', '', 'null', 3}
When I try this in the Microsoft SQL Server Management Studio, I get the same error.
However, when I specify the database name (‘one’ as third argument), no error in MS SQL SMS.
EXEC sp_columns 'LuceeTest01', '', 'one', 'null', 3
Shouldn’t Lucee take this argument from the datasource configuration or something?
EDIT2:
As suggested by #Redtopia, when "tableowner" and "tablequalifier" are specified, it works for the jTDS driver. Will use this as workaround.
Updated sample code:
<cfset Form.Field1 = "Field1">
<cfset Form.Field2 = "Field2">
<cfinsert datasource="onecfc"
tableowner="dbo"
tablename="LuceeTest01"
tablequalifier="one"
formfields="Field1,Field2">
EDIT3:
Bug filed here: https://luceeserver.atlassian.net/browse/LDEV-2566
I personally would refactor CFINSERT into queryExecute and write a plain InsertInto SQL statement. I wish we would completely remove support for cfinsert.
Consider using
<cfscript>
Form.Field1 = "Field1";
Form.Field2 = "Field2";
// Don't forget to setup datasource in application.cfc
QueryExecute("
INSERT INTO LuceeTest01 (Field1, Field2)
VALUES (?, ?)
",
[form.field1, form.field2]
);
</cfscript>
I am 99% confident that this is a Lucee / JDK / JDBC Driver bug and not a fault in your config.
Source:
I initially suspected some low-hanging fruit such as your leading whitespace in ' Field2'. Then I saw your comment showing that you had tried with that trimmed and your Edit1 with the different error when using a different DB Driver. So I set to work trying to reproduce your issue.
On Lucee 5.2.4.37 and MS SQL Server 2016, armed with your sample code and two new datasources - one each for jTDS (MSQL and Sybase) driver and Microsoft SQL Server (JDBC4 - Vendor Microsoft) on SQL, I was unable to reproduce either issue on either driver. Even when selectively taking away various DB permissions and changing default DB for the SQL user, I was still only able to force different (expected) errors, not your error.
As soon as I hit the admin update to Lucee 5.3.3.62 and re-ran the tests, boom I hit both of your errors with the respective datasources, with no other change in DB permissions, datasource config or sample code.
Good luck convincing the Lucee guys that this anecdotal evidence is proof of a bug, but give me a shout if you need an extra voice. Whilst I don't use cfinsert/cfupdate in my own code, I have in the recent past been in the position of supporting a legacy CF application of similar sounding size and nature and empathise with the logistical challenges surrounding refactoring or modernising it!
Edit:
I tried the tablequalifier suggestion from #Redtopia in a comment above. Adding just the tablequalifier attribute did not work for me with either DB driver.
Using both tablequalifier="dbname" and tableowner="dbo" still didn't work for me with the MS SQL Server driver, but does seem to work for the jTDS driver, so it's a possible workaround meaning changing every occurrence of the tag, so ideally the Lucee guys will be able to fix the bug from their end or identify which Java update broke it if Lucee itself didn't.

SQL Server- An older report .rdl opens only XML even in Report Builder. How to convert the XML to SQL?

An older report I am trying to edit, when opened in the MSVS Report Builder, only opens XML. Can't read any SQL.
The code reads as follows:
<Hierarchies>
<Hierarchy>
<BaseEntity>
<!--Plate-->
<EntityID>G121a636b-1459-40b5-9b58-7e427e6b5ce8</EntityID>
</BaseEntity>
<Groupings>
<Grouping Name="Account">
<Expression Name="Account">
<Path>
<RolePathItem>
<!--Account-->
<RoleID>G26e62fb8-dd29-4f29-ae1d-232cd94977e3</RoleID>
</RolePathItem>
</Path>
<EntityRef>
<!--Account-->
<EntityID>Gf797726f-8cff-417a-992e-c532e2906775</EntityID>
</EntityRef>
</Expression>
<Details>
......
.....
...
Any idea how I can read or convert this to SQL?
I just opened the file in Notepad, edited out the values I needed to and pasted the code back in the file and ran the report. Worked fine.
Unfortunately, this was just a work-around and not a real solution to it.

How to make SSDT Profile.xml SqlCmdVariable an empty string or optional

I am using SSDT (and sqlproj) for our MSSQL projects. We have a few variables we need to set when publishing to each environment.
This works great on most of our environments where we assign values to all of the variables, but when we publish to our live database, I would like to be able to make the DomainPrefix a blank string.
When I try to alter the Live.profile.xml to set DomainPrefix to no value I get the error:
"An error occurred during deployment plan generation. Deployment cannot continue. Missing values for the following SqlCmd variables:DomainPrefix."
This what I would like the Live.profile.xml to look like:
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<TargetDatabaseName>DB_NAME</TargetDatabaseName>
<DeployScriptFileName>DB_NAME.sql</DeployScriptFileName>
<TargetConnectionString>CONNECTION_STRING</TargetConnectionString>
<ProfileVersionNumber>1</ProfileVersionNumber>
</PropertyGroup>
<ItemGroup>
<SqlCmdVariable Include="DomainPrefix">
<Value></Value>
</SqlCmdVariable>
<SqlCmdVariable Include="Environment">
<Value>live</Value>
</SqlCmdVariable>
</ItemGroup>
</Project>
Does anyone know how to set a SqlCmdVariable to a blank value or make it an optional variable?
Using:
VS 2013 sqlproj
SqlPackage.exe to run the publish to the DB from command line
There does not appear to be any way of passing through a NullOrWhiteSpace string as a SqlCmdVariable. The basic syntax for SqlCmdVariable is:
<SqlCmdVariable Include="DomainPrefix">
<DefaultValue>
</DefaultValue>
<Value></Value>
</SqlCmdVariable>
Either Value or DefaultValue needs to have some non-white space value.
So, for your first option, as #Peter suggested in a comment on the question, you can handle this in your Post Deployment SQL script by testing for a specific value, such as <Live> or whatever. Do something like the following:
DECLARE #DomainPrefix NVARCHAR(50) = N'$(DomainPrefix)';
IF (#DomainPrefix = N'<Live>')
BEGIN
SET #DomainPrefix = '';
END;
And then just concatenate #DomainPrefix to the strings instead of including $(DomainPrefix) in them.
Of course, if you need the SQLCMD variable to be available in the main T-SQL context and not just as a T-SQL variable (for example, if you are using this as a Linked Server or Database prefix along the lines of UPDATE $(DomainPrefix)[DatabaseName].[dbo].[TableName]... where $(DomainPrefix) is usually defined as [LinkedServerName]. ), then you should be able to get away with using a Value of /**/ (or even /* Live */ ) so that the resulting T-SQL would interpreted as either:
UPDATE [LinkedServerName].[DatabaseName].[dbo].[TableName]...
or:
UPDATE /* Live */[DatabaseName].[dbo].[TableName]...
both of which are valid T-SQL and work. So in this case you would use the following:
<SqlCmdVariable Include="DomainPrefix">
<Value>/* Live */</Value>
</SqlCmdVariable>

Cannot update, READ-ONLY - Visual Foxpro

This is my code
CURSORSETPROP("Buffering",4)
SELECT course
APPEND BLANK
replace course.name with thisform.txt_course.value
this works fine during the development of the project, however,when i convert the project to .exe file, I cant write to the table and it brings the error
Cannot update the cursor course, since it is read-only
I've manage to find for what i thought was the solution which is the code below
CURSORSETPROP("Buffering",4)
SELE * FROM course INTO CURSOR cCourse READWRITE
APPEND BLANK
replace cCourse.name with thisform.txt_course.value
But the problem is that this code does not write to the table. I mean there was no error about being the table read-only, however there are no additional file added/appended to the table "course"
Can anyone lend me a hand here, i have no idea where to find a solution.
Vfp Error 111 itself, Cannot update the cursor ..., can be caused by a DBF table being included in the VFP Project Manager. If so, you can right click it in the PM and "Exclude".
There is however a mistake in the code you posted: The CURSORSETPROP line affects the alias in the current "work area", which could be anyone or even none, unless you would use the cAlias parameter of the function.
(Or, as a second best way, do the Select before the CursorSetProp().)

Resources