Viewing 15 posts - 1,711 through 1,725 (of 2,462 total)
These problems are fun. If the data format is always the same (##/##/####) you could also do this:
DECLARE @TestString VARCHAR(50)
SET @TestString = 'LastName, FirstName (DOB: 01/01/1900)'
SELECT SUBSTRING(@TestString, PATINDEX('%[0-1][1-9]/%', @TestString),10);
-- Itzik Ben-Gan 2001
March 19, 2015 at 1:18 pm
Had a second to kill. I put together a test to demonstrate why multi statement TVFs (mTVF) are terrible
Using TempDB (a DB I know you have) this code will create...
-- Itzik Ben-Gan 2001
March 18, 2015 at 9:54 pm
Great article. There is a good article about this at on SQLMag.com. This is huge news indeed and is all the rage where I work.
-- Itzik Ben-Gan 2001
March 18, 2015 at 8:39 pm
PSB (3/18/2015)
I have a report where there are fields like Field1,Field2,Field3,Field4 etc . In the report query there is a field named IsParentAccount . If it is 0 then I...
-- Itzik Ben-Gan 2001
March 18, 2015 at 2:56 pm
arthur.bekker (3/18/2015)
I showed the Execution Plan to this guy and he said that he wanted to "concrete" his...
-- Itzik Ben-Gan 2001
March 18, 2015 at 2:43 pm
Katerine459 (3/18/2015)
-- Itzik Ben-Gan 2001
March 18, 2015 at 2:26 pm
jhood (3/18/2015)
The recursion resolves row by row instead of sets. A while loop with temp tables...
-- Itzik Ben-Gan 2001
March 18, 2015 at 12:43 pm
g.britton (3/18/2015)
You can write this:
WITH CTE AS
(
SELECT somecolums,....
FROM sometable
WHERE...
-- Itzik Ben-Gan 2001
March 18, 2015 at 12:39 pm
chris.puncher (3/18/2015)
Here is an alternative method that proved much more...
-- Itzik Ben-Gan 2001
March 18, 2015 at 12:36 pm
Great article. One correction however:
Emphasis mine...
Below are some clauses that can't be used in a CTE:
ORDER BY (unless used with TOP clause)
INTO
OPTION clause with query hints
FOR XML
FOR BROWSE
Not true... You...
-- Itzik Ben-Gan 2001
March 18, 2015 at 12:25 pm
Had a few moments to kill... Here's an example of how to solve this using the link that I provided.
Note that I don't understand where, in row 1 of...
-- Itzik Ben-Gan 2001
March 18, 2015 at 11:31 am
This article should help:
Solving the Running Total and Ordinal Rank Problems[/url]
-- Itzik Ben-Gan 2001
March 18, 2015 at 10:56 am
This is a very good article on this subject:
http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/[/url]
-- Itzik Ben-Gan 2001
March 15, 2015 at 1:10 pm
Here's a solution.
I'm sure there is an easier way but this is a cursor/loop-free way that will work.
/*Assumptions
(1) There are alway 2 product names that are equal...
-- Itzik Ben-Gan 2001
March 13, 2015 at 5:05 pm
I have a solution but need a little clarification...
What exactly do you mean by
Amount = or (within +/- 5%) of Amount
For example, Let's say Amount1 is 1051 and...
-- Itzik Ben-Gan 2001
March 13, 2015 at 4:04 pm
Viewing 15 posts - 1,711 through 1,725 (of 2,462 total)