I connect from SAS on Windows to Netezza and would like to set the connection string option security level to only secured as shown in the dialog box. (I want to do it in the connection string so I don't have manually to click the option every time.)
In your ODBC connection string specify "SecurityLevel=onlySecured" to force the use of SSL.
Related
Can anyone give me the libname statement for making SAS to SQL Server connection using windows authentication or is it even possible without entering userid and password?
Thanks
You will want to use a connection string that has Trusted_Connection=True; How that property is communicated to the engine is dependent on the engine.
A great resource for all things connection strings is https://www.connectionstrings.com/sql-server/
I am using Entity Framework version 6.0. I want to connect to a local SQL Server database. I am using the following connection string. But I cannot connect to the database. Please give me the solution.
<add name="dbecommerceEntities"
connectionString="metadata=res://*/Models.dbEcommerceMode.csdl|res://*/Models.dbEcommerceMode.ssdl|res://*/Models.dbEcommerceMode.msl;provider=System.Data.SqlClient;provider connection string="data source=localhost;Integrated Security=False;Initial Catalog=dbecommerce;User ID=qaws;Password=1q2w!A#S;Connect Timeout=30000;Encrypt=False;Packet Size=4096;App=EntityFramework"" />
Check the usual suspects:
data source=localhost : this means, there must be a default, unnamed SQL Server instance on your local computer - is there? Or did you install SQL Server Express in default mode? Then you'd have to use data source=(local)\SQLExpress instead
User ID=qaws;Password=1q2w!A#S : do you have this user ID and this password as a login on your SQL Server instance?
Initial Catalog=dbecommerce;: does that database exist on that SQL Server instance? Is the login from above defined as a user in this database, and has the permissions needed to do work?
my connection string was correct. one of the file was not uploaded to the server. now it is working correctly.
Here is what I do to test connection to database:
Create a .txt file somewhere in your computer.
Rename the file to .udl
Accept the change extension question and double click the file to open.
In your case, in the first tab, select SQL server and in the second tab, fill in the required fields.
Test the connection and if unsuccessful, it will provide you an error.
If successful, close the dialog and open the .udl file with notepad, you can see the connection string in the second line after ";" (the first semicolon)
HTH
On Win 7 system I installed SQL Server 2014 Express. I created instance HM1. I've set it up to use mixed mode. I created a SQL Server user and I am able to login with no issue.
My goal is to connect to a database using this SQL Server user using configuration file. This connection will be used for another application. Note: if I disable user/password usage during login I have no problem but I have to use credentials.
For connection I provided machine_name\SQLSERVEREXPRESS\HM1. I also provided username and password. I also changed the service for SQLEXPRESS and HM1 to run as local account.
When I try to connect using that file I've got the error
Can't connect to database
Again if I disable user/password usage I am able to connect using the same file with no problem.
Could someone help me with it?
Thanks
For connection I provided "machine_name\SQLSERVEREXPRESS\HM1".
You just want this:
machine_name\HM1
That's probably not your only problem, but that's all I can tell you until you try that and then come back and include more detail from the error message.
You need to put the un-encoded password in the config file instead of the base64 encoded one. Alternatively, you can also put Trusted_Connection=True; in the connection string if your database server resides on the same server as the application server. This will use the OS credentials instead of the username/password that you provide.
My client set up an application Role in Microsoft SQL Server 2008 for one database. He doesn't know how to change the connection string for that role and I have any idea about which connection string to use for this purpose.
Can anyone provide me an example of a connection string for an application role defined in MSSQL?
To not use AttachedFile in the connection you need to attach the mdf file to a SQL Server. Once attached you could use a connection similar to the one below but many examples can be found here
Data Source=myServerAddress;Initial Catalog=myDataBase; User Id=myUsername;Password=myPassword;
I need to setup a JDBC connection string to SQL Server.
This question is similar to the the C# ADO.Net connection question. This one is specific to JDBC connection strings.
The usual format for the JDBC string is "jdbc:sqlserver://{host}:{port}".
Now, for a SQL server cluster I have a cluster name vvv\iii ({virtual server}{instance name}).
There's no problem setting up an ODBC connection through the "New Data Source to SQL Server" wizard when using the vvv\iii string as the server name. However it seems the JDBC connection string requires a specific host and port.
Is there a way to make a JDBC connect string to a SQL Server cluster?
it turns out that you can use the "instanceName" property within the JDBC string, as documented on the Microsoft Technet page in section "Named and Multiple SQL Server Instances". What worked in my case was the following string for virtual server vvv and database instance name iii:
"jdbc:sqlserver://vvv;instanceName=iii"
When using a SQL Server named instance in a cluster or stand alone environment each SQL Server instance is dynamically assigned a port number on startup. The SQL Server Browser server handles requests to each instance because each server restart could change the port number used by each instance. The first instance to start on a server reboot gets assigned 1433 but there is no guarantee if you have 2 instances that one of them will always get 1433. There are several veriables that affect the startup and recovery time it takes for an instance to start. This can change each time.
That being sad... when connecting to a named instance the jdbc connection string should look like this:
jdbc:sqlserver://server_name/db_name;instance=instance_name
rather than this
jdbc:sqlserver://server_name:1433/db_name;instance=instance_name
note that the default database "/db_name" is optional. If exclued the connection will use the default database assigned to the SQL Server login.
The cluster resource has a host name and a listening port. Use jdbc:sqlserver://{virtualserver}:1433 (or the appropriate listening port if not listening on the default one).
I'd comment Mark Stewart's remark, but the reputation is lacking. My source doesn't mention /db_name and I can't get it to work either. Maybe another case of confused instance names?
Make sure you leave the port definition off as the cluster determine this for you.
So my datasource definition looks like:
jdbc:sqlserver://sqlcluster_hostname\instancename;DATABASENAME=databasename;sendStringParametersAsUnicode=false;SelectMethod=direct
I ran into this issue while trying to setup a Railo datasource to connect to MSSQL cluster.
Slightly off topic ... The standard Railo datasource MSSQL driver option sets the port to "-1" if you leave the port field empty however if you set it to "0" then it removes the port definition altogether and then everything works. But the best way is to choose 'Other - JDBC Driver' to define the JDBC connection string in full as above.