What is the proper connection string to SQL Server using Perl? - sql

I feel like a bonehead asking this question, but I have scoured the net and can't actually find a working connection string to connect Perl to SQL Server. I've checked connectinstrings website and still couldn't find anything clear. Someone here has got to know!
I'd prefer to use DBI, but would use another library if someone else has an alternative.

DBI->connect("dbi:ODBC:Driver={SQL Server};Server=192.168.1.102;UID=$user;PWD=$pass")
Also see: Connecting Perl to SQL Server

Related

Issue with SQL Plus

I have a database that I am trying to connect to through SQL Plus. I run this command from the command line:
sqlplus username/password#//hostname:port/sid
I use this connection string instead of using tsnames. The error I keep getting is
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
The weird thing is that using the same connection information I can connect just fine through SQL Developer. I can see the tables, users, and everything else. Anyone know what could be going on?
P.S. I tried setting up tsnames but it just gave the same thing as using the connection string.
So my boss found the solution. Turns out the sid is different when connecting through SQL Plus then through SQL Developer. Seemingly in just this one case. I have no idea why this is but that was the reason. Very odd and I don't understand why.

Fake mysql server to run sql commands on for practice

I am trying to get better with SQL commands, but I really do not have a database currently set up that I can practice on. Does anyone know of an all-in-one program or an online service that has a database set up and filled with data that I could practice my SQL commands on/in?
Frankly, I do not really know of any GOOD online site for doing this.
Google gave me this site but i tried it out and its really a bit cumbersome and difficult to work with.
I would really suggest that you will find it a LOT easier to install some database like MySQL / SQL Server Express on your machine and try things out.
Installing something like SQL Server Express is really easy. You can just download the db + tools from here, a quick install and you will be all set to go
For the sample data, you can always download the Adventureworks database.
Step by step details on how to get the AdventureWorks database running with SQL Express are listed here
Google's your friend
http://www.mysqltutorial.org/mysql-sample-database.aspx
I found this site pretty much helping.
http://sqlzoo.net/wiki/SELECT_basics
Although they use mariaDB still same queries.. So no worries.

connection string

I have created a simple members database in ASP.NET with login and create account features. Can anyone give an example of the correct connection string that I would need to use to connect to this database remotely. Any answers would be greatly appreciated.
Based on the tag I'm guessing you're using SQL Server 2005. See: http://www.connectionstrings.com/sql-server-2005.
You didn't specify anything about the database (is it SQL Server, Access, MySql, etc).
much less the server name, database name, etc.
However, until specifics are posted, here is a nice general resource for figuring out your connection strings:
http://www.carlprothman.net/Default.aspx?tabid=81

Perform single SQL query over internet Android

I am trying to find a way to goto a database located on the web perform 1 query and close the connection. I have not had any luck with finding an answer, and I really don't know how to solve this.
Internet connection is not an issue, nor is any security issues. Also this cannot be solved with an internal database and this must go across the web.
If you have any hints or ideas please let me know!
Thanks
You'll need to use some kind of service to access the database. For example you can write something very basic in php and use HTTPClient from Android to interact with it.
Here's a brief example on how to accomplish this.

connection string of ADO.Net of SQL Server

I am confused about the connection string format of ADO.Net when connect to a non-default instance of SQL Cluster. I did search but find various samples, could anyone let me know what is the correct format please (if I know the virtual server name and instance name)? I am using trusted connection.
thanks in advance,
George
See http://www.connectionstrings.com/ - great site for making DB connection strings.
ServerName\InstanceName ? Use double \ when handling strings in C#
The following web site gives many different connection strings for you. The following should work I believe:
http://www.connectionstrings.com/sql-server-2005#1
This is also a duplicate of connection string to a SQL Server cluster
If you can connect to it using visual studio the connection properties should give you the connectionstring vs.net uses. Using that connectionstring might help.
If you want a quick & easy way to try different connection strings, I suggest DatabaseTester (disclaimer - I wrote it). It's free and a very easy way to test. And I agree with the other posts above, for figuring out connections strings ConnectionStrings.com is your best friend.