Viewing 15 posts - 6,736 through 6,750 (of 8,731 total)
I believe that it's easier to use INFORMATION_SCHEMA views.
SELECT TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CASE WHEN DATA_TYPE IN( 'char', 'varchar', 'nchar', 'nvarchar') THEN '(' + CAST( CHARACTER_MAXIMUM_LENGTH AS varchar(10)) + ')'
WHEN DATA_TYPE IN('decimal', 'numeric') THEN...
March 19, 2014 at 11:01 am
If that works for you, then great. I tried this: (DT_DBTIMESTAMP)([Transaction Date] +" " + [Transaction Time])
And worked fine, but it depends on your local settings for dates. Your way...
March 19, 2014 at 9:29 am
Thank you Tom.
I knew you would come to correct me or explain further what I was trying to say. I totally agree with your post and it shows that...
March 19, 2014 at 9:16 am
Would something like this help?
WITH SampleData(String) AS(
SELECT 'plan type A change from plan type B from Plan type C' UNION ALL
SELECT 'Insurance plan M changed from Insurance plan b From...
March 19, 2014 at 9:00 am
ms-techie (3/18/2014)
Is EXCEPT Clause fasteror
is NOT EXISTS Clause faster ?
Have you tested them? That's the best indicator.
Someone has made some tests for you. You could thank Gail, but...
March 18, 2014 at 12:49 pm
Greg Edwards-268690 (3/18/2014)
Luis Cazares (3/18/2014)
Steve Jones - SSC Editor (3/18/2014)
jcrawf02 (3/18/2014)
March 18, 2014 at 11:37 am
I added some sample data to test the solution, but you should provide it for us on future occasions to get faster and better help.
WITH svkincd (slord, slline) AS(
SELECT 249486,...
March 18, 2014 at 11:27 am
Have you tried the EXCEPT clause? Do you have indexes in your tables?
March 18, 2014 at 11:02 am
Use DATEADD
declare @d1, @d2, @d3 datetime
...where @d1 between DATEADD(DD,-15,@d2) and DATEADD(DD,15,@d3)
March 18, 2014 at 10:41 am
Steve Jones - SSC Editor (3/18/2014)
jcrawf02 (3/18/2014)
March 18, 2014 at 10:36 am
I can't test this because my BIDS is not working, but you should end up with something like this:
(DT_DBTIMESTAMP)[Transaction Date] +" " + [Transaction Time]
You could check for other possible...
March 18, 2014 at 10:14 am
Try setting them as a String, because you can't add a dbtime to a date (don't ask me why, it's just the way they designed them). If you concatenate both...
March 18, 2014 at 9:54 am
What type are your [Transaction Date] & [Transaction Time] defined as? If they're not some kind of string, you might need to cast them before concatenating them.
March 18, 2014 at 9:14 am
andrew gothard (3/16/2014)
GilaMonster (3/16/2014)
I have two clients where I'm writing up a performance report which includes an entire section on their use of NoLock. Going to be an interesting week
PHB...
March 16, 2014 at 7:30 pm
If I understand correctly, you might be looking for something like this:
SELECT Division
,c2.Cat
,SUM( CAST( c.Value AS int)) Total
FROM #Document
CROSS APPLY( VALUES(1, SUBSTRING(Cat, 1, 1)),
(2, SUBSTRING(Cat, 2, 1)),
(3, SUBSTRING(Cat, 3,...
March 14, 2014 at 3:47 pm
Viewing 15 posts - 6,736 through 6,750 (of 8,731 total)