I have two databases (A and B )on the same SQL Server instance. Both have SSB enabled and running fine within themselves. All athorizations are at present set to dbo.
Recently I had a requirement to start a dialog and send a message from within data base A to a queue via a service that is in database B.
I tried coding the SSB instance in the BEGIN DIALOG then I set up a route and tried that. On both occoasions I got the following on sys.transmission_queue
"An exception occurred while enqueueing a message in the target queue. Error: 916, State: 3. The server principal "sa" is not able to access the database "B" under the current security context."
Is this sometjhing to do with security lock downs in 2005?
I am experiencing the same problem, and I can't get the easy fix to work. I drop and create the DB's in between tests, so it is not related to having an old certificate in the DB, as in the case of Tilfried.
The situation is as follows:
DB1 owned by login1, has a user for login2; this DB is for the initiator
DB2 owned by login2, has a user for login1; this DB hosts the target
Both DB's have TRUSTWORTHY flag set to ON
Error in sys.transmission_queue: 'Error 916, State 3: The server principal "Login1" is not able to access the database "DB2" under the current security context.
Going on a limp, I decide to add a remote service binding in DB1, binding the user for Login2 to the target service, even though BOL explicitly states that this is only required for cross-server communications. This does change the situation - I still get an error, but a new message is sys.transmission_queue: "Dialog security is unavailable for this covnersation because there is no certificate bound to the database principal (Id: 5). Either create a certificate for the principal, or specify ENCRYPTION = OFF when beginning the conversation." I already know that the first option works, but I wanted to get the simple solution running. As for the second option, I doublechecked and the initiating procedure DOES already specify ENCRYPTION = OFF in the BEGIN DIALOG CONVERSATION command. My theory is that the remote service binding somehow forces SB to use encryption, but (a) that is not stated in the error message, and (b) if so, then how to get the messages sent over to the target service without using the binding?
==> EDIT: Just saw that you confirmed this theory in your last reply to Tlifried. So I am indeed back to having to find out how to get this to work without remote service binding - it should be possible, but how???
BTW, SELECT @@VERSION shows that I'm on build 3054, in case it matters.
Between all the errors in BOL and less than helpfull error messages produced by SB, I feel like I'm slowly losing my sanity. Please help!
I've two instances(Default, Named[dynamicsFINANCE]) running on SQL server 2014. However, when I try to connect to named instance say (dynamicsFINANCE) using SQL authentication from local SSMS, I get below error message:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
I assigned a static port number to the named instance [dynamicsFINANCE] 1450. I also setup the firewall rule to allow access to Port 1450.
I'd like to set up a Service Broker queue in one database (dbRespond) on a server so that events in another database (dbEvent) on the same server instance can post messages to the queue. The problem I'm having is that:
The BEGIN DIALOG CONVERSATION needs to reference a Contract that is in the current database, and I want to call BEGIN DIALOG CONVERSATION from dbEvent The target service is in dbRespond. Based on the "Hello World" Service Broker example that comes with SQL 2005, in dbRespond I need to specify the contract in the CREATE SERVICE call that creates the target service. Here, too, the contract must be defined in the current database. How do I deal with needing to have the same one contract in two different databases?
I run the code sample below in a SQL Mgt Studio query window. I get no error messages. However, the two SELECT statements at the end produce undesireable results (see comments). My messages to not make it to the target queue; they get stuck in sys.transmission_queue with the error message in the final comment of the code. The server principal "ddddXXXXX" is a Windows Active Directory account that: 1) is a domain admin in the domain that my SQL Server box is a member server of, 2) is the login used by the "SQL Server (MSSQLSERVER)" service account, and 3) is a member of the SQL Server instance's sysadmin fixed server role.
What is it I'm missing that is denying a sysadmin login access to a database?
/*** Service Broker try 1 ***/ USE master; GO
CREATE DATABASE sbRespond; GO
CREATE DATABASE sbEvent; GO
USE sbRespond; GO
CREATE MESSAGE TYPE ActivatedStudyMessage VALIDATION = WELL_FORMED_XML; GO
CREATE CONTRACT ActivatedStudyContract (ActivatedStudyMessage SENT BY INITIATOR); GO
CREATE QUEUE [dbo].[ActivatedStudyTargetQueue]; GO
CREATE SERVICE ActivatedStudyTargetService ON QUEUE [dbo].[ActivatedStudyTargetQueue] (ActivatedStudyContract); GO
USE sbEvent; GO
CREATE MESSAGE TYPE ActivatedStudyMessage VALIDATION = WELL_FORMED_XML; GO
CREATE CONTRACT ActivatedStudyContract (ActivatedStudyMessage SENT BY INITIATOR); GO
CREATE QUEUE [dbo].[ActivatedStudyInitiatorQueue]; GO
CREATE SERVICE ActivatedStudyInitiatorService ON QUEUE [dbo].[ActivatedStudyInitiatorQueue]; GO
-- Send a message. USE sbEvent; GO
BEGIN TRANSACTION; GO
DECLARE @message XML; SET @message = N' <message> <PROT_ID>123456</PROT_ID> <StudyID>AAAA1234</StudyID> </message> ';
DECLARE @conversationHandle UNIQUEIDENTIFIER;
BEGIN DIALOG CONVERSATION @conversationHandle FROM SERVICE ActivatedStudyInitiatorService TO SERVICE 'ActivatedStudyTargetService' ON CONTRACT ActivatedStudyContract WITH ENCRYPTION = OFF;
SEND ON CONVERSATION @conversationHandle MESSAGE TYPE ActivatedStudyMessage (@message);
END CONVERSATION @conversationHandle; GO
COMMIT TRANSACTION; GO
USE sbRespond; GO
SELECT * FROM [dbo].[ActivatedStudyTargetQueue]; GO --The query above returns zero records
SELECT * FROM sbEvent.sys.transmission_queue; GO --The query above returns two records, each with this "transmission_status" value: --An exception occurred while enqueueing a message in the target queue. -- Error: 916, State: 3. -- The server principal "ddddXXXXX" is not able to access the -- database "sbRespond" under the current security context.
I was trying to send a message on a different instance in the network using service broker. I have created the endpoint and route both the side. I could see that the messages are in the transmission_queue in the sender side with no error in the status.
What could be the reason.
I am doing the following: CREATE ROUTE inst02 WITH SERVICE_NAME = 'SERVICE2', ADDRESS = 'tcp://10.14.43.149:2341'
in the send script i am using this: BEGIN DIALOG CONVERSATION @dialog_handle FROM SERVICE [SERVICE1] TO SERVICE 'SERVICE2' ON CONTRACT [MainContract] WITH ENCRYPTION = OFF ;
in the sending side if i change the endpoint's authentication as windows kerberos , then i get thefollowing error in the transmission queue:
"Connection handshake failed. An OS call failed: (8009030e) 0x8009030e(No credentials are available in the security package). State 66."
I also have given access to the remote user on this endpoint(on the recever side) using this : GRANT CONNECT ON ENDPOINT::Endpoint_test to paras
I am executing the sending side send script using the same user wich has access to the remote endpoint.
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee
I have a SQL2K server installed , and it is given an instance name (like BoxSQLInstance). I have a connect string looking for "local" server, is it possible to make this instance name as the default local server ?
I am working on an existing project that uses sql server 2014 local db. I've installed it (there was no option to set an instance id). Using sql server 20014 management studio and setting the server name to (localdb) results in this error
Network related or instance specific error occurred while establishing a connection to sql server.......
So obviously its not there, how can i test this? There's no service I can see. The installation procedure completed without any errors, what could be going on here ?
I have just recently installed MS SQL Server 2005 Developer edition. I have installed SP2.
Today when I try to connect via Management Studio, I get the following error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider)
I installed it as a default instance.
I recently added a login with dbo privileges. I have tried logging in with that sql account and also with windows authentication to no avail.
(New to SQL Server Installs)I installed SQL Server 2005 Developer Edition on a WinXP-SP2workstation and can see some enterprise databases on the network justfine.My problem is I cannot register a local database on the local drive fortesting/education purposes.(I accepted all of the defaults on the install and thought all waswell.)There are a couple of small databases that are in development in ourgroup and I need to work on when offline from the network.Short of uninstalling the whole product and doing it over, what stepscan I take to remedy this so I will be able to work with DB's locally?Thanks.
I have verified that the following services ARE running.SQL Server (SQLEXPRESS)SQL Server Browser SQL Server VSS Writer.This one however will not start ... For some reason it starts then automatically turns off.SQL Server Agent (SQLEXPRESS).When I try to connect using my <machine name>/instance and Windows Authentication I get the following error ...
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server)".The connection specified in the "Connect to Server" box was working perfectly fine before I upgraded. I thought it might have been my Norton 360 Premier but I uninstalled it.I AM having issues with the adapter frequently dropping the internet connection but I just disconnect and reconnect and that resolves itself.The other technique I tried was to replace the server name with the IP address ... <192.168.0.22>/Instance ... This actually seemed to find the SQL Server but rejected the Windows Authentication ...
"Login failed. The login is from an untrusted domain and cannot be used with Windows authentication." I have several databases on here and would hate to have to reinstall SQL Server and manually hook them back up.
Hi, I've installed SQL Server 2005 Express Edition, SQL Server Management Studio Express using Windows Authentification and IIS 5. The problem occurs when I try to access the default address of my local computer to test my installation. I've tried with both http://localhost and http://127.0.0.1. The system requires a password despite I don't use password for my Windows Authentification. Does IIS always demands a password regardless my settings for Windows Authentification or?
I am using the following connection string to connect to SQL Server 2005 Express Edition installed on my local PC. string sqlstr = "Server=(local);Database=MyDB;User ID=sa;Password=sa;Trusted_Connection=False";
And it gives me the following error. The string works fine in computer with SQL Server 2000 instance but fails with 2005. The string also fails for "Server = localhost". However the string works very fine if I use the name of Server 2005 i.e ./SQLExpress
===================================
Cannot connect to (local).
===================================
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
Now the main problem is that, of course I could use a named instance, but since I am embedding the Connection String in a dll file so that any user can use it to connect it to the local instance of the SQL Server 2005 installed in his/her computer, I need to use "server = localhost". Doesn't SQL 2005 support this. If yes, where could i find option to enable it?
I have enabled every option available in surface area configuration for SQL Server 2005, but nothing seems to help out. I even use local as well as remote connections using both TCP/IP and named pipes. Can nyone help me out?
Just when I think I have this stuff figured out, it bites me back everytime.
I'm trying to deploy an mdf out to a different machine, and attached to it with local user instance. I connect without problem from my development machine with a local user instance, which also has Express Manager resident, and I can connect to a server instance without problem.
What I can't do is copy the .mdf database over to another workstation, which has Sql Native Client installed, and connect to the database using a local user instance! I can connect to a server instance without problem from this other workstation. Here's my connect string for local user instance that works fine from my dev machine:
Provider=SQLNCLI.1;Persist Security Info=False;Integrated Security=SSPI;Data Source=.sqlexpress;AttachDBFileName=<full path_name and mdf filename>;User Instance=true;
The error I get upon trying to connect with other stations is:
Error -2147467259 Database not found or cound not connect to database
I've tried this every way I know how. I've copied the database from my dev machine both with and without having detached the database from the local instance. I've tried detaching from a server instance and copying the file over. Nothing works, and I've done this before! What gives with this thing?
We are seeing some very strange behavior on installation for our application when it is trying to enumerate the available SQL Server instances. On some machines (not yet determined why) the SQL Browser service is apparently able to locate remote instances but not the local instance. This does not seem to map to any firewall or TCP/IP settings which we can determine. We have gone to the extent of uninstalling all associated firewall and antivirus products, and the problem persists.
For the moment, we are working around this problem by interrogating the registry for the instances installed locally, but this seems unsatisfactory in the long run. Is there any possibility that other instances of SQL Server Express or MSDE have somehow disabled our ability to see local instances? I would really like to find a better solution to this problem.
Not sure if this is the right place for my question but here goes anyway.
I have an instance of SQL Server 2005 installed on my DEV PC. A colleague of mine wants to access my server from his machine which connected to the same network.
I logged on to SSMS and added him as a new login.
Will he be able to connect to it now or do I have to do more than just that?
I want to add a data source to a C# project that comes from a local SQLServer instance. But when I attempt to do a new connection, it only allows me to specify a file. That is, the only choices I have to select a data source type are "Access DB file" and "SQL Server DB file". I know that with the non-express VS edition there are more choices available. But reviewing limitations of express editions on the web, I find a frequent mention that one cannot access remote data, only a locally installed data source. But is not a SQL Server instance on my local machine a local data source?
This is an issue because if I proceed with connecting as a file, then VC#Express complains the file is in use. If I first go into SqlServer Expresss and detach the database there, then I can connect to it in VC#Express, but that is rather cumbersome!
So to put it another way, can I use this connection string...
Data Source=.SQLEXPRESS;Initial Catalog=testDB;Integrated Security=True
instead of this one?
Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory| estDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True
I have been reading through the article pointed to by the link below on msdn and its documented that one functional limitation of user instances is "Only local connections are allowed." I didn't understand the technical details(meaning) of that limitation and hopefully some one might explain it to me so that i can understand it better.
Hello, PLEASE Help me.I have just installed the Quick Starts on my local machine, and it mentions that you will need a new instance of SQL called (local)/NetSDK.I already have the MS Personal Edition and the tutorials say to download the MS Desktop Engine. So what do i need to do in order to get teh Quick Start samples to work locally???Can i not just use my own instance and use the Grocer and other Databases there???Please Help
Hello all, I'm a bit new to SQL Server and T-SQL (my background is in DB2), so hoping you can help me with this. I'm writing a T-SQL script that's hopefully going to scan a bunch of SQL server instances and record the results. We've got a mix of SQL2K and SQL2K5 instances, and for part of my script I only want to run something if the remote instance is SQL2K.
I'd tested this on my local PC with several instances created and it worked fine. When I try and run it for instances located on other servers it barfs :eek: . From what I've found from looking up the error message it looks like I've got myself a loopback -- but I don't know how to get around it - any ideas please?
INSERT INTO @tempdata (scratch) EXEC ('[' + @server + '].master.dbo.sp_executesql N''SELECT SERVERPROPERTY(''''ProductVersion'''')''') SELECT @version = convert(varchar(100),scratch) from @tempdata DELETE FROM @tempdata IF @debug>0 BEGIN PRINT @server + ' is running SQL Server version: ' + @VERSION END IF charindex('8.00',@version) > 0 BEGIN PRINT 'SQL2K-only code goes here' END
The error I get is: OLE DB provider "SQLNCLI" for linked server "SQLSERVER_INSTANCE" returned message "The transaction manager has disabled its support for remote/network transactions.". Msg 7391, Level 16, State 2, Line 1 The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "SQLSERVER_INSTANCE" was unable to begin a distributed transaction.
I get this error running from a SQL2K5 instance against both SQL2K or SQL2K5
First time I've tried doing this - I have SQL Server 2012 installed on my local machine with an instance running (which was set up under an administrator account, not mine, which has no admin rights), and I'm trying to create a linked table from Access (also on the local machine) to a table on the server.
I tried creating a DSN using Windows Authentication, using the server name which is the same as my computer name, and got the error "Error 18452, Login failed. The login is from an untrusted domain and cannot be used with Windows authentication".
I then created a SQL authentication user ID and password, and tried the same thing using that instead, and got "Login failed for user <myusername>"
Is there some particular setting on the local instance I need to change to allow this kind of connection, or do I need to use something other than the server name to connect, such as an IP address? Remember that I have no admin access on this machine so any solution would have to avoid requiring that.
I've two instances(Default, Named[dynamicsFINANCE]) running on SQL server 2014. However, when I try to connect to named instance say (dynamics FINANCE) using SQL authentication from local SSMS, I get below error message.A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)I assigned a static port number to the named instance [dynamicsFINANCE] 1450. I also setup the firewall rule to allow access to Port 1450.
I installed SQL 2005 Developer addition on my Vista laptop. When I open Management Studio to connect to the local instance of the DB, I get the error below. Why can't I access? Is there something with Vista that is prohibiting?
Thanks
TITLE: Microsoft SQL Server Management Studio ------------------------------
Login failed for user 'xxxx'. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
I am using SMO EnumAvailableSqlServer to make a list of available SQL servers in local network. I have tested it in two different local networks. In the first all works fine, but in the second I have noticed that when disconnected from the network the call fails to even detect the locally installed sql servers. I know that I can scan registry to get installed local servers, but I want to know what could be making problem.
I am using the following C# code to establish a SQL connect to a SQL database file:
// connection string // attach a SQL database file to a local SQL server express instance string _connectionString = @"Server=.SQLExpress; AttachDbFilename=C:BalanceDatabase_1.mdf; Trusted_Connection=Yes; User Instance=True";
// using System.Data.SqlClient; SqlConnection _sqlConnection = new SqlConnection(_connectionString); // open the connection _sqlConnection.Open();
// do something
// close the connection _sqlConnection.Close();
So far, the connection works fine.
However, next, I want to copy the database file to another folder. So the following codes: // source database file name string sourceDatabaseFileName = @"C:BalanceDatabase_1.mdf"; // target database file name string targetDatabaseFileName = @"D:BalanceDatabase_1.mdf"; // copy database file System.IO.File.Copy(sourceDatabaseFileName, targetDatabaseFileName, true);
Then the program came with runtime exception: "IOException was unhandled: The process cannot access the file 'C:BalanceDatabase_1.mdf' because it is being used by another process."
Is it because the database file was sill attached to the local SQL Server express instance? What can I do to bypass this problem? Detach the database file? or dispose the local SQL Server express instance?
I am trying to generate scripts for route optimization, that is in what order a machine should operate on different sites with lowest cost of transportation.
I alreday have generated the matrix with distances between all sites.
And the problem now is how to generate the lists of all possible routes.
That is all possible combinations of in which order the sites can be operated.
I have a very simple and probably stupid question. I am new to SB. My question is when I create a service and queue do I have to create a route always?. whats the purpose of creating a route?. what happens if i dont create a route. As I understand creating a route creates a routing table in the database but i am perplexed as to what is the actual use of this routing table and in what way it helps.
I am using the TRANSPORT and self-routing and it works great. My question is: is there ever a need for more than one transport route when using multiple services, or should there just be one per database, generally speaking? What exactly does the presence of this route tell service broker? It seems as though it just signals service broker to use self-routing if it can't resolve the service any other way....similar to the way the LOCAL route works, only for remote services.
my local instance of reporting services is named and therefore I think causing me a problem when I issue the following command to set up an unattended account...
rsconfig -s localhostinstance name -e -u domain nameuser name -p password
the message I keep getting is "No Reporting Services instance found on local host.". I tried a couple of things including replacement of the word localhost with my computer name but to no avail. I tried single and double quotes around the -s parameter but no success.
I have an application running off an Access database. Im trying to convert the application to a server-client architecture and thus moving everything to SQL Server 2000. I have read alot of articles about ways to accomplish that but I've still yet to decide on which approach is the best (best as in robust and scalable).
I pretty much eliminated the ODBC route due to all the layers of translation a request has to go through to reach SQL Server, although this route seems to be the quickes to accomplish.
Mind you I have plenty of time on hand and am willing to re-write the whole thing from scratch if it means a better app.
Now should I go the ADP route and keep Access as the user interface or should I rebuild the whole front End in pure Visual Basic that interacts with SQL Server? Im leaning towards the latter solution.
I haven't read any articles talking about rebuilding the whole app. using VB and SQL Server instead of just using ADP. Why so and which solution do you think is a better solution for a client-server architecture??
Thanks in advance for any replies to my questions.
I just installed SQL Server 2005 Enterprise edition from my company's DVD. It was installed with the setting of using both Integrated windows authenitication as well as basic named authenication. I installed all the options too: Database Engine, Analysis Services, Reporting Services, SQL Server compact edition, and Integration Services. When I look at services there are: SQL Server Integration Services, SQL Server Analysis Services, SQL Server Reporting Services, and SQL Server Browser. All of which are running. Something that took me offguard was the installation did not ask me to provide an SA password. Other than that, the install looked like it went good.
I was able to connect to the local instance of the SQL Server 2005 using the SQL Server Management Studio. I could connect with SA, or connect with Integrated Windows Authenication. Whoohoo. Off and running! As a matter of fact, for the SA account I could use any password and it would still log me in.
First thing I did was I went in to the copy wizard to attempt to copy a database from a server on our network to my local box. First it asked me for the remote server. Then when I specified my local instance in the wizard, the wizard complained that my local instance was NOT SQL Server 2005. Doh! This I didn't understand. I figured maybe I need to check for MS updates. Sure enough, I found that ther was a SP2 and then a hot-fix for that SP2. I applied both. Now I cannot connect from SQL Server Management studio to my local instance of SQL Server 2005 database server. I get the following error:
"An error occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)"
However, I went in to see what other services I could connect to, and here's the results:
Analysis Services : OK! Reporting Services (Windows Auth/Basic/Forms) : NG "The reporting Services Instance could not be found (Microsoft.SqlServer.Management.UI.RSClient)" SQL Server Compact Edition : NG "The database cannot be found. Check the path to the database. [ File Name = CCG092 ] (SQL Server Compact Edition ADO.NET Data Provider) Integration Services : OK!
I can connect to other SQL Server databases on our network. However, just not my local one. No one on the network can connect to me either.
I even turned off my windows firewall and still no luck connecting to my own.
So something really went wrong when I applied SP2, however, admittedly from the error message when I tried to use the copy wizard, something was probably already wrong.
Can't connect to local server instance MSSQLSERVER in SQL Server Management Studio (SQL2005 sp2/Vista).
SQL Server Configuration Manager reports SQL Server2005 services: SQL Server (MSSQLSERVER) Running. This would indicate the name of the SQL server is "MSSQLSERVER" correct? I chose "default" instance during the install and that is the name it gave itself.
I tried connecting to the server using the following for the Server Name: MSSQLSERVER and .MSSQLSERVER neither works.
The only thing that works for my installation is just plain "." (no quotes) and nothing else. Can this be correct because I can't find any reference to this. Thanks.