1

Re: Remote desktop: Error when saving records

Dear all

Hoping someone can help.

Working on a remote desktop with Recorder 6.14.4.212 when trying to save a record we get an error see below for text. Other than this Recorder works fine on the remote desktop (reports etc). It just seems unable to write from the remote desktop. I can find no references to this type of problem anywhere else on the forum - but I could be missing them.

This problem only occurs on the remote desktop. I also have Recorder installed non-remotely on my desktop (but obviously connected to the same SQL server as when it is used on a remote desktop) this causes no problems.

Anyone any ideas?

Thanks

Andy

date/time         : 2009-08-21, 10:35:40, 906ms
computer name     : WISBGTS
wts client name   : 1125WPPDS
user name         : andrewsalisbury
operating system  : Windows 2003 Service Pack 2 build 3790
system language   : English
system up time    : 1 day 6 hours
program up time   : 5 minutes 6 seconds
processors        : 2x Intel(R) Xeon(TM) CPU 2.80GHz
physical memory   : 554/1023 MB (free/total)
free disk space   : (K:) 126.63 GB
display mode      : 1280x1024, 16 bit
process id        : $1328
allocated memory  : 16.26 MB
command line      : RecorderApp.exe /65700
executable        : RecorderApp.exe
exec. date/time   : 2009-08-05 13:49
version           : 6.14.4.212
madExcept version : 2.7k
exception class   : EOleException
exception message : Invalid character value for cast specification.

main thread ($d28):
00562202 RecorderApp.exe 
7739c332 user32.dll       SendMessageW
773b045e user32.dll       CallWindowProcA
773a16e0 user32.dll       DispatchMessageA

thread $378:
7c82860c ntdll.dll     KiFastSystemCallRet
7c827d17 ntdll.dll     NtWaitForMultipleObjects
77e62026 kernel32.dll  WaitForMultipleObjectsEx
7739bbcb user32.dll    MsgWaitForMultipleObjectsEx
7739ce31 user32.dll    MsgWaitForMultipleObjects
>> created by main thread ($d28) at:
4dd695ef gdiplus.dll   

thread $c6c:
7c82860c ntdll.dll   KiFastSystemCallRet
7c827857 ntdll.dll   NtReplyWaitReceivePortEx
>> created by main thread ($d28) at:
77c7411a RPCRT4.dll 

thread $3e4:
7c82860c ntdll.dll     KiFastSystemCallRet
7c827d27 ntdll.dll     NtWaitForSingleObject
77e61d18 kernel32.dll  WaitForSingleObjectEx
77e61c88 kernel32.dll  WaitForSingleObject

modules:
00330000 C4DLL.DLL       1.0.0.1           \\wisdb\Recorder 6 Server
003a0000 MS5User.Dll     5.0.0.4           \\wisdb\Recorder 6 Server
00400000 RecorderApp.exe 6.14.4.212        \\wisdb\Recorder 6 Server
01650000 ms5cnv.dll      5.0.0.10          \\wisdb\Recorder 6 Server
01a00000 odbcint.dll     3.526.3959.0      C:\WINDOWS\system32
02c50000 xpsp2res.dll    5.2.3790.3959     C:\WINDOWS\system32
03020000 W03A2409.dll    5.2.3790.4043     C:\WINDOWS\system32
039f0000 SQLOLEDB.RLL    2000.86.3959.0    C:\Program Files\Common Files\System\Ole DB
03a00000 msadcer.dll     2.82.3959.0       C:\Program Files\Common Files\System\msadc
03d40000 GOTOGR~1.OCX    2.0.0.16          \\wisdb\Recorder 6 Server\Addins
03f00000 GoToKey.ocx     6.0.1.8           \\wisdb\Recorder 6 Server\Addins
04050000 msdadc.dll      1.50.3506.0       C:\M827.WIN\Pervasive v81\Update\system\win32\register
041a0000 SHOWUN~1.OCX    6.0.0.11          \\wisdb\Recorder 6 Server\Addins
043b0000 STDVAL~1.DLL    6.14.3.208        \\wisdb\Recorder 6 Server\Addins
10000000 MS5.Dll         5.0.0.12          \\wisdb\Recorder 6 Server
48890000 odbc32.dll      3.526.3959.0      C:\WINDOWS\system32
4a710000 comsvcs.dll     2001.12.4720.3959 C:\WINDOWS\system32
4b3c0000 MSCTF.dll       5.2.3790.3959     C:\WINDOWS\system32
4b750000 HHCtrl.ocx      5.2.3790.3959     C:\WINDOWS\system32
4bbe0000 msado15.dll     2.82.3959.0       C:\Program Files\Common Files\System\ado
4c850000 oledb32.dll     2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
4d140000 msadce.dll      2.82.3959.0       C:\Program Files\Common Files\System\msadc
4dbb0000 OLEDB32R.DLL    2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
4dd60000 gdiplus.dll     5.2.3790.4278     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.3790.4278_x-ww_AD682293
4e250000 sqloledb.dll    2000.86.3959.0    C:\Program Files\Common Files\System\Ole DB
552f0000 SOPHOS~1.DLL    1.0.0.4021        C:\PROGRA~1\Sophos\SOPHOS~1
5e9a0000 olepro32.dll    5.2.3790.3959     C:\WINDOWS\system32
60970000 mslbui.dll      5.2.3790.3959     C:\WINDOWS\system32
61200000 MSDATL3.dll     2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
68000000 rsaenh.dll      5.2.3790.3959     C:\WINDOWS\system32
68100000 dssenh.dll      5.2.3790.3959     C:\WINDOWS\system32
69b10000 msxml4.dll      4.20.9870.0       c:\WINDOWS\system32
6d560000 DBNETLIB.DLL    2000.86.3959.0    C:\WINDOWS\system32
71b70000 uxtheme.dll     6.0.3790.3959     C:\WINDOWS\system32
71bb0000 wsock32.dll     5.2.3790.0        C:\WINDOWS\system32
71bc0000 rdpsnd.dll      5.2.3790.0        C:\WINDOWS\system32
71bd0000 mpr.dll         5.2.3790.3959     C:\WINDOWS\system32
71bf0000 WS2HELP.dll     5.2.3790.3959     C:\WINDOWS\system32
71c00000 WS2_32.dll      5.2.3790.3959     C:\WINDOWS\system32
71c20000 tsappcmp.dll    5.2.3790.3959     C:\WINDOWS\system32
71c40000 NETAPI32.dll    5.2.3790.4392     C:\WINDOWS\system32
71f60000 security.dll    5.2.3790.0        C:\WINDOWS\system32
73070000 winspool.drv    5.2.3790.3959     C:\WINDOWS\system32
73440000 RICHED32.DLL    5.2.3790.0        C:\WINDOWS\system32
74a50000 MSDART.DLL      2.82.3959.0       C:\WINDOWS\system32
74c40000 RICHED20.dll    5.31.23.1225      C:\WINDOWS\system32
75da0000 SXS.DLL         5.2.3790.3959     C:\WINDOWS\system32
76190000 MSASN1.dll      5.2.3790.3959     C:\WINDOWS\system32
761b0000 crypt32.dll     5.131.3790.3959   C:\WINDOWS\system32
762b0000 comdlg32.dll    6.0.3790.3959     C:\WINDOWS\system32
766d0000 SHFolder.dll    6.0.3790.3959     C:\WINDOWS\system32
766e0000 cryptdll.dll    5.2.3790.3959     C:\WINDOWS\system32
766f0000 ntdsapi.dll     5.2.3790.3959     C:\WINDOWS\system32
76750000 schannel.dll    5.2.3790.4530     C:\WINDOWS\system32
76920000 USERENV.dll     5.2.3790.3959     C:\WINDOWS\system32
76aa0000 winmm.dll       5.2.3790.3959     C:\WINDOWS\system32
76b70000 PSAPI.DLL       5.2.3790.3959     C:\WINDOWS\system32
76c90000 msv1_0.dll      5.2.3790.4530     C:\WINDOWS\system32
76cf0000 iphlpapi.dll    5.2.3790.3959     C:\WINDOWS\system32
76ed0000 DNSAPI.dll      5.2.3790.4318     C:\WINDOWS\system32
76f00000 wtsapi32.dll    5.2.3790.3959     C:\WINDOWS\system32
76f10000 WLDAP32.dll     5.2.3790.3959     C:\WINDOWS\system32
76f50000 Secur32.dll     5.2.3790.4530     C:\WINDOWS\system32
77010000 COMRes.dll      2001.12.4720.3959 C:\WINDOWS\system32
771f0000 WINSTA.dll      5.2.3790.3959     C:\WINDOWS\system32
77380000 user32.dll      5.2.3790.4033     C:\WINDOWS\system32
77420000 comctl32.dll    6.0.3790.3959     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55
77530000 comctl32.dll    5.82.3790.3959    C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0
77670000 ole32.dll       5.2.3790.3959     C:\WINDOWS\system32
777b0000 CLBCatQ.DLL     2001.12.4720.3959 C:\WINDOWS\system32
77b90000 version.dll     5.2.3790.3959     C:\WINDOWS\system32
77ba0000 msvcrt.dll      7.0.3790.3959     C:\WINDOWS\system32
77c00000 GDI32.dll       5.2.3790.4396     C:\WINDOWS\system32
77c50000 RPCRT4.dll      5.2.3790.4115     C:\WINDOWS\system32
77d00000 oleaut32.dll    5.2.3790.4202     C:\WINDOWS\system32
77da0000 SHLWAPI.dll     6.0.3790.3959     C:\WINDOWS\system32
77e40000 kernel32.dll    5.2.3790.4480     C:\WINDOWS\system32
77ff0000 DBnmpNTw.dll    2000.86.3959.0    C:\WINDOWS\system32
7c800000 ntdll.dll       5.2.3790.4455     C:\WINDOWS\system32
7c8d0000 shell32.dll     6.0.3790.4315     C:\WINDOWS\system32
7d1e0000 ADVAPI32.dll    5.2.3790.4455     C:\WINDOWS\syst

2

Re: Remote desktop: Error when saving records

Hi Andrew,

Whereabouts in particular does this error occur?  Also was this working ok on 6.13?

Thanks,

Simon Wood
[url=http://www.dorsetsoftware.com/]Dorset Software Services[/url]

3

Re: Remote desktop: Error when saving records

Whereabouts in particular does this error occur? 

The one I quoted happens when pressing save on the species record form.

Similar errors happen from recording card and add species observation again when pressing save.

Also was this working ok on 6.13?

No

Its confused me and our IT dept is at a loss too.

Thanks

Andy

4

Re: Remote desktop: Error when saving records

Ok Andy, a few things to have a look at:

Can you create any records whatsoever via the remote desktop?  For example can you create a new Survey, or perhaps a new document, or even add a determination to an exsiting occurence? If not, do you always receive the same error? 

Are the regional settings under Windows set to anything obscure?  They're probably not, but it is worth checking just in case.

Can you please ensure that under tools, options, the spatial reference system specified is the same as on your local machine.

Also when you login to the remote desktop machine, do you use the same credentials as you do for your local machine, i.e. if you're on a network do you use the same domain account? If not it may be worth trying it, otherwise give it a go when logged into the remote desktop as an admin.


If you have no joy with any of the above, then we'll delve into it further.

Kind regards

Simon Wood
[url=http://www.dorsetsoftware.com/]Dorset Software Services[/url]

5

Re: Remote desktop: Error when saving records

Thanks Simon

I waiting to hear back from out IT dept and someone at another site – but it now appears to be working (for now)

Firstly I found I was able to add a document/subsite – but still not a record.

I then made sure all settings were the same on local and remote server – the GR system was the same (UK grid) – but I checked the box and then unchecked it just in case.

I can now add records – via observations or enter a species record.

I’m waiting for a user at another site to give it a go – and will post if they are successful or not.

As to the regional setting I think these are normal – waiting for our IT dept to get back to me.

Thanks again – crossed fingers that the other user will be successful.

Andy

6

Re: Remote desktop: Error when saving records

Hello again

Bad news the problem still occurs - it has taken a while for my other users at other sites to have a go and the error.

The latest error report below (seems to be the same problem)

date/time         : 2009-11-04, 11:33:39, 736ms
computer name     : WISBGTS
wts client name   : 1826HHPLANTRECO
user name         : JeanetteJones
operating system  : Windows 2003 Service Pack 2 build 3790
system language   : English
system up time    : 10 days 20 hours
program up time   : 1 minute 40 seconds
processors        : 2x Intel(R) Xeon(TM) CPU 2.80GHz
physical memory   : 416/1023 MB (free/total)
free disk space   : (K:) 111.40 GB
display mode      : 1024x768, 16 bit
process id        : $c8c
allocated memory  : 16.10 MB
command line      : RecorderApp.exe /327872
executable        : RecorderApp.exe
exec. date/time   : 2009-08-05 12:49
version           : 6.14.4.212
madExcept version : 2.7k
exception class   : EOleException
exception message : Invalid character value for cast specification.

main thread ($1550):
00562202 RecorderApp.exe 
7739c332 user32.dll       SendMessageW
773b045e user32.dll       CallWindowProcA
773a16e0 user32.dll       DispatchMessageA

thread $af0:
7c82860c ntdll.dll  KiFastSystemCallRet
7c827d17 ntdll.dll  NtWaitForMultipleObjects

thread $324:
7c82860c ntdll.dll     KiFastSystemCallRet
7c827d17 ntdll.dll     NtWaitForMultipleObjects
77e62026 kernel32.dll  WaitForMultipleObjectsEx
7739bbcb user32.dll    MsgWaitForMultipleObjectsEx
7739ce31 user32.dll    MsgWaitForMultipleObjects
>> created by main thread ($1550) at:
4dd77b7f gdiplus.dll   

thread $ffc:
7c82860c ntdll.dll   KiFastSystemCallRet
7c827857 ntdll.dll   NtReplyWaitReceivePortEx
>> created by main thread ($1550) at:
77c7411a RPCRT4.dll 

thread $1084:
7c82860c ntdll.dll     KiFastSystemCallRet
7c827d27 ntdll.dll     NtWaitForSingleObject
77e61d18 kernel32.dll  WaitForSingleObjectEx
77e61c88 kernel32.dll  WaitForSingleObject

modules:
00330000 C4DLL.DLL       1.0.0.1           \\wisdb\Recorder 6 Server
003a0000 MS5User.Dll     5.0.0.4           \\wisdb\Recorder 6 Server
00400000 RecorderApp.exe 6.14.4.212        \\wisdb\Recorder 6 Server
01650000 ms5cnv.dll      5.0.0.10          \\wisdb\Recorder 6 Server
019f0000 odbcint.dll     3.526.3959.0      C:\WINDOWS\system32
02c40000 xpsp2res.dll    5.2.3790.3959     C:\WINDOWS\system32
03010000 W03A2409.dll    5.2.3790.4043     C:\WINDOWS\system32
039d0000 SQLOLEDB.RLL    2000.86.3959.0    C:\Program Files\Common Files\System\Ole DB
039e0000 msadcer.dll     2.82.3959.0       C:\Program Files\Common Files\System\msadc
03d20000 GOTOGR~1.OCX    2.0.0.16          \\wisdb\Recorder 6 Server\Addins
03ee0000 GoToKey.ocx     6.0.1.8           \\wisdb\Recorder 6 Server\Addins
04050000 msdadc.dll      1.50.3506.0       C:\M827.WIN\Pervasive v81\Update\system\win32\register
041a0000 SHOWUN~1.OCX    6.0.0.11          \\wisdb\Recorder 6 Server\Addins
043b0000 STDVAL~1.DLL    6.14.3.208        \\wisdb\Recorder 6 Server\Addins
10000000 MS5.Dll         5.0.0.12          \\wisdb\Recorder 6 Server
48890000 odbc32.dll      3.526.3959.0      C:\WINDOWS\system32
4a710000 comsvcs.dll     2001.12.4720.3959 C:\WINDOWS\system32
4b3c0000 MSCTF.dll       5.2.3790.3959     C:\WINDOWS\system32
4b750000 HHCtrl.ocx      5.2.3790.3959     C:\WINDOWS\system32
4bbe0000 msado15.dll     2.82.3959.0       C:\Program Files\Common Files\System\ado
4c850000 oledb32.dll     2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
4d140000 msadce.dll      2.82.3959.0       C:\Program Files\Common Files\System\msadc
4dbb0000 OLEDB32R.DLL    2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
4dd60000 gdiplus.dll     5.2.6001.22319    C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6001.22319_x-ww_F0B4C2DF
4e250000 sqloledb.dll    2000.86.3959.0    C:\Program Files\Common Files\System\Ole DB
5e9a0000 olepro32.dll    5.2.3790.3959     C:\WINDOWS\system32
60970000 mslbui.dll      5.2.3790.3959     C:\WINDOWS\system32
61200000 MSDATL3.dll     2.82.3959.0       C:\Program Files\Common Files\System\Ole DB
68000000 rsaenh.dll      5.2.3790.3959     C:\WINDOWS\system32
68100000 dssenh.dll      5.2.3790.3959     C:\WINDOWS\system32
69b10000 msxml4.dll      4.20.9870.0       c:\WINDOWS\system32
6d560000 DBNETLIB.DLL    2000.86.3959.0    C:\WINDOWS\system32
6fa00000 SOPHOS~1.DLL    1.0.0.4030        C:\PROGRA~1\Sophos\SOPHOS~1
71b70000 uxtheme.dll     6.0.3790.3959     C:\WINDOWS\system32
71bb0000 wsock32.dll     5.2.3790.0        C:\WINDOWS\system32
71bc0000 rdpsnd.dll      5.2.3790.0        C:\WINDOWS\system32
71bd0000 mpr.dll         5.2.3790.3959     C:\WINDOWS\system32
71bf0000 WS2HELP.dll     5.2.3790.3959     C:\WINDOWS\system32
71c00000 WS2_32.dll      5.2.3790.3959     C:\WINDOWS\system32
71c20000 tsappcmp.dll    5.2.3790.3959     C:\WINDOWS\system32
71c40000 NETAPI32.dll    5.2.3790.4392     C:\WINDOWS\system32
71f60000 security.dll    5.2.3790.0        C:\WINDOWS\system32
73070000 winspool.drv    5.2.3790.3959     C:\WINDOWS\system32
73440000 RICHED32.DLL    5.2.3790.0        C:\WINDOWS\system32
74a50000 MSDART.DLL      2.82.3959.0       C:\WINDOWS\system32
74c40000 RICHED20.dll    5.31.23.1225      C:\WINDOWS\system32
75da0000 SXS.DLL         5.2.3790.3959     C:\WINDOWS\system32
76190000 MSASN1.dll      5.2.3790.4584     C:\WINDOWS\system32
761b0000 crypt32.dll     5.131.3790.3959   C:\WINDOWS\system32
762b0000 comdlg32.dll    6.0.3790.3959     C:\WINDOWS\system32
766d0000 SHFolder.dll    6.0.3790.3959     C:\WINDOWS\system32
766e0000 cryptdll.dll    5.2.3790.3959     C:\WINDOWS\system32
766f0000 ntdsapi.dll     5.2.3790.3959     C:\WINDOWS\system32
76750000 schannel.dll    5.2.3790.4530     C:\WINDOWS\system32
76920000 USERENV.dll     5.2.3790.3959     C:\WINDOWS\system32
76aa0000 winmm.dll       5.2.3790.3959     C:\WINDOWS\system32
76b70000 PSAPI.DLL       5.2.3790.3959     C:\WINDOWS\system32
76c90000 msv1_0.dll      5.2.3790.4587     C:\WINDOWS\system32
76cf0000 iphlpapi.dll    5.2.3790.3959     C:\WINDOWS\system32
76ed0000 DNSAPI.dll      5.2.3790.4318     C:\WINDOWS\system32
76f00000 wtsapi32.dll    5.2.3790.3959     C:\WINDOWS\system32
76f10000 WLDAP32.dll     5.2.3790.3959     C:\WINDOWS\system32
76f50000 Secur32.dll     5.2.3790.4530     C:\WINDOWS\system32
77010000 COMRes.dll      2001.12.4720.3959 C:\WINDOWS\system32
771f0000 WINSTA.dll      5.2.3790.3959     C:\WINDOWS\system32
77380000 user32.dll      5.2.3790.4033     C:\WINDOWS\system32
77420000 comctl32.dll    6.0.3790.3959     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55
77530000 comctl32.dll    5.82.3790.3959    C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0
77670000 ole32.dll       5.2.3790.3959     C:\WINDOWS\system32
777b0000 CLBCatQ.DLL     2001.12.4720.3959 C:\WINDOWS\system32
77b90000 version.dll     5.2.3790.3959     C:\WINDOWS\system32
77ba0000 msvcrt.dll      7.0.3790.3959     C:\WINDOWS\system32
77c00000 GDI32.dll       5.2.3790.4396     C:\WINDOWS\system32
77c50000 RPCRT4.dll      5.2.3790.4115     C:\WINDOWS\system32
77d00000 oleaut32.dll    5.2.3790.4202     C:\WINDOWS\system32
77da0000 SHLWAPI.dll     6.0.3790.3959     C:\WINDOWS\system32
77e40000 kernel32.dll    5.2.3790.4480     C:\WINDOWS\system32
77ff0000 DBnmpNTw.dll    2000.86.3959.0    C:\WINDOWS\system32
7c800000 ntdll.dll       5.2.3790.4455     C:\WINDOWS\system32
7c8d0000 shell32.dll     6.0.3790.4315     C:\WINDOWS\system32
7d1e0000 ADVAPI32.dll    5.2.3790.4455     C:\WINDOWS\system32

7

Re: Remote desktop: Error when saving records

Hi Andrew,

This error normally occurs when saving data to a database that is not in the correct format for the field it is being saved into. It's a bit odd that remote desktop makes any difference though.

Are you able to ask your IT dept to use the "SQL Profiler" tool (supplied with SQL Server) to grab a trace of the last query that is being run when the error occurs? If so that information might be very useful in working out what is going on.

Regards

John van Breda
Biodiverse IT

8

Re: Remote desktop: Error when saving records

Thanks John

I'll see what I can find  out from our IT dept. The problem seems only to be offsite. I can add records via the remote desktop on, but at another site there is a problem.

Andy

9

Re: Remote desktop: Error when saving records

Hello again

Below is the transcript of the trace via the profiler and is a complete trace of the users actions when trying to eneter a record  from start to finish - our IT dept cannot see much wrong, however the error in Recorder still occured.

Andy

SET FMTONLY ON SELECT "Record_Type_Key", "Short_Name" FROM "Record_Type"
WHERE 1=2  SET FMTONLY OFF
go
SELECT "Record_Type_Key", "Short_Name" FROM "Record_Type"

go
SET FMTONLY ON SELECT "Substrate_Key", "Short_Name" FROM "Substrate"
WHERE 1=2  SET FMTONLY OFF
go
SELECT "Substrate_Key", "Short_Name" FROM "Substrate"

go
SET FMTONLY ON SELECT * FROM "SAMPLE_TYPE"
WHERE 1=2  SET FMTONLY OFF
go
SELECT * FROM "SAMPLE_TYPE"

go
select * from RECORD_TYPE
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_indexes_rowset N'RECORD_TYPE', NULL, NULL
go
SET NO_BROWSETABLE ON
go
select * from SUBSTRATE
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_indexes_rowset N'SUBSTRATE', NULL, NULL
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT "Specimen_Type_Key", "Short_Name" FROM "Specimen_Type"
WHERE 1=2  SET FMTONLY OFF
go
SELECT "Specimen_Type_Key", "Short_Name" FROM "Specimen_Type"

go
SELECT MEASUREMENT_QUALIFIER_KEY, SHORT_NAME FROM MEASUREMENT_QUALIFIER WHERE MEASUREMENT_TYPE_KEY='NBNSYS0000000004' ORDER BY SHORT_NAME

go
exec sp_executesql N'SELECT "S".SURVEY_KEY, "S".ITEM_NAME FROM "SURVEY" "S"
LEFT JOIN "User_Survey_Restriction" "USR"
     ON "USR"."Survey_Key" = "S"."Survey_Key"
    AND "USR"."Name_Key" = @P1
WHERE "USR"."Name_Key" IS NULL
ORDER BY S.ITEM_NAME
', N'@P1 varchar(16)', 'WA0001570000004M'
go
SELECT "Item_Name" FROM "Taxon_List"
WHERE "Taxon_List_Key" = 'NHMSYS0000871304'

go
SET FMTONLY ON SELECT DISTINCT ITN.Taxon_List_Item_Key, ITN.Abbreviation,        ITN.Authority, TL.Item_Name AS ListName,        dbo.ufn_FormattedSpeciesName( ITN.Actual_Name,                                      ITN.Authority,                                       ITN2.Authority,                                      ITN.Preferred_Name,                                      ITN.Actual_Name_Italic,                                      ITN.Preferred_Name_Italic,                                       TV.Attribute,                                      TR.Short_Name) AS ItemName FROM (Index_Taxon_Name ITN INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key) INNER JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key INNER JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key INNER JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key INNER JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key INNER JOIN Index_Taxon_Name ITN2 ON ITN2.Taxon_List_Item_Key    = TLI.Preferred_Name WHERE (ITN.Actual_Name LIKE 'pa%' OR ITN.Abbreviation LIKE 'pa%' OR ITN.Authority LIKE 'pa%')  AND ITN.Preferred_List=1 AND TLI.Taxon_List_Version_To IS NULL  AND TLV.Version >= (SELECT MAX(Version)    FROM Taxon_List_Version     WHERE Taxon_List_Key = (SELECT Taxon_List_Key From Taxon_List_Version WHERE Taxon_List_Version_Key = TLV.Taxon_List_Version_Key) AND Version_Is_Amendment = 0)
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SELECT DISTINCT ITN.Taxon_List_Item_Key, ITN.Abbreviation,        ITN.Authority, TL.Item_Name AS ListName,        dbo.ufn_FormattedSpeciesName( ITN.Actual_Name,                                      ITN.Authority,                                       ITN2.Authority,                                      ITN.Preferred_Name,                                      ITN.Actual_Name_Italic,                                      ITN.Preferred_Name_Italic,                                       TV.Attribute,                                      TR.Short_Name) AS ItemName FROM (Index_Taxon_Name ITN INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key) INNER JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key INNER JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key INNER JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key INNER JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key INNER JOIN Index_Taxon_Name ITN2 ON ITN2.Taxon_List_Item_Key    = TLI.Preferred_Name WHERE (ITN.Actual_Name LIKE 'pa%' OR ITN.Abbreviation LIKE 'pa%' OR ITN.Authority LIKE 'pa%')  AND ITN.Preferred_List=1 AND TLI.Taxon_List_Version_To IS NULL  AND TLV.Version >= (SELECT MAX(Version)    FROM Taxon_List_Version     WHERE Taxon_List_Key = (SELECT Taxon_List_Key From Taxon_List_Version WHERE Taxon_List_Version_Key = TLV.Taxon_List_Version_Key) AND Version_Is_Amendment = 0)

go
SELECT DISTINCT ITN.Taxon_List_Item_Key, ITN.Abbreviation,        ITN.Authority, TL.Item_Name AS ListName,        dbo.ufn_FormattedSpeciesName( ITN.Actual_Name,                                      ITN.Authority,                                       ITN2.Authority,                                      ITN.Preferred_Name,                                      ITN.Actual_Name_Italic,                                      ITN.Preferred_Name_Italic,                                       TV.Attribute,                                      TR.Short_Name) AS ItemName FROM (Index_Taxon_Name ITN INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key) INNER JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key INNER JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key INNER JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key INNER JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key INNER JOIN Index_Taxon_Name ITN2 ON ITN2.Taxon_List_Item_Key    = TLI.Preferred_Name WHERE (ITN.Actual_Name LIKE 'pa%' OR ITN.Abbreviation LIKE 'pa%' OR ITN.Authority LIKE 'pa%')  AND ITN.Preferred_List=1 AND TLI.Taxon_List_Version_To IS NULL  AND TLV.Version >= (SELECT MAX(Version)    FROM Taxon_List_Version     WHERE Taxon_List_Key = (SELECT Taxon_List_Key From Taxon_List_Version WHERE Taxon_List_Version_Key = TLV.Taxon_List_Version_Key) AND Version_Is_Amendment = 0)

go
SELECT "Item_Name" FROM "Taxon_List"
WHERE "Taxon_List_Key" = 'NHMSYS0000871304'

go
SELECT DISTINCT ITN.Taxon_List_Item_Key, ITN.Abbreviation,        ITN.Authority, TL.Item_Name AS ListName,        dbo.ufn_FormattedSpeciesName( ITN.Actual_Name,                                      ITN.Authority,                                       ITN2.Authority,                                      ITN.Preferred_Name,                                      ITN.Actual_Name_Italic,                                      ITN.Preferred_Name_Italic,                                       TV.Attribute,                                      TR.Short_Name) AS ItemName FROM (Index_Taxon_Name ITN INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key) INNER JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key INNER JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key INNER JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key INNER JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key INNER JOIN Index_Taxon_Name ITN2 ON ITN2.Taxon_List_Item_Key    = TLI.Preferred_Name WHERE (ITN.Actual_Name LIKE 'pa%' OR ITN.Abbreviation LIKE 'pa%' OR ITN.Authority LIKE 'pa%')  AND ITN.Preferred_List=1 AND TLI.Taxon_List_Version_To IS NULL  AND TLV.Version >= (SELECT MAX(Version)    FROM Taxon_List_Version     WHERE Taxon_List_Key = (SELECT Taxon_List_Key From Taxon_List_Version WHERE Taxon_List_Version_Key = TLV.Taxon_List_Version_Key) AND Version_Is_Amendment = 0)

go
SELECT DISTINCT ITN.Taxon_List_Item_Key, ITN.Abbreviation,        ITN.Authority, TL.Item_Name AS ListName,        dbo.ufn_FormattedSpeciesName( ITN.Actual_Name,                                      ITN.Authority,                                       ITN2.Authority,                                      ITN.Preferred_Name,                                      ITN.Actual_Name_Italic,                                      ITN.Preferred_Name_Italic,                                       TV.Attribute,                                      TR.Short_Name) AS ItemName FROM (Index_Taxon_Name ITN INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key) INNER JOIN Taxon_List TL ON TL.Taxon_List_Key = TLV.Taxon_List_Key INNER JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key INNER JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key INNER JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key INNER JOIN Index_Taxon_Name ITN2 ON ITN2.Taxon_List_Item_Key    = TLI.Preferred_Name WHERE (ITN.Actual_Name LIKE 'pa%' OR ITN.Abbreviation LIKE 'pa%' OR ITN.Authority LIKE 'pa%')  AND ITN.Preferred_List=1 AND TLI.Taxon_List_Version_To IS NULL  AND TLV.Version >= (SELECT MAX(Version)    FROM Taxon_List_Version     WHERE Taxon_List_Key = (SELECT Taxon_List_Key From Taxon_List_Version WHERE Taxon_List_Version_Key = TLV.Taxon_List_Version_Key) AND Version_Is_Amendment = 0)

go
SELECT DISTINCT TLI.Preferred_Name AS Preferred_Name_Key, ITN.Preferred_Name, ITN.Preferred_Name_Italic, ITN.Common_Name, ITN.Common_Name_Italic, ITN.Actual_Name, ITN.Actual_Name_Italic, ITN.Authority, TLV.Taxon_List_Key, TV.Attribute, TR.Short_Name AS RankName
FROM Index_Taxon_Name ITN JOIN Taxon_List_Item TLI ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key JOIN Taxon_List_Version TLV ON TLV.Taxon_List_Version_Key = ITN.Taxon_List_Version_Key
JOIN Taxon_Version TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key JOIN Taxon_Rank TR ON TR.Taxon_Rank_Key = TLI.Taxon_Rank_Key
WHERE ITN.Taxon_List_Item_Key = 'NHMSYS0000499023'

go
SET NO_BROWSETABLE OFF
go
SELECT Allow_Data_Entry FROM Index_Taxon_Name WHERE Taxon_List_Item_Key='NHMSYS0000499023'
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT L.Location_Key, LN.Item_Name, System_Supplied_Data FROM Location AS L INNER JOIN Location_Name AS LN ON L.Location_Key = LN.Location_Key WHERE L.Parent_Key IS NULL AND   LN.Preferred = 1  ORDER BY LN.Item_Name WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SET NO_BROWSETABLE OFF
go
SELECT L.Location_Key, LN.Item_Name, System_Supplied_Data FROM Location AS L INNER JOIN Location_Name AS LN ON L.Location_Key = LN.Location_Key WHERE L.Parent_Key IS NULL AND   LN.Preferred = 1  ORDER BY LN.Item_Name
go
SELECT TOP 1 1 FROM [LOCATION] WHERE [LOCATION_Key] = 'WA00015700000025'
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "Location_Type"
order By SHORT_NAME
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SELECT * FROM "Location_Type"
order By SHORT_NAME

go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "Location_Key" from  "Location_Name" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "Location_Name"
WHERE "Location_Key" = ' '
ORDER BY Item_Name
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "Location_Name"
WHERE "Location_Key" = @P1
ORDER BY Item_Name
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select Location_Key from  Location_Name WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LD"."Location_Key" from  "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT "S".Short_Name, "LD".* FROM "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key"
WHERE "LD"."Location_Key" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT "S".Short_Name, "LD".* FROM "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key"
WHERE "LD"."Location_Key" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LD.Location_Key from  Location_Designation AS LD INNER JOIN
          Site_Status AS S ON LD.Site_Status_Key = S.Site_Status_Key WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
SET FMTONLY ON select DT.[Master_Key] from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN [DataTable] AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SET FMTONLY ON select DT.[Master_Key] from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN LOCATION_DATA AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SET FMTONLY ON select DT.LOCATION_Key from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN LOCATION_DATA AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select LOCATION_Key from  LOCATION_DATA WHERE 1=2  SET FMTONLY OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "DT"."LOCATION_Key" from  (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key") WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT "DT"."LOCATION_DATA_Key" AS "Data_Key", "DT".Custodian, "DT".Data, "DT".Accuracy, "DT".Changed_By, "DT".Changed_Date, "DT".Measurement_Qualifier_Key, "MQ"."Short_Name" AS "Qualifier_Short_Name", "DT".Measurement_Unit_Key, "MU"."Short_Name" AS "Unit_Short_Name", "MT".Measurement_Type_Key, "MT"."Short_Name" AS "Type_Short_Name", "DT".Entered_By FROM (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key")
WHERE "DT"."LOCATION_Key"
= ' '
ORDER BY MT.Short_Name, MQ.Short_Name, DT.Data, MU.Short_Name, DT.Accuracy
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT "DT"."LOCATION_DATA_Key" AS "Data_Key", "DT".Custodian, "DT".Data, "DT".Accuracy, "DT".Changed_By, "DT".Changed_Date, "DT".Measurement_Qualifier_Key, "MQ"."Short_Name" AS "Qualifier_Short_Name", "DT".Measurement_Unit_Key, "MU"."Short_Name" AS "Unit_Short_Name", "MT".Measurement_Type_Key, "MT"."Short_Name" AS "Type_Short_Name", "DT".Entered_By FROM (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key")
WHERE "DT"."LOCATION_Key"
= @P1
ORDER BY MT.Short_Name, MQ.Short_Name, DT.Data, MU.Short_Name, DT.Accuracy
', N'@P1 varchar(16)', ''
go
SET FMTONLY ON select DT.LOCATION_Key from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN LOCATION_DATA AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_ADMIN_AREAS" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "LOCATION_ADMIN_AREAS"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "LOCATION_ADMIN_AREAS"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_ADMIN_AREAS WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "GRID_SQUARE" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  GRID_SQUARE WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "LAND_PARCEL" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "LAND_PARCEL"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "LAND_PARCEL"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  LAND_PARCEL WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_BOUNDARY" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "LOCATION_BOUNDARY"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "LOCATION_BOUNDARY"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_BOUNDARY WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY_1" from  "LOCATION_RELATION" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "LOCATION_RELATION"
WHERE "LOCATION_KEY_1" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "LOCATION_RELATION"
WHERE "LOCATION_KEY_1" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY_1 from  LOCATION_RELATION WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_USE" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "LOCATION_USE"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "LOCATION_USE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_USE WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_GetSiteID', 1, NULL, NULL
go
declare @P1 varchar(8)
set @P1=NULL
exec usp_GetSiteID @P1 output
select @P1
go
SET FMTONLY ON select "LOCATION_KEY" from  "TENURE" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "TENURE"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "TENURE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', NULL
go
SET FMTONLY ON select LOCATION_KEY from  TENURE WHERE 1=2  SET FMTONLY OFF
go
select * from TENURE_TYPE
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_indexes_rowset N'TENURE_TYPE', NULL, NULL
go
EXECUTE usp_Polygon_Layers_Get
go
SET FMTONLY ON select "Location_Key" from  "Location" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "Location"
WHERE "Location_Key" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "Location"
WHERE "Location_Key" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select "Location_Key" from  "Location_Name" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "Location_Name"
WHERE "Location_Key" = @P1
ORDER BY Item_Name
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select Location_Key from  Location_Name WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON SELECT * FROM "Site_Status"
ORDER BY Short_Name
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SELECT * FROM "Site_Status"
ORDER BY Short_Name

go
SET FMTONLY ON select "LD"."Location_Key" from  "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT "S".Short_Name, "LD".* FROM "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key"
WHERE "LD"."Location_Key" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LD.Location_Key from  Location_Designation AS LD INNER JOIN
          Site_Status AS S ON LD.Site_Status_Key = S.Site_Status_Key WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "DT"."LOCATION_Key" from  (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key") WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT "DT"."LOCATION_DATA_Key" AS "Data_Key", "DT".Custodian, "DT".Data, "DT".Accuracy, "DT".Changed_By, "DT".Changed_Date, "DT".Measurement_Qualifier_Key, "MQ"."Short_Name" AS "Qualifier_Short_Name", "DT".Measurement_Unit_Key, "MU"."Short_Name" AS "Unit_Short_Name", "MT".Measurement_Type_Key, "MT"."Short_Name" AS "Type_Short_Name", "DT".Entered_By FROM (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key")
WHERE "DT"."LOCATION_Key"
= @P1
ORDER BY MT.Short_Name, MQ.Short_Name, DT.Data, MU.Short_Name, DT.Accuracy
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select DT.LOCATION_Key from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN LOCATION_DATA AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_ADMIN_AREAS" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_ADMIN_AREAS"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON SELECT * FROM [ADMIN_AREA] WHERE ADMIN_AREA_KEY = 'NBNSYS0000000886'
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
SELECT * FROM [ADMIN_AREA] WHERE ADMIN_AREA_KEY = 'NBNSYS0000000886'

go
SELECT * FROM [ADMIN_TYPE] WHERE ADMIN_TYPE_KEY = 'NBNSYS0000000032'

go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_ADMIN_AREAS WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "GRID_SQUARE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY from  GRID_SQUARE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LAND_PARCEL" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LAND_PARCEL"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY from  LAND_PARCEL WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_BOUNDARY" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_BOUNDARY"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_BOUNDARY WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY_1" from  "LOCATION_RELATION" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_RELATION"
WHERE "LOCATION_KEY_1" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY_1 from  LOCATION_RELATION WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_USE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_USE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_USE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "TENURE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "TENURE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA00015700000025'
go
SET FMTONLY ON select LOCATION_KEY from  TENURE WHERE 1=2  SET FMTONLY OFF
go
SELECT * FROM "Location_Type"
order By SHORT_NAME

go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'usp_LastSurveyEvent_ForLocation_Select', 1, NULL, NULL
go
exec usp_LastSurveyEvent_ForLocation_Select 'WA00015700000025'
go
SELECT L.Location_Key, LN.Item_Name, System_Supplied_Data FROM Location AS L INNER JOIN Location_Name AS LN ON L.Location_Key = LN.Location_Key WHERE L.Parent_Key ='WA0001570000002B' AND   LN.Preferred = 1  ORDER BY LN.Item_Name
go
SELECT F.Location_Feature_Key,                     F.Item_Name,                     FT.Short_Name FROM (Location_Feature AS F LEFT JOIN Location_Feature_Grading AS FG ON        F.Feature_Grading_Key = FG.Feature_Grading_Key) LEFT JOIN Location_Feature_Type AS FT ON        FG.Location_Feature_Type_Key = FT.Location_Feature_Type_Key WHERE F.Location_Key = 'WA0001570000002B'  ORDER BY F.Item_Name, FT.Short_Name
go
SELECT TOP 1 1 FROM [LOCATION] WHERE [LOCATION_Key] = 'WA0001570000003G'
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON select Location_Key from  Location WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "Location_Key" from  "Location" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "Location"
WHERE "Location_Key" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select "Location_Key" from  "Location_Name" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "Location_Name"
WHERE "Location_Key" = @P1
ORDER BY Item_Name
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select Location_Key from  Location_Name WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LD"."Location_Key" from  "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT "S".Short_Name, "LD".* FROM "Location_Designation" AS "LD" INNER JOIN
          "Site_Status" AS "S" ON "LD"."Site_Status_Key" = "S"."Site_Status_Key"
WHERE "LD"."Location_Key" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LD.Location_Key from  Location_Designation AS LD INNER JOIN
          Site_Status AS S ON LD.Site_Status_Key = S.Site_Status_Key WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "DT"."LOCATION_Key" from  (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key") WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT "DT"."LOCATION_DATA_Key" AS "Data_Key", "DT".Custodian, "DT".Data, "DT".Accuracy, "DT".Changed_By, "DT".Changed_Date, "DT".Measurement_Qualifier_Key, "MQ"."Short_Name" AS "Qualifier_Short_Name", "DT".Measurement_Unit_Key, "MU"."Short_Name" AS "Unit_Short_Name", "MT".Measurement_Type_Key, "MT"."Short_Name" AS "Type_Short_Name", "DT".Entered_By FROM (("Measurement_Type" AS "MT"
  INNER JOIN "Measurement_Qualifier" AS "MQ"
  ON "MT"."Measurement_Type_Key" = "MQ"."Measurement_Type_Key")
  INNER JOIN "Measurement_Unit" AS "MU"
  ON "MT"."Measurement_Type_Key" = "MU"."Measurement_Type_Key")
  INNER JOIN "LOCATION_DATA" AS "DT"
  ON ("MU"."Measurement_Unit_Key" = "DT"."Measurement_Unit_Key")
     AND ("MQ"."Measurement_Qualifier_Key" = "DT"."Measurement_Qualifier_Key")
WHERE "DT"."LOCATION_Key"
= @P1
ORDER BY MT.Short_Name, MQ.Short_Name, DT.Data, MU.Short_Name, DT.Accuracy
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select DT.LOCATION_Key from  ((Measurement_Type AS MT
  INNER JOIN Measurement_Qualifier AS MQ
  ON MT.Measurement_Type_Key = MQ.Measurement_Type_Key)
  INNER JOIN Measurement_Unit AS MU
  ON MT.Measurement_Type_Key = MU.Measurement_Type_Key)
  INNER JOIN LOCATION_DATA AS DT
  ON (MU.Measurement_Unit_Key = DT.Measurement_Unit_Key)
     AND (MQ.Measurement_Qualifier_Key = DT.Measurement_Qualifier_Key) WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_ADMIN_AREAS" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_ADMIN_AREAS"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_ADMIN_AREAS WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "GRID_SQUARE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  GRID_SQUARE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LAND_PARCEL" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LAND_PARCEL"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  LAND_PARCEL WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_BOUNDARY" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_BOUNDARY"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_BOUNDARY WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY_1" from  "LOCATION_RELATION" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_RELATION"
WHERE "LOCATION_KEY_1" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY_1 from  LOCATION_RELATION WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "LOCATION_USE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "LOCATION_USE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  LOCATION_USE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "TENURE" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "TENURE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  TENURE WHERE 1=2  SET FMTONLY OFF
go
SELECT * FROM "Location_Type"
order By SHORT_NAME

go
SET NO_BROWSETABLE OFF
go
exec usp_LastSurveyEvent_ForLocation_Select 'WA0001570000003G'
go
SELECT L.Location_Key, LN.Item_Name, System_Supplied_Data FROM Location AS L INNER JOIN Location_Name AS LN ON L.Location_Key = LN.Location_Key WHERE L.Parent_Key ='WA0001570000003G' AND   LN.Preferred = 1  ORDER BY LN.Item_Name
go
SELECT F.Location_Feature_Key,                     F.Item_Name,                     FT.Short_Name FROM (Location_Feature AS F LEFT JOIN Location_Feature_Grading AS FG ON        F.Feature_Grading_Key = FG.Feature_Grading_Key) LEFT JOIN Location_Feature_Type AS FT ON        FG.Location_Feature_Type_Key = FT.Location_Feature_Type_Key WHERE F.Location_Key = 'WA0001570000003G'  ORDER BY F.Item_Name, FT.Short_Name
go
exec [NBNData]..sp_procedure_params_rowset N'usp_Location_Select', 1, NULL, NULL
go
exec usp_Location_Select 'WA0001570000003G'
go
exec usp_Location_Select 'WA0001570000003G'
go
SET NO_BROWSETABLE ON
go
SELECT Name_Key, Forename, Initials, Surname,   CASE WHEN Forename IS NULL THEN     CASE WHEN Initials IS NULL THEN       CASE WHEN Title IS NULL THEN Surname       ELSE Title + ' ' + Surname END     ELSE Initials + ' ' + Surname END   ELSE Forename + ' ' + Surname END AS IndividualName FROM Individual WHERE Forename LIKE 'Je%'   OR Initials LIKE 'Je%'   OR Surname LIKE 'Je%'   OR Title LIKE 'Je%' ORDER BY Forename, Initials, Surname

go
SET NO_BROWSETABLE OFF
go
SELECT Organisation FROM Name WHERE Name_Key='WA0001570000004M'
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON select "NAME_KEY" from  "INDIVIDUAL" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "INDIVIDUAL"
WHERE "NAME_KEY"    =   @P1
', N'@P1 varchar(16)', 'WA0001570000004M'
go
SET FMTONLY ON select NAME_KEY from         INDIVIDUAL WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
SET FMTONLY ON select "Survey_Key" from  "Survey" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "Survey"
WHERE "Survey_Key"=' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "Survey"
WHERE "Survey_Key"=@P1
', N'@P1 varchar(16)', 'WA0001570000000N'
go
SET FMTONLY ON select Survey_Key from  Survey WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec usp_Location_Select 'WA0001570000003G'
go
exec usp_Location_Select 'WA0001570000003G'
go
exec usp_Location_Select 'WA0001570000003G'
go
exec usp_Location_Select 'WA0001570000003G'
go
exec usp_Location_Select 'WA0001570000003G'
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON select "Survey_Key" from  "Survey" WHERE 1=2  SET FMTONLY OFF
go
exec sp_executesql N'SELECT * FROM "Survey"
WHERE "Survey_Key"=@P1
', N'@P1 varchar(16)', 'WA0001570000000N'
go
SET FMTONLY ON select Survey_Key from  Survey WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
SET FMTONLY ON select "LOCATION_KEY" from  "GRID_SQUARE" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = ' '
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT * FROM "GRID_SQUARE"
WHERE "LOCATION_KEY" = @P1
', N'@P1 varchar(16)', 'WA0001570000003G'
go
SET FMTONLY ON select LOCATION_KEY from  GRID_SQUARE WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
SET FMTONLY ON select SE.SURVEY_KEY from  SURVEY_EVENT SE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select SE.SURVEY_KEY from  SURVEY_EVENT SE WHERE 1=2  SET FMTONLY OFF
go
SET FMTONLY ON select "SE"."SURVEY_KEY" from  "SURVEY_EVENT" "SE" WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
SET FMTONLY ON SELECT "SE".SURVEY_EVENT_KEY, "SE".VAGUE_DATE_START, "SE".VAGUE_DATE_END, "SE".VAGUE_DATE_TYPE FROM "SURVEY_EVENT" "SE"
WHERE "SE"."SURVEY_KEY" = ' '
AND "SE"."LOCATION_KEY" = 'WA0001570000003G' AND ("SE"."LOCATION_NAME" = '' OR "SE"."LOCATION_NAME" IS NULL)
ORDER BY SE.LOCATION_NAME DESC
WHERE 1=2  SET FMTONLY OFF
go
set fmtonly off
go
exec sp_executesql N'SELECT "SE".SURVEY_EVENT_KEY, "SE".VAGUE_DATE_START, "SE".VAGUE_DATE_END, "SE".VAGUE_DATE_TYPE FROM "SURVEY_EVENT" "SE"
WHERE "SE"."SURVEY_KEY" = @P1
AND "SE"."LOCATION_KEY" = ''WA0001570000003G'' AND ("SE"."LOCATION_NAME" = '''' OR "SE"."LOCATION_NAME" IS NULL)
ORDER BY SE.LOCATION_NAME DESC
', N'@P1 varchar(16)', 'WA0001570000000N'
go
SET FMTONLY ON select SE.SURVEY_KEY from  SURVEY_EVENT SE WHERE 1=2  SET FMTONLY OFF
go
SET NO_BROWSETABLE OFF
go
exec [NBNData]..sp_procedure_params_rowset N'spNextKey', 1, NULL, NULL
go
declare @P1 varchar(16)
set @P1=NULL
exec spNextKey 'SURVEY_EVENT', @P1 output, default
select @P1
go