Skip to content
Advertisement

Tag: sql-server

Using 0 as Primary Key

I use lookup tables commonly and sometimes I have some default record in the Lookup table and I think for this record I can use 0 as Primary Key a as shown below: Project: By doing this I can start from 1 for the actual project values (A, B, C…) and on the other hand I can easily distinguish general/default

Transfer Views – ‘value()’ requires a singleton (or empty sequence), found operand of type ‘xdt:untypedAtomic *’

I am trying to transfer views from the AdventureWorks2014 database from one SQL Server to another using Java and JDBC. In order to obtain the structure of the view, I use the stored procedure “sp_helptext” like this: ResultSet rs = statement.executeQuery(“EXEC sp_helptext ‘” + view + “‘;”); where view is the schema and view name (e.g., “dbo.myview”) that I am

SQL Server JDBC Error: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

Background: Application Server: Java Based Application is running on Windows Server 2008 R2 Enterprise. Java Version on this Server is Version 6 Update 32. JDBC Driver Version: 4.0 Database Server: The database server has been recently upgraded(Side by side upgrade with the same servername as the one before that the application use to connect to) from Windows 2016 to Windows

LocalDateTime and SQL Server JDBC 4.2 driver

I’m trying to use new java.time classes with most recent version of Sql Server JDBC driver. As I read it should just work with methods: PreparedStatement.setObject() and ResultSet.getObject(). So I created sample code, and can’t get it work with ResultSets. I don’t know what I’m doing wrong here. This throws an exception: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion to class java.time.LocalDateTime is unsupported.

How to resolve SQLServerException: Invalid object name?

I am creating a spring boot application using MS SQL server. I have a requirement where I need to initialize USERS table in user_database database using data.sql file placed in /src/main/resources/ folder and rest of the tables should be created automatically in springboot_db database with the help of @Table annotation. Below is the code snippet. applicaiton.properties file data.sql AppConfiguration.java (One

Advertisement