Error while disabling publishing and distribution - sql

Hi I delete all publications and subscriptions on sql server 2008 . Then try to disabling publishing and distribution for reconfigure replication but have an error :
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Invalid object name 'dbo.sysmergesubscriptions'.
Changed database context to 'master'. (Microsoft SQL Server, Error: 208) Ho solve it ?

One thing you can do is: create that object by yourself. Most likely there would be more than one table/view missing. Just script those missing objects from another database (for example, develop environment) and create them in your production box.

Related

SQL Azure Export Data-Tier Application & import into local SQL server

I have a SQL Azure database. I'm able to export the Database using Tasks > Export Data Tier Application. This is successful.
I then try to use Import Data Tier Application in my local SQL server and I get the following error:
Could not import package. Warning SQL0: A project which specifies
Microsoft Azure SQL Database v12 as the target platform may experience
compatibility issues with SQL Server 2008. Warning SQL72012: The
object [db_Data] exists in the target, but it will not be dropped even
though you selected the 'Generate drop statements for objects that are
in the target database but that are not in the source' check box.
Warning SQL72012: The object [db_Log] exists in the target, but it
will not be dropped even though you selected the 'Generate drop
statements for objects that are in the target database but that are
not in the source' check box. Error SQL72014: .Net SqlClient Data
Provider: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near
'CREDENTIAL'. Error SQL72045: Script execution error. The executed
script: CREATE DATABASE SCOPED CREDENTIAL [databasenameAzureStorageCredential]
WITH IDENTITY = N'SHARED ACCESS SIGNATURE';
I have SQL Server Management Studio 14.0.17289.0 and everything is up to date.
I have read different posts on Stack overflow and done some googling but unsure the best way to move forward. How can I solve this?
It seems like there is a compatibility mode differences in your local SQL server DB and Azure SQL server DB. Check your compatibility level and if it is mismatched here is the resource to solve that. The error was because you use SSMS version 'X' to generate the bacpac against Azure SQL version 'Y'. Try to generate the same bacpac using SSMS version 'Y' and it works for me.
Please download the latest version of SQL Server Management Studio from here to have the best user experience with Azure SQL Database. SSMS v14 is too old. The current version of SSMS is v17.9.
Remove (drop) the database scoped credential named "databasenameAzureStorageCredential" before exporting the database. The following query should give you a list of credentials created.
SELECT * FROM sys.database_scoped_credentials
In general, you need to remove references to external sources before exporting your database.

PWM SQL database unable to create table

I am trying to setup a PWM server but when I get to the Database Remote Connection I get the error below which appears to be the sql database unable to create a table. I have reviewed the logs and they state that the connection to the SQL database was successful. When I go to the SQL database and manually try to add a table it also fails.
unable to initialize database: exception initializing database service: 5051 ERROR_DB_UNAVAILABLE (error creating new table PWM_META: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'value TEXT )' at line 3)

SSRS - Renamed TempDB and now Subscription Reports not Emailing

I'm currently unable to email out time based subscription reports from SSRS on a new SQL Server 2012 installation on Server 2012.
I receive the following error in the SSRS LogFiles
schedule!WindowsService_5!dc4!10/14/2013-10:01:09:: i INFO: Handling Event TimedSubscription with data 1a762da1-75ab-4c46-b989-471185553304.
library!WindowsService_5!dc4!10/14/2013-10:01:09:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: , An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.;
library!WindowsService_5!dc4!10/14/2013-10:01:09:: w WARN: Transaction rollback was not executed connection is invalid
schedule!WindowsService_5!dc4!10/14/2013-10:01:09:: i INFO: Error processing event 'TimedSubscription', data = 1a762da1-75ab-4c46-b989-471185553304, error = Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. ---> System.Data.SqlClient.SqlException: Invalid object name 'ReportServerTempDB.dbo.ExecutionCache'.
Databases were migrated from SQL 2008, this was done by a third party and I'm unsure if something was overlooked.
Any assistance would be greatly appreciated.
Thank you.
Dane
This thread seems to address your issue.
http://www.sqlservercentral.com/Forums/Topic553765-147-1.aspx
Please do a modicum of research before posting error messages.
From the Link
"
After much consternation, I have found a trigger referencing the invalid object. Trigger [Schedule_UpdateExpiration] on ReportServer table Schedule has the offending reference in it. In test, I altered this trigger to reference the correct report server tempdb and now subscriptions appear to be working properly. So far I have found nothing else broken."
AND
"If anyone is looking for a quick answer then here is what I did to solve my problem:
Updated trigger on dbo.schedule to reference the correct tempdb.
Scripted all stored procedures with their permissions onto a new query then "find and replaced" all instances of the old tempdb with the new one. "
After a while searching for a solution to fix this issue, I found that this is caused by the jobs definition of SQL Server Agent was not fully migrated to the new service. For every subscription created in SSRS, there is an associated job defined in SQL Server Agent. For services reply heavily on report delivery via subscriptions, it's best to export those jobs definition and import them into the new server.
Daniel E. answer is Correct.
I have spend a lot of time to find it and the error I am getting while updating the existing subscriptions
“An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. (rsReportServerDatabaseError)”
when i search online with the above error, i couldn't manage to fix it. after a long time i found the tigger is pointing to old database.
Temp database in the below: [ReportServerTempDB]
after updating to correct tempDB all started working fine.
ALTER TRIGGER [dbo].[Schedule_UpdateExpiration] ON [dbo].[Schedule]
AFTER UPDATE
AS
UPDATE
EC
SET
AbsoluteExpiration = I.NextRunTime
FROM
[ReportServerTempDB].dbo.ExecutionCache AS EC
INNER JOIN ReportSchedule AS RS ON EC.ReportID = RS.ReportID
INNER JOIN inserted AS I ON RS.ScheduleID = I.ScheduleID AND RS.ReportAction = 3

SQL Server 2008 R2, cant create a new DB

Having real problems creating a DB on my version of SQL Server 2008 R2 Express.
I've followed the links to the below but no info provided.
Thanks in advance for any help.
TITLE: Microsoft SQL Server Management Studio
Create failed for Database 'test'.
(Microsoft.SqlServer.Smo)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing
a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
Directory lookup for the file
"D:\DATA\test.mdf" failed with the
operating system error 2 (failed to
retrieve text for this error. Reason:
15100). CREATE DATABASE failed. Some
file names listed could not be
created. Check related errors.
(Microsoft SQL Server, Error: 5133)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476
I would assume the issue has to do with the creation of the mdf file in your D:\Data folder. Can you verify that you have the permissions you need to that location and that you have enough free space? Also, be sure there isn't already an mdf file by that name at that location.
open the DB properties and on the files page (on the right panel) make sure that you dont have database files with duplicate names. if there are change their names

Can't create branch TFS 2008 - Error 8152

I'm trying to create a new development branch from main (our first branch) but with no luck.
I've tried google but google doesn't seem to want to help me today...
The error i receive is this:
A database error occurred (SQL error 8152) ---> String or binary data would be truncated.
SRV-TFS.TfsVersionControl..prc_PendBranch: Database Update Failure - Error 8152 executing INSERT statement for tbl_PendingChange
please check the name of your branch. I think its too long that TFS database allows.