Viewing 15 posts - 6,511 through 6,525 (of 8,731 total)
Phillip.Putzback (5/2/2014)
May 2, 2014 at 3:41 pm
You could start by posting the correct information. The values that you posted can't be stored in an int column. You have either the incorrect column or the incorrect logic....
May 2, 2014 at 2:07 pm
djj (5/2/2014)
I believe you are looking for CHARINDEX with [0-9][0-9][0-9].Something like:
SUBSTRING(yourvalue, CHARINDEX('[0-9][0-9][0-9]',yourvalue), lengthyourvalue)
Note this is not tested.
CHARINDEX doesn't accept wildcards, that why we need to use PATINDEX.
May 2, 2014 at 12:44 pm
Are you looking for something like this? Or what is your expected output?
WITH SampleData AS(
SELECT 'xxIN187 13-14 W Elem' CalendarId UNION ALL
SELECT...
May 2, 2014 at 12:39 pm
Real column names or data don't matter. Real data types matter and the structure of the data as well to be sure that we can give an accurate solution.
May 2, 2014 at 11:38 am
pooyan_pdm (4/30/2014)
April 30, 2014 at 4:33 pm
It took me a while to go through your code to figure out what it was doing.
As stated before, you just need to add a default to your parameter. But...
April 30, 2014 at 10:00 am
Grant Fritchey (4/30/2014)
April 30, 2014 at 9:12 am
rock.liu (4/30/2014)
SELECT a.BoxId, b.field1 as value1, c.field1 as value2, d.field1 as value3, e.field1 as value4
FROM boxes a
cross apply (select top 1 b.field1 from widgets b...
April 30, 2014 at 9:07 am
The Pattern Splitter made by Chris Morris is able to help you in this situation. You can read about it in this article: http://www.sqlservercentral.com/articles/String+Manipulation/94365/
And you'll end up with something like...
April 30, 2014 at 8:56 am
Why would you want to delete a row that has just been inserted in a table?
If you really need something like that (instead of directly executing the program) you could...
April 29, 2014 at 4:49 pm
I'm not sure that I understand exactly what you want. First of all, it's nonsense to store a column with a value that will be the same for all rows.
Second,...
April 29, 2014 at 4:32 pm
What about using the code 120?
CONVERT( datetime, @myDate, 120)
April 29, 2014 at 12:09 pm
Something like this?
WITH SampleData(ID, Source, Rank) AS(
SELECT 123, 'Foo', 10 UNION ALL
SELECT 123, 'Bar', 20 UNION ALL
SELECT 124,...
April 29, 2014 at 10:15 am
caippers (4/29/2014)
ID is the PK in this table.
If ID is the PK, why is it repeated? PKs should be unique.
April 29, 2014 at 10:06 am
Viewing 15 posts - 6,511 through 6,525 (of 8,731 total)