Skip to content

Unique constrains on different type [closed]

I have two columns like these: A = {1,2,3}; –> Integer[] Type B = 3; –> Integer Type I would like to UNIQUE constrains this 2 columns of different types. There is a method to compare all the …

C# INSERT to SQL method exception when DateTime parameter is null

One of my parameter looks like this: I know that User has null value in last_sign_in_at. Database accept nulls for this column but I get an exception: SqlException: The parameterized query ‘(@id int,@name nvarchar(18),@username nvarchar(11),@state nvarch’ expects the parameter ‘@last_sign_in…

Mysql comma seperated to json-array

I have some fields in the database that are comma selerated, something like: a,b,c,d,e and I want to convert them into: I know how to do it in nodejs / any other language, but I need to do it directly on the mysql Possible? Thanks Answer The simplest approach probably is to use string functions only: Basicall…

SQL select single row number x only

For processing SQL data in VBA I want to use a loop (For…Next) that reads line by line from a SQL database. As records were deleted the ID column has gaps. The table looks for example like this: Having four lines I would like to run of course a “For each” would do good, too. Answer If you wa…