[T-SQL] Return text from a PDF stored in the database (Adobe iFilter) |
- Return text from a PDF stored in the database (Adobe iFilter)
- RaiseError in SP
- Using SQLCMD as an alternative to xp_cmdshell
- performing insert statement in a linked server
- Sql Server Authentication
- Intelligently Flatten Ragged Hierachy to Fixed Levels for SSAS
- Finding values with only one occurrence
- finding value in a string
- converting nvarchar to decimal
Return text from a PDF stored in the database (Adobe iFilter) Posted: 18 Sep 2013 01:03 AM PDT We are storing PDF files inside a SQL Server 2008R2 DB. We have installed the Adobe iFilter to create a full-text catalog in order to search these files. Everything was working great, until.... we tried to get the text out of that PDF for display on a website. I am at a loss. We want to be able to return the text of a PDF file as varchar(max) using just straight-up T-SQL. I assume we would need to create a function and *somehow* use the iFilter to pull out the text, but I cannot find any documentation on how to do such a thing. I have searched the WWW for hours and found nothing. Has anyone done this? or.. Does anyone have a link to some documentation that can show me how to do it?Thanks,Murphy |
Posted: 17 Sep 2013 05:27 PM PDT Hi All, For error handling mechanism in SP, we can use the RAISEERROR method in the catch block of the SP to throw the system defined/custom error to the calling method and rollback the transaction. My question is that whether we have to raise the error first and then do the rollback or first rollback the transaction and then raise the error. I think the order is not going to impact anything. Am i correct? Sample Code isBEGIN CATCH DECLARE @ErrorMessage NVARCHAR(4000) DECLARE @ErrorSeverity INT DECLARE @ErrorState INT SELECT @ErrorMessage = ERROR_MESSAGE(), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE() RAISERROR (@ErrorMessage, -- Message text. @ErrorSeverity, -- Severity. @ErrorState -- State. ) ROLLBACK TRAN T1END CATCH |
Using SQLCMD as an alternative to xp_cmdshell Posted: 12 Sep 2011 08:42 AM PDT Hi,I have a development question that i would like to ask the group.I am working on building a stored procedure that would do a simple add linked server operation but with a few security concerns built into it.The stored procedure will be given the name of the linked server and the linked server properties and the user id to use for connecting to the linked server.But the password for the user account is stored in another server which can be retrieved from executing an operating system command from the command prompt.I know that I can use the xp_cmdshell extended stored procedure from within my stored procedure to execute the same command and get the password.But, the catch is, our company standards restrict us from directly using the xp_cmdshell from within the queries.I know that i can use the SQLCMD to execute operating system commands by indicating the " !! " before the command.My question is how do i invoke the SQLCMD from within my stored procedure, execute the operating system command using the sqlcmd, get back the password, store it in a variable and then continue with adding the linked server.Ultimately, this stored procedure will be replacing a legacy script that the application has been using.Suggestion would be much appreciated.Thanks-John |
performing insert statement in a linked server Posted: 17 Sep 2013 07:02 AM PDT Hello guys, i need so much your help!I was doing an insert statement with union all using a linked server.I have two dabases in two different servers. These databases are connected through a linked server.When i try to do an insert statement with union all from a database to another, using linked server, i receive the following message: "Msg 8624, Level 16, State 17, Line 1Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."Someone could help me?!?!I'm sorry for the language, I'm brazilian!! |
Posted: 17 Sep 2013 04:28 PM PDT Please help me, what are the system procedures and system functions that are used for validating whether a user is a valid user or not when we click on "connect" button for sql server 2008. |
Intelligently Flatten Ragged Hierachy to Fixed Levels for SSAS Posted: 17 Sep 2013 05:41 AM PDT We just upgraded our organization from SQL 2000 to SQL 2008/2012 (must say I've been loving the CTE's, Agg functions, and APPLY!). Now I am upgrading the SSAS and I want to give my accounting / analyst group the ability to create/modify their different GL account structures without relying on me. So they have a GUI tool where they can drag and drop their accounts and make their ragged (parent/child) chart of accounts that I want to flow into the OLAP cubes ... but of course according to multiple sources I should not use parent/child hierarchies, but convert them into fixed levels. The accountants like this too ... they want to be able to drill to a specific level.So the GUI tool creates a table (with a little love from me) like this (although there is a TreeID as well that I have left out for simplicity) which matches up with my ERP data:[code="sql"]CREATE TABLE [tmpAcctTree]( [ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [AcctID] [numeric](18, 0) NULL, [iLevel] [numeric](18, 0) NULL, [iOrder] [numeric](18, 0) NULL, [ParentID] [numeric](18, 0) NULL, [IsLeaf] [numeric](18, 0) NULL )[/code]This will add a fairly simple tree (is this too much to paste into a post?):[code="sql"]INSERT INTO [tmpAcctTree] ([AcctID] ,[iLevel] ,[iOrder] ,[ParentID] ,[IsLeaf])SELECT '692699', '0', '1', '0', '0' UNION ALLSELECT '692695', '1', '1', '692699', '0' UNION ALLSELECT '692698', '1', '2', '692699', '0' UNION ALLSELECT '692616', '2', '1', '692695', '0' UNION ALLSELECT '692694', '2', '2', '692695', '0' UNION ALLSELECT '692697', '2', '1', '692698', '0' UNION ALLSELECT '692598', '3', '1', '692616', '0' UNION ALLSELECT '692606', '3', '2', '692616', '0' UNION ALLSELECT '692615', '3', '3', '692616', '0' UNION ALLSELECT '692651', '3', '1', '692694', '0' UNION ALLSELECT '692655', '3', '2', '692694', '0' UNION ALLSELECT '692660', '3', '3', '692694', '0' UNION ALLSELECT '692665', '3', '4', '692694', '0' UNION ALLSELECT '692669', '3', '5', '692694', '0' UNION ALLSELECT '692675', '3', '6', '692694', '0' UNION ALLSELECT '692683', '3', '7', '692694', '0' UNION ALLSELECT '692690', '3', '8', '692694', '0' UNION ALLSELECT '692693', '3', '9', '692694', '0' UNION ALLSELECT '692596', '4', '1', '692598', '0' UNION ALLSELECT '692597', '4', '2', '692598', '0' UNION ALLSELECT '692600', '4', '1', '692606', '0' UNION ALLSELECT '692601', '4', '2', '692606', '0' UNION ALLSELECT '692602', '4', '3', '692606', '0' UNION ALLSELECT '692603', '4', '4', '692606', '0' UNION ALLSELECT '692604', '4', '5', '692606', '0' UNION ALLSELECT '692605', '4', '6', '692606', '0' UNION ALLSELECT '692612', '4', '1', '692615', '0' UNION ALLSELECT '692613', '4', '2', '692615', '0' UNION ALLSELECT '692614', '4', '3', '692615', '0' UNION ALLSELECT '692619', '4', '1', '692651', '0' UNION ALLSELECT '692620', '4', '2', '692651', '0' UNION ALLSELECT '692623', '4', '3', '692651', '0' UNION ALLSELECT '692624', '4', '4', '692651', '0' UNION ALLSELECT '692631', '4', '5', '692651', '0' UNION ALLSELECT '692632', '4', '6', '692651', '0' UNION ALLSELECT '692633', '4', '7', '692651', '0' UNION ALLSELECT '692634', '4', '8', '692651', '0' UNION ALLSELECT '692635', '4', '9', '692651', '0' UNION ALLSELECT '692645', '4', '10', '692651', '0' UNION ALLSELECT '692646', '4', '11', '692651', '0' UNION ALLSELECT '692647', '4', '12', '692651', '0' UNION ALLSELECT '692648', '4', '13', '692651', '0' UNION ALLSELECT '692649', '4', '14', '692651', '0' UNION ALLSELECT '692650', '4', '15', '692651', '0' UNION ALLSELECT '692653', '4', '1', '692655', '0' UNION ALLSELECT '692654', '4', '2', '692655', '0' UNION ALLSELECT '692657', '4', '1', '692660', '0' UNION ALLSELECT '692658', '4', '2', '692660', '0' UNION ALLSELECT '692659', '4', '3', '692660', '0' UNION ALLSELECT '692662', '4', '1', '692665', '0' UNION ALLSELECT '692663', '4', '2', '692665', '0' UNION ALLSELECT '692664', '4', '3', '692665', '0' UNION ALLSELECT '692667', '4', '1', '692669', '0' UNION ALLSELECT '692668', '4', '2', '692669', '0' UNION ALLSELECT '692671', '4', '1', '692675', '0' UNION ALLSELECT '692672', '4', '2', '692675', '0' UNION ALLSELECT '692673', '4', '3', '692675', '0' UNION ALLSELECT '692674', '4', '4', '692675', '0' UNION ALLSELECT '692677', '4', '1', '692683', '0' UNION ALLSELECT '692678', '4', '2', '692683', '0' UNION ALLSELECT '692679', '4', '3', '692683', '0' UNION ALLSELECT '692680', '4', '4', '692683', '0' UNION ALLSELECT '692681', '4', '5', '692683', '0' UNION ALLSELECT '692682', '4', '6', '692683', '0' UNION ALLSELECT '692685', '4', '1', '692690', '0' UNION ALLSELECT '692686', '4', '2', '692690', '0' UNION ALLSELECT '692687', '4', '3', '692690', '0' UNION ALLSELECT '692688', '4', '4', '692690', '0' UNION ALLSELECT '692689', '4', '5', '692690', '0' UNION ALLSELECT '692692', '4', '1', '692693', '0' UNION ALLSELECT '692609', '5', '1', '692612', '0' UNION ALLSELECT '692610', '5', '2', '692612', '0' UNION ALLSELECT '692611', '5', '3', '692612', '0' UNION ALLSELECT '692622', '5', '1', '692623', '0' UNION ALLSELECT '692626', '5', '1', '692631', '0' UNION ALLSELECT '692627', '5', '2', '692631', '0' UNION ALLSELECT '692628', '5', '3', '692631', '0' UNION ALLSELECT '692629', '5', '4', '692631', '0' UNION ALLSELECT '692630', '5', '5', '692631', '0' UNION ALLSELECT '692637', '5', '1', '692645', '0' UNION ALLSELECT '692638', '5', '2', '692645', '0' UNION ALLSELECT '692639', '5', '3', '692645', '0' UNION ALLSELECT '692640', '5', '4', '692645', '0' UNION ALLSELECT '692641', '5', '5', '692645', '0' UNION ALLSELECT '692642', '5', '6', '692645', '0' UNION ALLSELECT '692643', '5', '7', '692645', '0' UNION ALLSELECT '692644', '5', '8', '692645', '0' UNION ALLSELECT '1110', '5', '1', '692596', '-1' UNION ALLSELECT '1111', '5', '2', '692596', '-1' UNION ALLSELECT '1112', '5', '3', '692596', '-1' UNION ALLSELECT '1113', '5', '4', '692596', '-1' UNION ALLSELECT '1114', '5', '5', '692596', '-1' UNION ALLSELECT '1115', '5', '6', '692596', '-1' UNION ALLSELECT '1119', '5', '7', '692596', '-1' UNION ALLSELECT '1121', '5', '8', '692596', '-1' UNION ALLSELECT '1630', '5', '9', '692596', '-1' UNION ALLSELECT '1847', '5', '10', '692596', '-1' UNION ALLSELECT '1903', '5', '11', '692596', '-1' UNION ALLSELECT '2004', '5', '12', '692596', '-1' UNION ALLSELECT '2161', '5', '13', '692596', '-1' UNION ALLSELECT '2181', '5', '14', '692596', '-1' UNION ALLSELECT '2197', '5', '15', '692596', '-1' UNION ALLSELECT '1116', '5', '1', '692597', '-1' UNION ALLSELECT '1652', '5', '2', '692597', '-1' UNION ALLSELECT '1713', '5', '3', '692597', '-1' UNION ALLSELECT '1777', '5', '4', '692597', '-1' UNION ALLSELECT '1778', '5', '5', '692597', '-1' UNION ALLSELECT '1779', '5', '6', '692597', '-1' UNION ALLSELECT '1852', '5', '7', '692597', '-1' UNION ALLSELECT '2059', '5', '8', '692597', '-1' UNION ALLSELECT '2060', '5', '9', '692597', '-1' UNION ALLSELECT '2071', '5', '10', '692597', '-1' UNION ALLSELECT '2077', '5', '11', '692597', '-1' UNION ALLSELECT '1130', '5', '1', '692600', '-1' UNION ALLSELECT '1131', '5', '2', '692600', '-1' UNION ALLSELECT '2234', '5', '3', '692600', '-1' UNION ALLSELECT '1132', '5', '1', '692601', '-1' UNION ALLSELECT '1996', '5', '1', '692602', '-1' UNION ALLSELECT '2092', '5', '2', '692602', '-1' UNION ALLSELECT '2099', '5', '3', '692602', '-1' UNION ALLSELECT '2126', '5', '4', '692602', '-1' UNION ALLSELECT '1134', '5', '1', '692603', '-1' UNION ALLSELECT '1140', '5', '2', '692603', '-1' UNION ALLSELECT '1611', '5', '1', '692604', '-1' UNION ALLSELECT '1878', '5', '2', '692604', '-1' UNION ALLSELECT '1986', '5', '3', '692604', '-1' UNION ALLSELECT '1989', '5', '4', '692604', '-1' UNION ALLSELECT '1990', '5', '5', '692604', '-1' UNION ALLSELECT '2222', '5', '6', '692604', '-1' UNION ALLSELECT '1129', '5', '1', '692605', '-1' UNION ALLSELECT '1137', '5', '2', '692605', '-1' UNION ALLSELECT '1143', '5', '3', '692605', '-1' UNION ALLSELECT '2199', '5', '4', '692605', '-1' UNION ALLSELECT '2200', '5', '5', '692605', '-1' UNION ALLSELECT '2201', '5', '6', '692605', '-1' UNION ALLSELECT '2205', '5', '7', '692605', '-1' UNION ALLSELECT '2206', '5', '8', '692605', '-1' UNION ALLSELECT '2224', '5', '9', '692605', '-1' UNION ALLSELECT '2225', '5', '10', '692605', '-1' UNION ALLSELECT '1158', '6', '1', '692609', '-1' UNION ALLSELECT '1159', '6', '2', '692609', '-1' UNION ALLSELECT '1160', '6', '3', '692609', '-1' UNION ALLSELECT '1161', '6', '4', '692609', '-1' UNION ALLSELECT '1162', '6', '5', '692609', '-1' UNION ALLSELECT '1165', '6', '6', '692609', '-1' UNION ALLSELECT '1166', '6', '7', '692609', '-1' UNION ALLSELECT '1167', '6', '8', '692609', '-1' UNION ALLSELECT '1170', '6', '9', '692609', '-1' UNION ALLSELECT '1774', '6', '10', '692609', '-1' UNION ALLSELECT '1853', '6', '11', '692609', '-1' UNION ALLSELECT '1899', '6', '12', '692609', '-1' UNION ALLSELECT '1931', '6', '13', '692609', '-1' UNION ALLSELECT '2015', '6', '14', '692609', '-1' UNION ALLSELECT '2016', '6', '15', '692609', '-1' UNION ALLSELECT '2024', '6', '16', '692609', '-1' UNION ALLSELECT '2064', '6', '17', '692609', '-1' UNION ALLSELECT '2065', '6', '18', '692609', '-1' UNION ALLSELECT '2066', '6', '19', '692609', '-1' UNION ALLSELECT '2067', '6', '20', '692609', '-1' UNION ALLSELECT '2089', '6', '21', '692609', '-1' UNION ALLSELECT '2195', '6', '22', '692609', '-1' UNION ALLSELECT '2196', '6', '23', '692609', '-1' UNION ALLSELECT '2228', '6', '24', '692609', '-1' UNION ALLSELECT '1163', '6', '1', '692610', '-1' UNION ALLSELECT '1164', '6', '2', '692610', '-1' UNION ALLSELECT '1169', '6', '3', '692610', '-1' UNION ALLSELECT '1171', '6', '4', '692610', '-1' UNION ALLSELECT '1176', '6', '5', '692610', '-1' UNION ALLSELECT '1568', '6', '6', '692610', '-1' UNION ALLSELECT '1591', '6', '7', '692610', '-1' UNION ALLSELECT '2093', '6', '8', '692610', '-1' UNION ALLSELECT '2094', '6', '9', '692610', '-1' UNION ALLSELECT '2095', '6', '10', '692610', '-1' UNION ALLSELECT '2096', '6', '11', '692610', '-1' UNION ALLSELECT '2097', '6', '12', '692610', '-1' UNION ALLSELECT '2098', '6', '13', '692610', '-1' UNION ALLSELECT '2155', '6', '14', '692610', '-1' UNION ALLSELECT '2163', '6', '15', '692610', '-1' UNION ALLSELECT '2170', '6', '16', '692610', '-1' UNION ALLSELECT '2232', '6', '17', '692610', '-1' UNION ALLSELECT '1157', '6', '1', '692611', '-1' UNION ALLSELECT '1922', '6', '2', '692611', '-1' UNION ALLSELECT '2176', '5', '1', '692613', '-1' UNION ALLSELECT '2177', '5', '2', '692613', '-1' UNION ALLSELECT '2182', '5', '3', '692613', '-1' UNION ALLSELECT '2183', '5', '4', '692613', '-1' UNION ALLSELECT '2187', '5', '5', '692613', '-1' UNION ALLSELECT '2188', '5', '6', '692613', '-1' UNION ALLSELECT '2190', '5', '7', '692613', '-1' UNION ALLSELECT '2138', '5', '1', '692614', '-1' UNION ALLSELECT '2141', '5', '2', '692614', '-1' UNION ALLSELECT '2239', '5', '3', '692614', '-1' UNION ALLSELECT '2090', '5', '1', '692619', '-1' UNION ALLSELECT '2204', '5', '2', '692619', '-1' UNION ALLSELECT '1366', '5', '1', '692620', '-1' UNION ALLSELECT '1461', '5', '2', '692620', '-1' UNION ALLSELECT '1462', '5', '3', '692620', '-1' UNION ALLSELECT '1463', '5', '4', '692620', '-1' UNION ALLSELECT '1466', '5', '5', '692620', '-1' UNION ALLSELECT '1467', '5', '6', '692620', '-1' UNION ALLSELECT '1468', '5', '7', '692620', '-1' UNION ALLSELECT '1469', '5', '8', '692620', '-1' UNION ALLSELECT '1470', '5', '9', '692620', '-1' UNION ALLSELECT '1471', '5', '10', '692620', '-1' UNION ALLSELECT '1472', '5', '11', '692620', '-1' UNION ALLSELECT '1609', '5', '12', '692620', '-1' UNION ALLSELECT '1680', '5', '13', '692620', '-1' UNION ALLSELECT '2006', '5', '14', '692620', '-1' UNION ALLSELECT '2198', '5', '15', '692620', '-1' UNION ALLSELECT '2229', '5', '16', '692620', '-1' UNION ALLSELECT '2235', '5', '17', '692620', '-1' UNION ALLSELECT '1180', '5', '1', '692624', '-1' UNION ALLSELECT '1186', '5', '2', '692624', '-1' UNION ALLSELECT '1288', '5', '3', '692624', '-1' UNION ALLSELECT '1557', '5', '4', '692624', '-1' UNION ALLSELECT '1562', '5', '5', '692624', '-1' UNION ALLSELECT '1674', '5', '6', '692624', '-1' UNION ALLSELECT '1708', '5', '7', '692624', '-1' UNION ALLSELECT '1952', '5', '8', '692624', '-1' UNION ALLSELECT '1953', '5', '9', '692624', '-1' UNION ALLSELECT '1954', '5', '10', '692624', '-1' UNION ALLSELECT '1963', '5', '11', '692624', '-1' UNION ALLSELECT '1978', '5', '12', '692624', '-1' UNION ALLSELECT '1979', '5', '13', '692624', '-1' UNION ALLSELECT '1980', '5', '14', '692624', '-1' UNION ALLSELECT '1981', '5', '15', '692624', '-1' UNION ALLSELECT '1982', '5', '16', '692624', '-1' UNION ALLSELECT '1983', '5', '17', '692624', '-1' UNION ALLSELECT '2043', '5', '18', '692624', '-1' UNION ALLSELECT '2044', '5', '19', '692624', '-1' UNION ALLSELECT '2149', '5', '20', '692624', '-1' UNION ALLSELECT '2166', '5', '21', '692624', '-1' UNION ALLSELECT '2244', '5', '22', '692624', '-1' UNION ALLSELECT '1296', '6', '1', '692626', '-1' UNION ALLSELECT '1297', '6', '2', '692626', '-1' UNION ALLSELECT '1298', '6', '3', '692626', '-1' UNION ALLSELECT '1299', '6', '4', '692626', '-1' UNION ALLSELECT '1300', '6', '5', '692626', '-1' UNION ALLSELECT '1301', '6', '6', '692626', '-1' UNION ALLSELECT '1308', '6', '7', '692626', '-1' UNION ALLSELECT '1309', '6', '8', '692626', '-1' UNION ALLSELECT '1310', '6', '9', '692626', '-1' UNION ALLSELECT '1311', '6', '10', '692626', '-1' UNION ALLSELECT '1312', '6', '11', '692626', '-1' UNION ALLSELECT '1313', '6', '12', '692626', '-1' UNION ALLSELECT '1314', '6', '13', '692626', '-1' UNION ALLSELECT '1315', '6', '14', '692626', '-1' UNION ALLSELECT '1318', '6', '15', '692626', '-1' UNION ALLSELECT '1319', '6', '16', '692626', '-1' UNION ALLSELECT '1320', '6', '17', '692626', '-1' UNION ALLSELECT '1322', '6', '18', '692626', '-1' UNION ALLSELECT '1323', '6', '19', '692626', '-1' UNION ALLSELECT '1324', '6', '20', '692626', '-1' UNION ALLSELECT '1325', '6', '21', '692626', '-1' UNION ALLSELECT '1327', '6', '22', '692626', '-1' UNION ALLSELECT '1328', '6', '23', '692626', '-1' UNION ALLSELECT '1329', '6', '24', '692626', '-1' UNION ALLSELECT '1330', '6', '25', '692626', '-1' UNION ALLSELECT '1331', '6', '26', '692626', '-1' UNION ALLSELECT '1332', '6', '27', '692626', '-1' UNION ALLSELECT '1333', '6', '28', '692626', '-1' UNION ALLSELECT '1334', '6', '29', '692626', '-1' UNION ALLSELECT '1335', '6', '30', '692626', '-1' UNION ALLSELECT '1336', '6', '31', '692626', '-1' UNION ALLSELECT '1337', '6', '32', '692626', '-1' UNION ALLSELECT '1338', '6', '33', '692626', '-1' UNION ALLSELECT '1571', '6', '34', '692626', '-1' UNION ALLSELECT '1601', '6', '35', '692626', '-1' UNION ALLSELECT '1602', '6', '36', '692626', '-1' UNION ALLSELECT '1632', '6', '37', '692626', '-1' UNION ALLSELECT '1650', '6', '38', '692626', '-1' UNION ALLSELECT '1662', '6', '39', '692626', '-1' UNION ALLSELECT '1667', '6', '40', '692626', '-1' UNION ALLSELECT '1669', '6', '41', '692626', '-1' UNION ALLSELECT '1697', '6', '42', '692626', '-1' UNION ALLSELECT '1781', '6', '43', '692626', '-1' UNION ALLSELECT '1782', '6', '44', '692626', '-1' UNION ALLSELECT '1783', '6', '45', '692626', '-1' UNION ALLSELECT '1858', '6', '46', '692626', '-1' UNION ALLSELECT '1879', '6', '47', '692626', '-1' UNION ALLSELECT '1958', '6', '48', '692626', '-1' UNION ALLSELECT '2003', '6', '49', '692626', '-1' UNION ALLSELECT '2014', '6', '50', '692626', '-1' UNION ALLSELECT '2160', '6', '51', '692626', '-1' UNION ALLSELECT '2171', '6', '52', '692626', '-1' UNION ALLSELECT '2173', '6', '53', '692626', '-1' UNION ALLSELECT '2208', '6', '54', '692626', '-1' UNION ALLSELECT '2246', '6', '55', '692626', '-1' UNION ALLSELECT '1294', '6', '1', '692627', '-1' UNION ALLSELECT '1295', '6', '2', '692627', '-1' UNION ALLSELECT '1316', '6', '1', '692628', '-1' UNION ALLSELECT '1317', '6', '2', '692628', '-1' UNION ALLSELECT '1326', '6', '3', '692628', '-1' UNION ALLSELECT '1862', '6', '4', '692628', '-1' UNION ALLSELECT '1863', '6', '5', '692628', '-1' UNION ALLSELECT '1864', '6', '6', '692628', '-1' UNION ALLSELECT '1865', '6', '7', '692628', '-1' UNION ALLSELECT '1866', '6', '8', '692628', '-1' UNION ALLSELECT '1867', '6', '9', '692628', '-1' UNION ALLSELECT '1868', '6', '10', '692628', '-1' UNION ALLSELECT '1869', '6', '11', '692628', '-1' UNION ALLSELECT '1302', '6', '1', '692629', '-1' UNION ALLSELECT '1780', '6', '2', '692629', '-1' UNION ALLSELECT '1789', '6', '3', '692629', '-1' UNION ALLSELECT '1801', '6', '1', '692630', '-1' UNION ALLSELECT '1803', '6', '2', '692630', '-1' UNION ALLSELECT '1804', '6', '3', '692630', '-1' UNION ALLSELECT '1805', '6', '4', '692630', '-1' UNION ALLSELECT '1806', '6', '5', '692630', '-1' UNION ALLSELECT '1807', '6', '6', '692630', '-1' UNION ALLSELECT '1808', '6', '7', '692630', '-1' UNION ALLSELECT '1321', '5', '1', '692632', '-1' UNION ALLSELECT '1202', '5', '1', '692633', '-1' UNION ALLSELECT '1208', '5', '2', '692633', '-1' UNION ALLSELECT '1558', '5', '3', '692633', '-1' UNION ALLSELECT '1563', '5', '4', '692633', '-1' UNION ALLSELECT '1670', '5', '5', '692633', '-1' UNION ALLSELECT '1709', '5', '6', '692633', '-1' UNION ALLSELECT '2045', '5', '7', '692633', '-1' UNION ALLSELECT '2046', '5', '8', '692633', '-1' UNION ALLSELECT '2243', '5', '9', '692633', '-1' UNION ALLSELECT '1572', '5', '1', '692634', '-1' UNION ALLSELECT '1573', '5', '2', '692634', '-1' UNION ALLSELECT '1574', '5', '3', '692634', '-1' UNION ALLSELECT '1575', '5', '4', '692634', '-1' UNION ALLSELECT '1576', '5', '5', '692634', '-1' UNION ALLSELECT '1577', '5', '6', '692634', '-1' UNION ALLSELECT '1578', '5', '7', '692634', '-1' UNION ALLSELECT '1725', '5', '8', '692634', '-1' UNION ALLSELECT '1973', '5', '9', '692634', '-1' UNION ALLSELECT '1994', '5', '10', '692634', '-1' UNION ALLSELECT '1224', '5', '1', '692635', '-1' UNION ALLSELECT '1230', '5', '2', '692635', '-1' UNION ALLSELECT '1246', '5', '3', '692635', '-1' UNION ALLSELECT '1252', '5', '4', '692635', '-1' UNION ALLSELECT '1268', '5', '5', '692635', '-1' UNION ALLSELECT '1274', '5', '6', '692635', '-1' UNION ALLSELECT '1559', '5', '7', '692635', '-1' UNION ALLSELECT '1560', '5', '8', '692635', '-1' UNION ALLSELECT '1561', '5', '9', '692635', '-1' UNION ALLSELECT '1564', '5', '10', '692635', '-1' UNION ALLSELECT '1565', '5', '11', '692635', '-1' UNION ALLSELECT '1566', '5', '12', '692635', '-1' UNION ALLSELECT '1671', '5', '13', '692635', '-1' UNION ALLSELECT '1672', '5', '14', '692635', '-1' UNION ALLSELECT '1673', '5', '15', '692635', '-1' UNION ALLSELECT '1710', '5', '16', '692635', '-1' UNION ALLSELECT '1711', '5', '17', '692635', '-1' UNION ALLSELECT '1712', '5', '18', '692635', '-1' UNION ALLSELECT '2047', '5', '19', '692635', '-1' UNION ALLSELECT '2048', '5', '20', '692635', '-1' UNION ALLSELECT '2049', '5', '21', '692635', '-1' UNION ALLSELECT '2242', '5', '22', '692635', '-1' UNION ALLSELECT '2245', '5', '23', '692635', '-1' UNION ALLSELECT '1410', '6', '1', '692637', '-1' UNION ALLSELECT '1412', '6', '2', '692637', '-1' UNION ALLSELECT '1504', '6', '3', '692637', '-1' UNION ALLSELECT '1506', '6', '4', '692637', '-1' UNION ALLSELECT '1507', '6', '5', '692637', '-1' UNION ALLSELECT '1508', '6', '6', '692637', '-1' UNION ALLSELECT '1509', '6', '7', '692637', '-1' UNION ALLSELECT '1880', '6', '8', '692637', '-1' UNION ALLSELECT '1881', '6', '9', '692637', '-1' UNION ALLSELECT '1882', '6', '10', '692637', '-1' UNION ALLSELECT '1883', '6', '11', '692637', '-1' UNION ALLSELECT '1884', '6', '12', '692637', '-1' UNION ALLSELECT '1885', '6', '13', '692637', '-1' UNION ALLSELECT '1886', '6', '14', '692637', '-1' UNION ALLSELECT '1887', '6', '15', '692637', '-1' UNION ALLSELECT '1888', '6', '16', '692637', '-1' UNION ALLSELECT '1889', '6', '17', '692637', '-1' UNION ALLSELECT '1890', '6', '18', '692637', '-1' UNION ALLSELECT '1891', '6', '19', '692637', '-1' UNION ALLSELECT '1892', '6', '20', '692637', '-1' UNION ALLSELECT '1893', '6', '21', '692637', '-1' UNION ALLSELECT '1934', '6', '22', '692637', '-1' UNION ALLSELECT '1809', '6', '1', '692638', '-1' UNION ALLSELECT '1810', '6', '2', '692638', '-1' UNION ALLSELECT '1811', '6', '3', '692638', '-1' UNION ALLSELECT '1812', '6', '4', '692638', '-1' UNION ALLSELECT '1813', '6', '5', '692638', '-1' UNION ALLSELECT '1814', '6', '6', '692638', '-1' UNION ALLSELECT '1815', '6', '7', '692638', '-1' UNION ALLSELECT '1816', '6', '8', '692638', '-1' UNION ALLSELECT '1738', '6', '1', '692639', '-1' UNION ALLSELECT '1739', '6', '2', '692639', '-1' UNION ALLSELECT '1740', '6', '3', '692639', '-1' UNION ALLSELECT '1741', '6', '4', '692639', '-1' UNION ALLSELECT '1742', '6', '5', '692639', '-1' UNION ALLSELECT '1743', '6', '6', '692639', '-1' UNION ALLSELECT '1744', '6', '7', '692639', '-1' UNION ALLSELECT '1745', '6', '8', '692639', '-1' UNION ALLSELECT '1746', '6', '9', '692639', '-1' UNION ALLSELECT '1747', '6', '10', '692639', '-1' UNION ALLSELECT '1748', '6', '11', '692639', '-1' UNION ALLSELECT '2018', '6', '12', '692639', '-1' UNION ALLSELECT '2019', '6', '13', '692639', '-1' UNION ALLSELECT '1387', '6', '1', '692640', '-1' UNION ALLSELECT '1388', '6', '2', '692640', '-1' UNION ALLSELECT '1389', '6', '3', '692640', '-1' UNION ALLSELECT '1390', '6', '4', '692640', '-1' UNION ALLSELECT '1391', '6', '5', '692640', '-1' UNION ALLSELECT '1392', '6', '6', '692640', '-1' UNION ALLSELECT '1393', '6', '7', '692640', '-1' UNION ALLSELECT '1394', '6', '8', '692640', '-1' UNION ALLSELECT '1395', '6', '9', '692640', '-1' UNION ALLSELECT '1396', '6', '10', '692640', '-1' UNION ALLSELECT '1397', '6', '11', '692640', '-1' UNION ALLSELECT '1398', '6', '12', '692640', '-1' UNION ALLSELECT '1399', '6', '13', '692640', '-1' UNION ALLSELECT '1400', '6', '14', '692640', '-1' UNION ALLSELECT '1401', '6', '15', '692640', '-1' UNION ALLSELECT '1402', '6', '16', '692640', '-1' UNION ALLSELECT '1403', '6', '17', '692640', '-1' UNION ALLSELECT '1404', '6', '18', '692640', '-1' UNION ALLSELECT '1405', '6', '19', '692640', '-1' UNION ALLSELECT '1406', '6', '20', '692640', '-1' UNION ALLSELECT '1407', '6', '21', '692640', '-1' UNION ALLSELECT '1408', '6', '22', '692640', '-1' UNION ALLSELECT '1409', '6', '23', '692640', '-1' UNION ALLSELECT '1592', '6', '24', '692640', '-1' UNION ALLSELECT '1593', '6', '25', '692640', '-1' UNION ALLSELECT '1595', '6', '26', '692640', '-1' UNION ALLSELECT '1596', '6', '27', '692640', '-1' UNION ALLSELECT '1598', '6', '28', '692640', '-1' UNION ALLSELECT '1607', '6', '29', '692640', '-1' UNION ALLSELECT '1755', '6', '30', '692640', '-1' UNION ALLSELECT '1756', '6', '31', '692640', '-1' UNION ALLSELECT '1757', '6', '32', '692640', '-1' UNION ALLSELECT '1790', '6', '33', '692640', '-1' UNION ALLSELECT '1791', '6', '34', '692640', '-1' UNION ALLSELECT '1792', '6', '35', '692640', '-1' UNION ALLSELECT '1861', '6', '36', '692640', '-1' UNION ALLSELECT '1444', '6', '1', '692641', '-1' UNION ALLSELECT '1445', '6', '2', '692641', '-1' UNION ALLSELECT '1446', '6', '3', '692641', '-1' UNION ALLSELECT '1448', '6', '4', '692641', '-1' UNION ALLSELECT '1449', '6', '5', '692641', '-1' UNION ALLSELECT '1371', '6', '1', '692642', '-1' UNION ALLSELECT '1372', '6', '2', '692642', '-1' UNION ALLSELECT '1373', '6', '3', '692642', '-1' UNION ALLSELECT '1374', '6', '4', '692642', '-1' UNION ALLSELECT '1375', '6', '5', '692642', '-1' UNION ALLSELECT '1376', '6', '6', '692642', '-1' UNION ALLSELECT '1377', '6', '7', '692642', '-1' UNION ALLSELECT '1378', '6', '8', '692642', '-1' UNION ALLSELECT '1379', '6', '9', '692642', '-1' UNION ALLSELECT '1380', '6', '10', '692642', '-1' UNION ALLSELECT '1381', '6', '11', '692642', '-1' UNION ALLSELECT '1382', '6', '12', '692642', '-1' UNION ALLSELECT '1383', '6', '13', '692642', '-1' UNION ALLSELECT '1384', '6', '14', '692642', '-1' UNION ALLSELECT '1385', '6', '15', '692642', '-1' UNION ALLSELECT '1629', '6', '16', '692642', '-1' UNION ALLSELECT '1651', '6', '17', '692642', '-1' UNION ALLSELECT '1751', '6', '18', '692642', '-1' UNION ALLSELECT '1752', '6', '19', '692642', '-1' UNION ALLSELECT '1854', '6', '20', '692642', '-1' UNION ALLSELECT '1857', '6', '21', '692642', '-1' UNION ALLSELECT '1965', '6', '22', '692642', '-1' UNION ALLSELECT '1970', '6', '23', '692642', '-1' UNION ALLSELECT '1415', '6', '1', '692643', '-1' UNION ALLSELECT '1416', '6', '2', '692643', '-1' UNION ALLSELECT '1417', '6', '3', '692643', '-1' UNION ALLSELECT '1451', '6', '1', '692644', '-1' UNION ALLSELECT '1452', '6', '2', '692644', '-1' UNION ALLSELECT '1453', '6', '3', '692644', '-1' UNION ALLSELECT '1454', '6', '4', '692644', '-1' UNION ALLSELECT '1455', '6', '5', '692644', '-1' UNION ALLSELECT '1456', '6', '6', '692644', '-1' UNION ALLSELECT '1457', '6', '7', '692644', '-1' UNION ALLSELECT '1458', '6', '8', '692644', '-1' UNION ALLSELECT '1715', '6', '9', '692644', '-1' UNION ALLSELECT '1758', '6', '10', '692644', '-1' UNION ALLSELECT '1759', '6', '11', '692644', '-1' UNION ALLSELECT '1760', '6', '12', '692644', '-1' UNION ALLSELECT '1761', '6', '13', '692644', '-1' UNION ALLSELECT '1762', '6', '14', '692644', '-1' UNION ALLSELECT '1763', '6', '15', '692644', '-1' UNION ALLSELECT '1764', '6', '16', '692644', '-1' UNION ALLSELECT '1765', '6', '17', '692644', '-1' UNION ALLSELECT '1766', '6', '18', '692644', '-1' UNION ALLSELECT '1768', '6', '19', '692644', '-1' UNION ALLSELECT '1769', '6', '20', '692644', '-1' UNION ALLSELECT '1770', '6', '21', '692644', '-1' UNION ALLSELECT '1771', '6', '22', '692644', '-1' UNION ALLSELECT '1772', '6', '23', '692644', '-1' UNION ALLSELECT '1773', '6', '24', '692644', '-1' UNION ALLSELECT '1793', '6', '25', '692644', '-1' UNION ALLSELECT '1794', '6', '26', '692644', '-1' UNION ALLSELECT '1358', '5', '1', '692646', '-1' UNION ALLSELECT '1359', '5', '2', '692646', '-1' UNION ALLSELECT '1360', '5', '3', '692646', '-1' UNION ALLSELECT '1361', '5', '4', '692646', '-1' UNION ALLSELECT '1363', '5', '5', '692646', '-1' UNION ALLSELECT '1364', '5', '6', '692646', '-1' UNION ALLSELECT '1365', '5', '7', '692646', '-1' UNION ALLSELECT '1367', '5', '8', '692646', '-1' UNION ALLSELECT '1368', '5', '9', '692646', '-1' UNION ALLSELECT '1538', '5', '10', '692646', '-1' UNION ALLSELECT '2017', '5', '11', '692646', '-1' UNION ALLSELECT '2133', '5', '1', '692647', '-1' UNION ALLSELECT '2134', '5', '2', '692647', '-1' UNION ALLSELECT '2135', '5', '3', '692647', '-1' UNION ALLSELECT '2142', '5', '4', '692647', '-1' UNION ALLSELECT '2143', '5', '5', '692647', '-1' UNION ALLSELECT '2144', '5', '6', '692647', '-1' UNION ALLSELECT '2147', '5', '7', '692647', '-1' UNION ALLSELECT '2148', '5', '8', '692647', '-1' UNION ALLSELECT '2236', '5', '9', '692647', '-1' UNION ALLSELECT '2240', '5', '10', '692647', '-1' UNION ALLSELECT '1441', '5', '1', '692648', '-1' UNION ALLSELECT '1938', '5', '2', '692648', '-1' UNION ALLSELECT '1939', '5', '3', '692648', '-1' UNION ALLSELECT '1940', '5', '4', '692648', '-1' UNION ALLSELECT '1941', '5', '5', '692648', '-1' UNION ALLSELECT '1942', '5', '6', '692648', '-1' UNION ALLSELECT '1943', '5', '7', '692648', '-1' UNION ALLSELECT '1420', '5', '1', '692649', '-1' UNION ALLSELECT '1421', '5', '2', '692649', '-1' UNION ALLSELECT '1422', '5', '3', '692649', '-1' UNION ALLSELECT '1423', '5', '4', '692649', '-1' UNION ALLSELECT '1424', '5', '5', '692649', '-1' UNION ALLSELECT '1426', '5', '6', '692649', '-1' UNION ALLSELECT '1428', '5', '7', '692649', '-1' UNION ALLSELECT '1429', '5', '8', '692649', '-1' UNION ALLSELECT '1432', '5', '9', '692649', '-1' UNION ALLSELECT '1433', '5', '10', '692649', '-1' UNION ALLSELECT '1435', '5', '11', '692649', '-1' UNION ALLSELECT '1442', '5', '12', '692649', '-1' UNION ALLSELECT '1529', '5', '13', '692649', '-1' UNION ALLSELECT '1530', '5', '14', '692649', '-1' UNION ALLSELECT '1531', '5', '15', '692649', '-1' UNION ALLSELECT '1604', '5', '16', '692649', '-1' UNION ALLSELECT '1610', '5', '17', '692649', '-1' UNION ALLSELECT '1612', '5', '18', '692649', '-1' UNION ALLSELECT '1679', '5', '19', '692649', '-1' UNION ALLSELECT '1838', '5', '20', '692649', '-1' UNION ALLSELECT '1964', '5', '21', '692649', '-1' UNION ALLSELECT '1968', '5', '22', '692649', '-1' UNION ALLSELECT '2080', '5', '23', '692649', '-1' UNION ALLSELECT '1956', '5', '1', '692650', '-1' UNION ALLSELECT '1139', '5', '16', '692653', '-1' UNION ALLSELECT '2193', '5', '92', '692653', '-1' UNION ALLSELECT '2241', '5', '346', '692654', '-1' UNION ALLSELECT '2233', '5', '1', '692657', '-1' UNION ALLSELECT '1872', '5', '1', '692658', '-1' UNION ALLSELECT '2154', '5', '1', '692659', '-1' UNION ALLSELECT '2145', '5', '1', '692667', '-1' UNION ALLSELECT '2184', '5', '1', '692668', '-1' UNION ALLSELECT '1151', '5', '1', '692677', '-1' UNION ALLSELECT '1152', '5', '2', '692677', '-1' UNION ALLSELECT '1153', '5', '3', '692677', '-1' UNION ALLSELECT '1154', '5', '4', '692677', '-1' UNION ALLSELECT '1156', '5', '5', '692677', '-1' UNION ALLSELECT '1714', '5', '6', '692677', '-1' UNION ALLSELECT '1930', '5', '7', '692677', '-1' UNION ALLSELECT '2009', '5', '8', '692677', '-1' UNION ALLSELECT '2083', '5', '9', '692677', '-1' UNION ALLSELECT '2084', '5', '10', '692677', '-1' UNION ALLSELECT '2085', '5', '11', '692677', '-1' UNION ALLSELECT '2086', '5', '12', '692677', '-1' UNION ALLSELECT '2087', '5', '13', '692677', '-1' UNION ALLSELECT '2088', '5', '14', '692677', '-1' UNION ALLSELECT '2167', '5', '15', '692677', '-1' UNION ALLSELECT '2168', '5', '16', '692677', '-1' UNION ALLSELECT '2169', '5', '17', '692677', '-1' UNION ALLSELECT '2227', '5', '18', '692677', '-1' UNION ALLSELECT '1653', '5', '1', '692678', '-1' UNION ALLSELECT '2023', '5', '1', '692679', '-1' UNION ALLSELECT '1496', '5', '1', '692680', '-1' UNION ALLSELECT '1503', '5', '2', '692680', '-1' UNION ALLSELECT '1510', '5', '3', '692680', '-1' UNION ALLSELECT '1438', '5', '1', '692681', '-1' UNION ALLSELECT '1439', '5', '2', '692681', '-1' UNION ALLSELECT '1440', '5', '3', '692681', '-1' UNION ALLSELECT '1473', '5', '4', '692681', '-1' UNION ALLSELECT '1475', '5', '5', '692681', '-1' UNION ALLSELECT '2007', '5', '6', '692681', '-1' UNION ALLSELECT '2172', '5', '7', '692681', '-1' UNION ALLSELECT '2192', '5', '8', '692681', '-1' UNION ALLSELECT '2020', '5', '1', '692682', '-1' UNION ALLSELECT '2022', '5', '2', '692682', '-1' UNION ALLSELECT '1059', '5', '1', '692685', '-1' UNION ALLSELECT '1060', '5', '2', '692685', '-1' UNION ALLSELECT '1061', '5', '3', '692685', '-1' UNION ALLSELECT '1062', '5', '4', '692685', '-1' UNION ALLSELECT '1063', '5', '5', '692685', '-1' UNION ALLSELECT '1064', '5', '6', '692685', '-1' UNION ALLSELECT '1065', '5', '7', '692685', '-1' UNION ALLSELECT '1066', '5', '8', '692685', '-1' UNION ALLSELECT '1067', '5', '9', '692685', '-1' UNION ALLSELECT '1694', '5', '10', '692685', '-1' UNION ALLSELECT '1069', '5', '1', '692686', '-1' UNION ALLSELECT '1070', '5', '2', '692686', '-1' UNION ALLSELECT '1827', '5', '3', '692686', '-1' UNION ALLSELECT '1829', '5', '4', '692686', '-1' UNION ALLSELECT '1999', '5', '5', '692686', '-1' UNION ALLSELECT '2027', '5', '6', '692686', '-1' UNION ALLSELECT '2054', '5', '7', '692686', '-1' UNION ALLSELECT '2156', '5', '8', '692686', '-1' UNION ALLSELECT '2070', '5', '1', '692687', '-1' UNION ALLSELECT '2180', '5', '1', '692688', '-1' UNION ALLSELECT '2186', '5', '2', '692688', '-1' UNION ALLSELECT '2189', '5', '3', '692688', '-1' UNION ALLSELECT '1055', '5', '1', '692689', '-1' UNION ALLSELECT '2185', '5', '2', '692689', '-1' UNION ALLSELECT '1721', '5', '1', '692692', '-1' UNION ALLSELECT '2050', '3', '422', '692697', '-1' UNION ALLSELECT '2063', '3', '426', '692697', '-1' UNION ALLSELECT '2238', '3', '515', '692697', '-1'[/code]You can see that the maximum level is 6, and this can be static ... I can just tell them they can only have 6 levels which is fine. So of course the level 6 can easily be converted into my dimensions through a query similar to this:[code="sql"]/* Level 6 leaf accounts roll straight up the six levels */SELECT t1.AcctID, t1.iOrder, t2.AcctID, t2.iOrder, t3.AcctID, t3.iOrder, t4.AcctID, t4.iOrder, t5.AcctID, t5.iOrder, t6.AcctID, t6.iOrder, t7.AcctID, t7.iOrderFROM tmpAcctTree t1 INNER JOIN tmpAcctTree t2 ON t1.ParentID = t2.AcctID INNER JOIN tmpAcctTree t3 ON t2.ParentID = t3.AcctID INNER JOIN tmpAcctTree t4 ON t3.ParentID = t4.AcctID INNER JOIN tmpAcctTree t5 ON t4.ParentID = t5.AcctID INNER JOIN tmpAcctTree t6 ON t5.ParentID = t6.AcctID INNER JOIN tmpAcctTree t7 ON t6.ParentID = t7.AcctIDWHERE t1.IsLeaf = -1 AND t1.iLevel = 6[/code]The problem arises with leaves at less than the maximum level. They need to be expanded somewhere between the second and the fifth level with a group that rolls into itself ... but of course that group can not exist elsewhere in the dimension at a different level ... or can it? |
Finding values with only one occurrence Posted: 17 Sep 2013 07:04 AM PDT Hi Everyone I have the following query which I wish to turn into a view. The query uses 3 tables to compare old and new values. SELECT Table1.QM, Table1.GD, Table1.Geometry, Table2.QM AS QM_OLD, Table2.GD AS GD_OLD, Table2.Geometry AS GEOMETRY_OLDFROM Table3 INNER JOIN Table2 ON Table3.GD_OLD = Table2.GD INNER JOIN Table1 ON Table3.GD = Table1.GDhere is some sample outputQM GD Geometry QM_OLD GD_OLD GEOMETRY_OLD024068-002 24068002 Value 037731-003 37731003 Value2055257-004 55257004 Value 006061-001 6061001 Value2055257-005 55257005 Value 006061-001 6061001 Value2055257-006 55257006 Value 006061-001 6061001 Value2055203-004 55203004 Value 034536-003 34536003 Value2055257-003 55257003 Value 053564-005 53564005 Value2what I have been trying to do with out luck is to include only the rows which there is only one value for GD_OLD. As one can see from the above sample output the 2-4 lines all have the same GD_OLD, so I do not to include them in the output. I want the output to look like the following, only including records with unique GD_OLD.QM GD Geometry QM_OLD GD_OLD GEOMETRY_OLD024068-002 24068002 Value 037731-003 37731003 Value2055203-004 55203004 Value 034536-003 34536003 Value2055257-003 55257003 Value 053564-005 53564005 Value2Any help with this would be valued. Thanks. |
Posted: 17 Sep 2013 06:24 AM PDT I have a text value in a string which I can convert to varchar(1000). field I am going to convert look like this. I need to extract the values between <EntryID> and </EntryID> I was thinking charindex but am stuck<NewOrder><InstID>ED</InstID><PatientID>22164</PatientID><LName>fACKSON</LName><FName>JAMES</FName><EntryID>1923236</EntryID><OrderID></NewOrder> |
converting nvarchar to decimal Posted: 17 Sep 2013 04:06 AM PDT Hi,i am trying to convert a nvarchar column to a decimal value. the nvarchar column has empty records as well as NULL values. now when i try to convert the values with: select CAST(round(column,2) AS decimal(18,2)) as columnfrom tablenameall goes well, but the empty and NULL values appear as 0.00 value but i want them to stay emptycan anyone help me on this , how to achieve this.regards,Bryan |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8) To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment