USE AgeDx DROP TABLE #temp SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows SELECT CAST([id] as int) as id [icd9] 2 ‚ IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM] IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath] INTO dbo.final FROM #temp

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter7: Database Administration
Section: Chapter Questions
Problem 4TD: Write, but do not execute, the commands to grant the following privileges: a. User Ashton must be...
icon
Related questions
Question

I keep getting errors for this code in SQL but i cant seem to fix it, assuming the names for the files are correct is there any obvious errors?

9
AVAL
USE AgeDx
DROP TABLE #temp
SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows
INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows
SELECT CAST([id] as int) as id
[icd9]
www.vjpe
9
INTO dbo.final
FROM #temp
IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx
IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM]
IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath]
Transcribed Image Text:9 AVAL USE AgeDx DROP TABLE #temp SELECT * INTO #temp FROM [dbo].[DxAge_1] -- 4233546 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_2] -- 5223128 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_3] -- 4179754 rows INSERT INTO #temp SELECT * FROM [dbo].[DxAge_4] -- 3807014 rows SELECT CAST([id] as int) as id [icd9] www.vjpe 9 INTO dbo.final FROM #temp IIF([AgeAtDx] = 'NULL', null, CAST([AgeAtDx] as float)) as AgeAtDx IIF(AgeAtFirstDM = 'NULL', null, CAST([AgeAtFirstDM]as float)) as [AgeAtFirstDM] IIF(AgeAtDeath ='NULL',null, CAST([AgeAtDeath]as float)) as [AgeAtDeath]
Expert Solution
steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Windows
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr