Skip to content

Tag: sql

inserting into table with conditions

SQL. i have two tables residents (primary key rid) and dependents (primary key did). dependents is connected to residents through rid. I want to insert rows into dependents table only if the rid in the insert statement matches with any of the rid in the residents table. i tried the code below, but there is so…

Stored Procedure return default value?

in my database, there is a Stored Procedure with INSERT INTO statement. The problem is I want this stored procedure will return the StudentCode default value, I think it’s impossible to use the SELECT …

SQL Pivot of string

i have the following data in SQL 2017 Number Description Value 37 Recorded 2019-11-06T10:51:25.482-05:00 37 ICD10Code Z32.00 37 ICD10Desc Encounter 37 Status …