Showing posts with label SQL Server 2008. Show all posts
Showing posts with label SQL Server 2008. Show all posts

Thursday, August 22, 2013

SQL Server 2008: Invalid object name SQL Server 2008 R2

I was getting the error:

Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'TRANSACCION'. Error Code: 208

The problem was that the table wasn't created in the database, you can also verify the name of the table you´re trying to manipulate.

Resources:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ec184168-ddd1-4df5-b2c7-c6671b602a3d/string-or-binary-data-would-be-truncated-and-field-specifications

Tuesday, August 13, 2013

SQL Server 2008: Cannot establish a connection. The server sqlexpress is not configured to listen with TCP/IP

I was getting the error:

Cannot establish a connection to jdbc:sqlserver://FEMPUTADORA-PC\SQLEXPRESS;databaseName=pichincha using com.microsoft.sqlserver.jdbc.SQLServerDriver (The server sqlexpress is not configured to listen with TCP/IP.)

I solved it by enabling TCP/IP listen:
1. Run: "start" > "all programs" > "Microsoft SQL server 2008" > "configuration tools" > "SQL Server Configuration Manager"
2. Go to SQL Server Network Configuration > Protocols for SQLEXPRESS.
3. enable TCP/IP.

Reference:
http://stackoverflow.com/questions/11278114/enable-remote-connections-for-sql-server-express-2012

SQL Server 2008: Cannot establish a connection. Verify the server and instance names, check that no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is running on the host

I was getting the error:

Cannot establish a connection to jdbc:sqlserver://FEMPUTADORA-PC\SQLEXPRESS;databaseName=pichincha using com.microsoft.sqlserver.jdbc.SQLServerDriver (The connection to the host FEMPUTADORA-PC, named instance sqlexpress has failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names, check that no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is running on the host.)

I solved it by enabling the SQL server browser:
1. Go to "start" > "contro panel" > "systems and security" > "administrative tools" > "services"
2. Right click in "SQL server browser" > propeties
3. Set Start up type as "automatic"
4. click on "start"
5. click on "ok"


SQL Server 2008: enable login to sa user

  1. Login using Windows Authentication and ".\SQLExpress" as Server Name
  2. Change server authentication mode - Right click on root, choose Properties, from Security tab select "SQL Server and Windows Authentication mode", click OK 
  3. Set sa password - Navigate to Security > Logins > sa, right click on it, choose Properties, from General tab set the Password (don't close the window) 
  4. Grant permission - Go to Status tab, make sure the Grant and Enabled radiobuttons are chosen, click OK 
  5. Restart SQLEXPRESS service from your local services
Source: