SQL Server Error 208: Invalid object name 'Utils.dbo.ChangeLogging_DDLCommands' - sql

When trying to change the user account to link with the NewMary login:
EXEC sp_change_users_login 'Update_One', 'Mary', 'NewMary'
go
I get the error 208:
Msg 208, Level 16, State 1, Procedure ChangeLogging_LogDDLCommands, Line 147
Invalid object name 'Utils.dbo.ChangeLogging_DDLCommands'.
I don't find any relevant information on ChangeLogging_DDLCommands, and I'm lost at how I do have to proceed from there.

Sounds like you have some kind of custom trigger, which is missing this object.
In SSMS:
Check server triggers under "Server Objects" > "Triggers"
Check individual database DDL triggers under "Programmability" -> "Database triggers"

Related

Invalid object name 'sys.dm_exec_input_buffer'

I'm trying to start a script in SQL Server 2014, but it can't find the object in question.
This is the query I am trying to initiate:
SELECT * FROM sys.dm_exec_input_buffer(##SPID, NULL);
Error message:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.dm_exec_input_buffer'.
You need to be on at least Service Pack 2. If you're on an earlier service pack, it's time to patch.
Here's a link to Service Pack 3
Here's a link to the most recent update for SP3
Please apply both, in that order.

SQL Insert Statement causing error in Oracle

I'm trying to do this
INSERT INTO INSPECTIONOFFICE (INSPOFFICE_ID, INSPOFFICE_NAME, INSPOFFICE_STREET, INSPOFFICE_CITY, INSPOFFICE_STATE, INSPOFFICE_ZIPCODE, INSPOFFICE_CONTPERSONFNAME, INSPOFFICE_CONTPERSONLNAME, INSPOFFICE_CONTPERSONPHONE, INSPOFFICE_CONTPERSONEMAIL)
VALUES (12, 'InspectionOffice1', '121 Ames st', 'Omaha', 'NE', 68128, 'Brad', 'Foley', '4022853487', 'BradFoley#gmail.com');
but I get an error
Error starting at line : 22 in command -
INSERT INTO INSPECTIONOFFICE (INSPOFFICE_ID, INSPOFFICE_NAME, INSPOFFICE_STREET, INSPOFFICE_CITY, INSPOFFICE_STATE, INSPOFFICE_ZIPCODE, INSPOFFICE_CONTPERSONFNAME, INSPOFFICE_CONTPERSONLNAME, INSPOFFICE_CONTPERSONPHONE, INSPOFFICE_CONTPERSONEMAIL)
VALUES (12, 'InspectionOffice1', '121 Ames st', 'Omaha', 'NE', 68128, 'Brad', 'Foley', '4022853487', 'BradFoley#gmail.com')
Error at Command Line : 22 Column : 13
Error report -
SQL Error: ORA-04098: trigger 'JMEEK.INSPECTIONOFFICE_INSPECTIONOFF' is invalid and failed re-validation
04098. 00000 - "trigger '%s.%s' is invalid and failed re-validation"
*Cause: A trigger was attempted to be retrieved for execution and was found to be invalid. This also means that compilation/authorization failed for the trigger.
*Action: Options are to resolve the compilation/authorization errors, disable the trigger, or drop the trigger.
Any idea how to fix this?
seems you do not have permission access to the trigger JMEEK.INSPECTIONOFFICE_INSPECTIONOFF
or have some compilation problem with it...
you should take a look in the trigger.
or if you don't know what a trigger is, call a experienced job's teammate. :)
btw, if you are alone, and it don't matter too much.. you can disable / drop the trigger..
this command disable, you can enable later
ALTER TRIGGER JMEEK.INSPECTIONOFFICE_INSPECTIONOFF DISABLE;
this command drop the trigger, you will lose it forever (if you don't have a backup)
drop trigger JMEEK.INSPECTIONOFFICE_INSPECTIONOFF;
The trigger JMEEK.INSPECTIONOFFICE_INSPECTIONOFF, which I am guessing you wrote because it's in the JMEEK schema, which (again I'm guessing) seems to be yours, is invalid, meaning it has compilation errors. To find out what those errors are you should execute the query
SELECT *
FROM ALL_ERRORS
WHERE OWNER = 'JMEEK' AND
NAME = 'INSPECTIONOFFICE_INSPECTIONOFF'
ORDER BY SEQUENCE
None of us can do much else for you because we don't know what this trigger looks like. If you need to see the source code you can execute the following query:
SELECT LINE, TEXT
FROM ALL_SOURCE
WHERE OWNER = 'JMEEK' AND
NAME = 'INSPECTIONOFFICE_INSPECTIONOFF'
ORDER BY LINE
Or you can use an IDE such as Oracle's free SQL Developer product which will make all this a lot easier for you.

Trying to enter Diagnostic connection

SQL Server 2014, SP3 Need to establish diagnostic connection. When I open Mgmt Studio, click on database engine query, and type in admin:MSSQLSERVER (we use the default instance on this box) I get:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'MSSQLSERVER'
Can someone tell me the correct syntax?
I have tried:
admin:servername\MSSQLSERVER
admin:servername
both give same syntax error near whatever is first typed after the colon.
Issue resolved:
When I click on the Database Engine Query button, in the login screen that pops up, put ADMIN: in front of the server name, and connect. This worked for me.

Querying Active Directory with T-SQL

Have tried:
EXEC master.dbo.sp_addlinkedserver
#server = N'ADSI',
#srvproduct=N'Active Directory Services',
#provider=N'ADsDSOObject',
#datasrc=N'server_name.your_domain.com'
EXEC master.dbo.sp_addlinkedsrvlogin
#rmtsrvname=N'ADSI',
#useself=N'False',
#locallogin=NULL,
#rmtuser=N'your_domain\domain_user',
#rmtpassword='********'
SELECT *
FROM OPENQUERY (ADSI, 'SELECT *
FROM ''LDAP://DC=your_domain,DC=com''')
Getting this error:
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT * FROM 'LDAP://DC=your_domain,DC=com'" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".
I have already confirmed mine and the SQL Server Service domain accounts have read access to AD, and that the "Allow inprocess" is enabled on the ADsDSOObject provider is selected.
Any thoughts would be appreciated.
Every example I could find had: LDAP://DC=your_domain,DC=com as syntax. Well for our server (and maybe other's) it is: LDAP://DC=your_domain,DC=internal
As suggested by someone, I used the Softerra LDAP browser (free) and opened the server, clicked on the top node and found distinguished name entry listed as: DC=your_domain,DC=internal
Once I made that change, I could see the AD data.

SQL SERVER 2016 R Services -- SQL Server does not exist or access denied

I was trying to learn the new feature -- R in SQL Server 2016 and I was following this link as example.
I set up SQLRUserGroup as a new login and was able to run some R scripts, but the data_preprocess_score.sql gives me the following error message and it looked like related to connection.
Here is what I tried to call the sproc:
EXEC data_preprocess_score #testlength = 1, #id1value = 2, #id2value = 1,
#connectionString = 'SERVER=.;DATABASE=Test;Trusted_Connection=true;`'
Below is the error message:
Msg 39004, Level 16, State 20, Line 1
A 'R' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 1, Line 1
An external script error occurred:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
Error in doTryCatch(return(expr), name, parentenv, handler) :
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
Calls: source ... tryCatch -> tryCatchList -> tryCatchOne -> doTryCatch -> .Call
In addition: Warning message:
In Ops.factor(tsvalues, value.threshold) : '>' not meaningful for factors
Error in ScaleR. Check the output for more information.
Error in eval(expr, envir, enclos) :
Error in ScaleR. Check the output for more information.
Calls: source -> withVisible -> eval -> eval -> .Call
Execution halted
STDOUT message(s) from external script:
Rows Read: 166, Total Rows Processed: 166Caught exception in file: CxAnalysis.cpp, line: 6488. ThreadID: 14112 Rethrowing.
[Microsoft][ODBC Driver Manager] Connection not open
ODBC Error in SQLDisconnect
Caught exception in file: CxAnalysis.cpp, line: 5682. ThreadID: 14112 Rethrowing.
Caught exception in file: CxAnalysis.cpp, line: 5249. ThreadID: 14112 Rethrowing.
Can someone help me with this error?
Thanks!
Add Driver=SQL Server to the front of your connection string. It wouldn't hurt to set Server=localhost too.
EXEC data_preprocess_score #testlength = 1, #id1value = 2, #id2value = 1,
#connectionString = 'Driver=SQL Server;SERVER=localhost;DATABASE=Test;Trusted_Connection=true;'
If you are able to run R scripts to get data, but get the following error with when writing data with rx functions like rxPredict/rxDataStep:
DBNETLIB; SQL Server does not exist or access denied
Then, you may be hitting an issue with loop back connections to SQL Server from R script. Please check the following configurations required for loop back connections:
Implied Authentication for Launchpad Accounts is enabled using instructions here
TCP/IP client protocol is enabled for the Server using instructions here
Specifically in your case, please check for the TCP/IP protocol configuration, since you mentioned the login for SQLRUserGroup was created.