I am trying to sync to tables on differenet servers (Local one and remote one) using this code that I rum from the command prompt:
"C:\Program Files\Microsoft SQL Server\120\COM\tablediff.exe" -sourceserver localpc\SQL2014 -sourcedatabase localdb -sourceschema sche -sourcetable table1 -destinationserver remotepc\SQLEXPRESS -destinationdatabase remotedb -destinationschema sche -destinationtable table1 -et Difference -f d:\table1_differences.sql
but I recieve the error : unable to access database remotedb
The local db is SQL server 2014 express edition
The remote db is SQL server 2014 express edition
Firewall is turned off.
I assigned the admin user as the logon account for the sql service on the remote server.
NOTE I can connect to the remote db normally from C# application or from my local SQL server .
Thanks,
Solved it by assigning the -destinationuser and -destinationpassword parameters
Related
I am trying to connect to a SQL Server 2016 database from Excel (Office 365).
First of all :
I can ping the SQL Server from my PC
I can telnet SQL Server 1433
I can connect to the SQL Server with a SQL Server account
I got the credential popup when I connect from Excel (tried with domain account and SQL Server account).
There is no firewall restriction between client and server.
But finally I got this error message:
Where should I check ?
Well, i'm using IP adress instead of server name and it is working. So it should be a DNS issue.
I want to remote restart or stop SQL server service on SSMS. When I login in a DB using sa account, the menu bar still be disabled
I looked up some information, MS seems to disable it for security reasons from SQL server 2012
If there is any possible, I can alter some system settings to do that?
So to stop/restart an SQL Server instance from Object Explorer in SSMS, you would have to met the following requirements:
1. You must have to have at least public server role on the SQL Server instance.
2. You must have the privilege to start/stop services on the server that hosts SQL Server instance. For example, add your windows user to administrator group on the server.
Also,since SA uses SQL authentication, the best you can do is issue a SHUTDOWN command to stop SQL Server.
I want to connect my SQL server management studio which is running locally with a Azure SQL Server 2012 database
Now i have enable the sa account on the SQL server side and i also check the server name by running this query --
SELECT ##SERVERNAME
I got the output
MSRV01\SQLSERVER
Now from my local machine when i am trying to loginto that Azure SQL server like this --
It retun this error
Do any one have any idea what i am doing wrong here !
Unless your local machine is on the same domain (or even subnet) as the azure VM then accessing via machine hostname will never work.
If you are using an Azure hosted database (i.e. not a VM) then in your Management Portal, navigate to the database settings panel. At the top will be listed the Server name with a URL like xxxxxxxx.database.windows.net. Use this to connect to your database in SSMS.
Further reading: https://azure.microsoft.com/en-gb/documentation/articles/sql-database-connect-query-ssms/
I've downloaded and installed SQL Server 2014 Express on Windows 10, I've been through this loop at least 3 times now. The installation completes without warnings or errors. I have chosen to use Window authentication. I'm trying to use HeidiSQL to connect to SQL Server. I already have MariaDB installation and am able to connect to that using HeidiSQL.
When I connect to MariaDB I am able to select Databases from the drop down combo, but not for SQL Server. I don't seem to be able to connect with HeidiSQL.
In HeidiSQL, the settings are:
Network type: Microsoft SQL Server (TCP/IP, experimental)
Hostname / IP: 127.0.0.1
Ticked checkbox 'Use Windows authentication'
Port: 1433
I can't select a Database, if I click on the Open button after a while it comes up with:
SQL Error(17): [DBNETLIB]ConnectionOpen (COnnect()).]SQL does not exist or access denied SQL Server does not exist or access denied.
In order to use HeidiSQL's network type Microsoft SQL Server (TCP/IP), you need to activate TCP/IP protocol in your MSSQL configuration.
Further on, I am unsure if Windows authentication worked for me, as I'm always using the default SA user, which is created while installing SQL Server.
Apart from that, you should be able to connect using <yourmachine>\SQLEXPRESS on port 1433.
Use Microsoft SQL Server (named pipe) as Network type and .\SQLEXPRESS for Hostname / IP
SQL Server Express by default installs as a named instance called SQLEXPRESS - so for your "hostname", try one of these:
.\SQLEXPRESS
(local)\SQLEXPRESS
yourmachine\SQLEXPRESS
your-ip-address\SQLEXPRESS
Those should work.
I have VS 2008 Professional Edition. After the installation (which included SQL Server 2008), I decided to install SQL Server 2008 Express Edition with Advanced Tools (so I could get SQL Server Management Studio on it). So I uninstalled the SQL Express that came with VS 2008, and installed the standalone SQL Server Express 2008 version with advanced tools.
However, When I try to logon onto SQL Server Management Studio using:
.\SQLEXPRESS
as Server name and Windows Authentication as the authentication, I get the following message:
TITLE: Connect to Server
------------------------------
Cannot connect to .\SQLEXPRESS.
------------------------------ ADDITIONAL INFORMATION:
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)
For help, click:
http//go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
------------------------------ BUTTONS:
OK
------------------------------
Any suggestions on how to get it to work? I have tried disabling Windows Firewall as well and still no luck.
I am using WIndows Vista and SQL Server 2008 Express SP1 Patch has also been applied recently.
FIX: For those interested:
I did not have any of the Instance Based installation installed (i.e. the Database engine). I Installed the instance based stuff and it fixed it!
Start your Local SQL Server Service
Start SQL Config Manager: Click Start -> Microsoft SQL Server 2008 R2 -> SQL Server
Configuration Manager
Start SQL Services: Set the SQL Server (SQLEXPRESS) and SQL Server Browser services to automatic
start mode. Right-click each service -> Properties -> Go into the Service Tab
This will ensure they start up again if you restart your computer. Please check to ensure the state is "Running" for both services.
Login and authenticate with your Local SQL Server
Now open up SQL Server Management Studio and click "Connect to Object
Explorer" and select Server Name:
[Your PC name]\SQLEXPRESS
Example: 8540P-KL\SQLEXPRESS or (localhost)\SQLEXPRESS
To find your PC name: Right click My Computer -> Properties ->
Computer Name tab
Alternative: Login using windows authentication: Using the user name [Your
Domain]/[Your User Name]
Setup User Account
Create a new Login acct: In SQL Mgmt Studio -> Expand your local Server -> Security -> Right
click on Logins -> New Login
Set Password settings on New User Account: Uncheck Enforce password policy, password expiration and user must
change pw(Since this is local) Default database -> Your Database
Grant roles to New User Account: User Mapping Page -> Map to your db and grant db_owner role Status
Page -> Grant Permission to connect and Enable Login
Setup Access Permissions/Settings for User
Enable all auth modes: Right click your Local Server -> Properties -> Security Tab -> Enable
SQL Server and Windows Authentication Mode
Enable TCP/IP: Open SQL Server Configuration Manager -> SQL Server Network
Configuration -> Protocols for SQLEXPRESS -> Enable TCP/IP
Restart SQL Server Service: You will have to restart the SQL Server(SQLEXPRESS) after enabling TCP/IP
Database Properties File for Spring Project
database.url=jdbc:jtds:sqlserver://[local PC Computer
name];instance=SQLEXPRESS;DatabaseName=[db name];
database.username=[Your user name] database.password=[Your password]
database.driverClassName=net.sourceforge.jtds.jdbc.Driver
If you want to view larger screen shots and better formatting of the answer with more details please view the blog article below:
Setting up a Local Instance of SQL Server 2008 Blog Post:
you can look for your instance name in SQL Server Configuration Manager. It is written between brackets after SQL Server service in the services list.
the . notation is correct and it's the same as (local)
Did you try using (local)\SQLEXPRESS in the name? I've not seen that . notation before.
Scott,
I had to enable SQL Server Browser in services once I did that I was able to connect on My recent install.
after that I only had to use the computer name as the server.
edit,
while researching further on finding sql server browser, noted that reporting services, service showed its instance as .\computer name.
try that as the server name.
edit again change to backslash been playing with linux recently :)
There is a possibility that you installed as Default instance. In this case, try connecting using (local) - just (local).
Then go to Programs/Microsoft SQL Server/Configuration Tools/SQL Server Configuration Manager. Go to SQL Server Network Configuration/Protocols for MSSQLSERVER and enable Named Pipes.
Have you tried looking at the SQL Server Surface Area Configuration? You might only have SQL Authentication setup and might need to enable Network and SQL Authentication.
-JFV
I have an application that uses a connection string trough VSOT in Word 2007.
The application gave a connection error.
I allways install Sql server 2008 Express R2 in mixed mode so that i can use the build in sa with i password to connect.
I re-entered the password to be sure its correct. In a next step i opened:
‘Configuration manager’ in ‘Program files’ ‘Microsoft Sql Server 2008’ –->’ Configuration Tools’ and set all the other instances on the properties --> hide instance 'yes'
That solved the problem in my case.
Danny
If you still have problems connecting to SQL Express 2008,
read this article
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/
It tells you about configuring SQL express after installation