sql - How to get many rows based on several uniqueidentifiers? -
I'm trying to select one like this: It only returns content with the first How can I get all the rows? You Dynamic to generate query SQL But it will need to ensure that the list has been cleaned Use a partition function to parse the list and use it as a line Add each entry to a table variable, which you include on it or Use Option 2 will usually be my preferred approach Or you can use CTE to do something (on the basis)
announcement @ ContentIDs VARCHAR (max); Select @ContentIDs = 'e28faa48-Adea-484d-9d64-ba1e1c67eea3,8338A6DE-8CDF-4F52-99CE-62E2B107FF97' SELECT * FROM [content] where [ID] (@ContentIDs) in
uniqueIdentifier
select * Sector [content] where '% cast like' @ContentIDs + ([ID] as varchar (36)) + < '%' / code> is forced to a full scan, but if you can match many rows This may not be the case. ( edit but if you are matching multiple rows then the comparison string will be huge!)
announcement @SantanceIdS VARCHAR (Max); Set @ContentIDs = 'e28faa48-Adea-484d-9d64-ba1e1c67eea3,8338A6DE-8CDF-4F52-99CE-62E2B107FF97'; With GUIDs (PNS, initially, [off] as (1 selected as bigint), cast (1), CHARINDEX ( ',', @ContentIDs) UNION select all PN + 1, [pause] +1, CHARINDEX (',', Content IDs, [Stop] + 1) Select from where Gods [Stop]> Select & lt; Collist & gt; The [material] in WHERE [ID] (Select Cast (Eltiaraim (Artiaiaim (Sbstring (@ Kantentaidi start, the case when [stop]] gt; [THEN] [stop] Start ELSE LAN (@ContentIDs) END))) As UNIQUEIDENTIFIER) from Guids where [stop]> gt; or start> 1)
Comments
Post a Comment