| Author |
Topic |
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-09 : 17:29:18
|
| When i run a simple query for six columns from two tables doing a inner join, i get the first column truncted as follows:0xB2D3F86F840CFA42it should be 0xB2D3F86F840CFA428B1061F73B64951Dhere is the query:sqlcmd -S server\instance -U username -P password -d database -s "|" -W -h-1 -Q "SELECT usp_contact.contact_uuid, c_cm_id1, c_cm_id2, c_cm_id3, c_cm_id4, ca_contact.last_name FROM ca_contact INNER JOIN usp_contact ON ca_contact.contact_uuid = usp_contact.contact_uuid WHERE ca_contact.inactive = 0 AND ca_contact.contact_type = '2308' AND (usp_contact.c_cm_id2 <> '30427950' or usp_contact.c_cm_id2 is null ) and usp_contact.contact_uuid not in (0x096A060435922A428B357F4DB03A6B99,0x136FDC787B472C43998F95D66EA434F0,0xF0C6F9375754C347B09AB19E4FB656A7)" |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-10 : 09:22:12
|
| Ok i ran the query with sqlcmd and found that all the output was still truncated. Below is a sample of what was returned. Your assumption is correct with SSMS it runs as expected.0x05E1A23F5556D64F0x05E2D669123C004A0x05E5CDA74005B6490x05E66854CB36ED470x05E6B80055D2A64A0x05E73578136AAA440x05E7C7E62B33124B0x05E7DD88748C2F490x05E884CAFB36DD480x05E8C016957E114A0x05EAC8E8B96B884F0x05EB2C245D1770430x05EB74EB1A000B4A0x05EBE46ECA4282470x05EC3453A1A83C470x05EC66EC87D9794B0x05EDBC59FC8626450x05EE01AD884D97490x05F0E9A8F9FD0B470x05F1A942501C564A0x05F1AAF40B7EA34B0x05F4AE14899340460x05F5593EC1FBCD460x05F5A5706941F3470x05F6D948971B5A420x05F8841DB53329440x05F9E3CD8BBEC6470x05FB93B19663624D0x05FBDEF74A8696470x05FF09C532F98B440x06001FEDA48BE74F0x0605D9E90ECDA64B0x0607F348F0EA5C430x0608A5281254F04A0x0609EE6CEAC33D440x060AD18900C1054F0x060B569CFF3320440x060C69C9FA7EEF490x060CA5B2572ED34B0x060E30673F2AAF410x060E5B1D4BF0E64A0x060F21F5636E42410x060F4E60AC299A4A0x06101D93F9A5DA450x0611A4A0BF00ED410x0614480B6468DE490x06152ACA695D5E400x061576A4842A024C0x061622B86E6BD7410x061744A327DFF64B0x061DAE09AF5A3F480x06223261008E30440x0622D2B15444F6430x0623216A94E27446 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-11 : 11:24:16
|
| binary |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-11 : 14:08:31
|
| ok thanks. I thought it was something i was doing. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-11 : 14:59:20
|
| I did find that if i cast it as binary i get all except the last two chars. I have requested our db team open with microsoft, so we will see what happens. When i find an anwser i will post it here. I have also tried powershell but it also converts the data someway. |
 |
|
|
nbritton
Starting Member
22 Posts |
Posted - 2012-05-11 : 15:58:23
|
| I chagned to osql, used a -w500 to fix a wrapping problem and it worked as needed. Thank you much for your help. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|