-
Notifications
You must be signed in to change notification settings - Fork 2
/
Fix_wade_data.txt
202 lines (163 loc) · 3.71 KB
/
Fix_wade_data.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
Improvements to WaDE data
1. Add the M and I data (something wrong with the underlying data)
2. Add the acreage for iirigated areas
STEPS
1. In the "WaDEwre" database, go to Stored procedures, right click at "wu_UpdateWade" function and choose "Modify"
Description: This procedure takes data from waterdata to update
-- WaDE. The years to update are found int the YEARS
-- data table in waterdata.
dbo.WATERDATA
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [WATERRESID]
,[WRENAME]
,[COUNTY]
,[Basin]
,[HistBase2010]
,[Base2020]
,[Base2030]
,[Base2040]
,[Base2050]
,[Base2060]
,[Base2070]
FROM [WaterDemand].[dbo].[Population]
connects the Model ID and the Sub-area (one ModelID for each Sub-Area)
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [ID]
,[ModelID]
,[MunGrpID]
,[WResID]
,[Name]
FROM [waterdata].[dbo].[ModelMunProv]
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [ID]
,[ModelID]
,[Basin]
,[BasinName]
,[Subarea]
,[BasinNum]
,[SubareaName]
,[RipIn]
,[RipUp]
,[RipDown]
,[MnIUtahPro]
FROM [waterdata].[dbo].[ModelSubarea]
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [ID]
,[RptDate]
,[RptYear]
,[ModelID]
,[Surf1]
,[Surf2]
,[Surf3]
,[Surf4]
,[Surf5]
,[Surf6]
,[Surf7]
,[Surf8]
,[Surf9]
,[Surf10]
,[Surf11]
,[Surf12]
,[SurfAnn]
,[GW1]
,[GW2]
,[GW3]
,[GW4]
,[GW5]
,[GW6]
,[GW7]
,[GW8]
,[GW9]
,[GW10]
,[GW11]
,[GW12]
,[GWAnn]
,[Dep1]
,[Dep2]
,[Dep3]
,[Dep4]
,[Dep5]
,[Dep6]
,[Dep7]
,[Dep8]
,[Dep9]
,[Dep10]
,[Dep11]
,[Dep12]
,[DepAnn]
,[SSIDep1]
,[SSIDep2]
,[SSIDep3]
,[SSIDep4]
,[SSIDep5]
,[SSIDep6]
,[SSIDep7]
,[SSIDep8]
,[SSIDep9]
,[SSIDep10]
,[SSIDep11]
,[SSIDep12]
,[SSIDepAnn]
FROM [waterdata].[dbo].[MunData]
order by ModelID,RptYear
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP 1000 [ID]
,[Lanum]
,[Lanumnew]
,[Laname]
,[Subarea]
,[SubName]
,[Basin]
,[YEAR]
,[Total]
,[Alfalfa]
,[Pasture]
,[Hay]
,[Grain]
,[Corn]
,[Orchard]
,[Sorghum]
,[Turf]
,[Onions]
,[OtherHort]
,[Potatoes]
,[Berries]
,[OtherVeg]
,[Tomatoes]
,[Beans]
,[Vineyard]
,[SubPast]
,[SubHay]
,[Safflower]
FROM [waterdata].[dbo].[LandUseByAreaYear]
ORDER BY Lanum,YEAR
/****** Script for SelectTopNRows command from SSMS ******/
SELECT [ORGANIZATION_ID]
,[REPORT_ID]
,[REPORT_UNIT_ID]
,[BENEFICIAL_USE_ID]
,[SUMMARY_SEQ]
,[ROW_SEQ]
,[AMOUNT]
,[CONSUMPTIVE_INDICATOR]
,[METHOD_ID]
,[START_DATE]
,[END_DATE]
FROM [WaDEwre].[wade].[S_USE_AMOUNT]
WHERE [ORGANIZATION_ID]='utwre' AND [REPORT_ID]='2005_ConsumptiveUse' AND [REPORT_UNIT_ID]='01-01-04'
USE [WaDEwre]
GO
SELECT [WaDEwre].[XML_USE_SUMMARY] (
'utwre' ,
'2005_ConsumptiveUse' ,
'01-01-04')
GO
USE [WaDEwre]
GO
SELECT [wade_r].[GetSummaryByLocation] (
'COUNTY',
'49005',
'utwre',
'2007_Diversion',
'USE')
GO