Skip to content

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