Click here to Skip to main content
14,664,816 members
Home » Discussions » Database
   

Database

 
AnswerRe: Copy structure of all the tables of one database to another server Pin
Eddy Vluggen3-Feb-20 3:01
professionalEddy Vluggen3-Feb-20 3:01 
Questionintegrity constraint Pin
Tara1129-Jan-20 10:36
MemberTara1129-Jan-20 10:36 
AnswerRe: integrity constraint Pin
Mycroft Holmes29-Jan-20 10:56
professionalMycroft Holmes29-Jan-20 10:56 
GeneralRe: integrity constraint Pin
Tara1129-Jan-20 11:05
MemberTara1129-Jan-20 11:05 
GeneralRe: integrity constraint Pin
Mycroft Holmes29-Jan-20 11:21
professionalMycroft Holmes29-Jan-20 11:21 
AnswerRe: integrity constraint Pin
Wendelius2-Feb-20 9:01
mveWendelius2-Feb-20 9:01 
QuestionOracle SQL query to MS-SQL Pin
Member 951930620-Jan-20 22:37
MemberMember 951930620-Jan-20 22:37 
AnswerRe: Oracle SQL query to MS-SQL Pin
Richard Deeming21-Jan-20 1:43
mveRichard Deeming21-Jan-20 1:43 
The tool doesn't seem to have done anything! Laugh | :laugh:

At a guess, you're looking for something like:
UPDATE
    c
SET
    stat = l.status, 
    statusdto = CASE SUBSTRING(l.statushaenstart, 7, 2)
        WHEN '00' THEN NULL 
        ELSE CONVERT(datetime, SUBSTRING(l.statushaenstart, 1, 8)) 
    END,
    pnrgaeld = l.pnrgaeld,
    koen = l.koen, 
    fornvnmrk = a.fornvn_mrk, 
    mellemnvnmrk = a.melnvn_mrk,
    efternvnmrk = a.efternvn_mrk,
    nvndto = CASE SUBSTRING(a.nvnhaenstart, 7, 2)
        WHEN '00' THEN NULL 
        ELSE CONVERT(datetime, SUBSTRING(a.nvnhaenstart, 1, 8)) 
    END, 
    fornvn_solo = UPPER(a.fornvn),
    fornvn = SUBSTRING(CASE
        WHEN a.melnvn Is Null THEN UPPER(a.fornvn)
        ELSE UPPER(a.fornvn) + ' ' + UPPER(a.melnvn)
    END, 1, 50), 
    mellemnvn = UPPER(a.melnvn),
    efternvn = UPPER(a.efternvn),
    adr_fornvn = UPPER(LTRIM(SUBSTRING(a.adrnvn, CHARINDEX(',', a.adrnvn) + 1, LEN(a.adrnvn)))),
    adr_efternvn = UPPER(SUBSTRING(a.adrnvn, 1, CHARINDEX(',', a.adrnvn) - 1)),
    stilling = UPPER(l.stilling),
    z_stilling = l.stilling,
    z_fornvn = SUBSTRING(CASE
        WHEN a.melnvn Is Null THEN a.fornvn
        ELSE a.fornvn + ' ' + a.melnvn
    END, 1, 50),
    z_mellemnvn = a.melnvn,
    z_efternvn = a.efternvn,
    z_adr_fornvn = LTRIM(SUBSTRING(a.adrnvn, CHARINDEX(',', a.adrnvn) + 1, LEN(a.adrnvn))), 
    z_adr_efternvn = SUBSTRING(a.adrnvn, 1, CHARINDEX(',', a.adrnvn) - 1), 
    z_fornvn_solo = a.fornvn,
    haenstart_umrk_navne = a.haenstart_umrk_navne,
    stillingdto = Null,
    mynkod_ctnavn = Null,
    myntxt_ctnavn = Null,
    indrap = Null,
    adrnvndto = Null,
    soegnvn = Null,
    soegnvndto = Null
FROM
    folk.individ As c
    INNER JOIN folk.lperson2010 As l ON l.pnr = c.pnr
    INNER JOIN folk.laktnvnopl2010 a ON a.pnr = c.pnr
WHERE
    l.lseq BETWEEN 1 AND 6000
;




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Oracle SQL query to MS-SQL Pin
Member 951930628-Jan-20 22:44
MemberMember 951930628-Jan-20 22:44 
GeneralRe: Oracle SQL query to MS-SQL Pin
Mycroft Holmes29-Jan-20 10:59
professionalMycroft Holmes29-Jan-20 10:59 
Questionsplit time then group by 15 min mongodb Pin
Member 1300557210-Jan-20 21:56
MemberMember 1300557210-Jan-20 21:56 
QuestionSQL Query with a Loop Pin
Bobby Underwood6-Jan-20 4:58
MemberBobby Underwood6-Jan-20 4:58 
AnswerRe: SQL Query with a Loop Pin
#realJSOP6-Jan-20 5:04
mva#realJSOP6-Jan-20 5:04 
AnswerRe: SQL Query with a Loop Pin
Bobby Underwood6-Jan-20 5:11
MemberBobby Underwood6-Jan-20 5:11 
AnswerRe: SQL Query with a Loop Pin
#realJSOP6-Jan-20 5:16
mva#realJSOP6-Jan-20 5:16 
GeneralRe: SQL Query with a Loop Pin
Bobby Underwood6-Jan-20 5:22
MemberBobby Underwood6-Jan-20 5:22 
AnswerRe: SQL Query with a Loop Pin
Jörgen Andersson7-Jan-20 5:52
professionalJörgen Andersson7-Jan-20 5:52 
Questionincorrect syntax near begin expecting external for Alter Procedure Pin
simpledeveloper27-Dec-19 9:23
Membersimpledeveloper27-Dec-19 9:23 
AnswerRe: incorrect syntax near begin expecting external for Alter Procedure Pin
Jörgen Andersson27-Dec-19 23:14
professionalJörgen Andersson27-Dec-19 23:14 
QuestionAdding multiple columns with condition Pin
simpledeveloper26-Dec-19 14:58
Membersimpledeveloper26-Dec-19 14:58 
AnswerRe: Adding multiple columns with condition Pin
Mycroft Holmes26-Dec-19 19:58
professionalMycroft Holmes26-Dec-19 19:58 
AnswerRe: Adding multiple columns with condition Pin
Jörgen Andersson27-Dec-19 3:40
professionalJörgen Andersson27-Dec-19 3:40 
GeneralRe: Adding multiple columns with condition Pin
simpledeveloper27-Dec-19 5:29
Membersimpledeveloper27-Dec-19 5:29 
GeneralRe: Adding multiple columns with condition Pin
Jörgen Andersson27-Dec-19 5:32
professionalJörgen Andersson27-Dec-19 5:32 
GeneralRe: Adding multiple columns with condition Pin
simpledeveloper27-Dec-19 8:44
Membersimpledeveloper27-Dec-19 8:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.