Viewing 15 posts - 5,011 through 5,025 (of 8,731 total)
Either you write the 10 queries or you use Dynamic SQL. You could use a procedure called sp_MSforeachdb (which is undocumented) or Aaron Bertrand's version http://sqlblog.com/blogs/aaron_bertrand/archive/2010/12/29/a-more-reliable-and-more-flexible-sp-msforeachdb.aspx
What limitations are you concerned...
April 13, 2015 at 6:00 pm
CAST is not needed. At least for what you posted.
SELECT *,
'the freight cost is ' + REPLACE(cost, '.', ' dollars and ') + ' cents'
FROM (VALUES(65.83))...
April 13, 2015 at 4:45 pm
ScottPletcher (4/13/2015)
Go ahead and add DISTINCT to each separate query on which it's applicable:
SELECT DISTINCT omlSalesOrderID
FROM m1_dc.dbo.SalesOrderLines
WHERE omlPartID='finalmile'
UNION
SELECT ompSalesOrderID
FROM m1_dc.dbo.SalesOrders
WHERE ompShippingMethodID='JBFM'
Why? :unsure:
April 13, 2015 at 2:45 pm
Something like this could help.
SELECT
ISNULL( t.Amount, 0) Amount,
t1.TranDate
FROM #Test1 t1
LEFT JOIN
(
SELECT SUM(Amount) AS Amount,
CASE WHEN DATENAME(DW,...
April 13, 2015 at 1:20 pm
Something like this?
SELECT omlSalesOrderID
FROM m1_dc.dbo.SalesOrderLines
WHERE omlPartID='finalmile'
UNION
SELECT ompSalesOrderID
FROM m1_dc.dbo.SalesOrders
WHERE ompShippingMethodID='JBFM'
April 13, 2015 at 9:40 am
cooljagadeesh (4/13/2015)
thanks boss
Do you understand the solution that Eirikur provided? There's at least one question that I'd ask.
April 13, 2015 at 8:36 am
I'm not sure if this more simple option would fit you.
What happens if a row falls into the following 24 hours but it's on a different date? This option...
April 13, 2015 at 8:31 am
WayneS (4/10/2015)
Luis Cazares (4/10/2015)
http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation...
April 10, 2015 at 4:51 pm
Alan.B (4/10/2015)
April 10, 2015 at 4:43 pm
Not exactly. They're more like :old and :new
April 10, 2015 at 4:05 pm
As it has been noticed, on a trigger you should use inserted and deleted virtual tables.
I'd use a different approach to be sure that the value on the column changed.
CREATE...
April 10, 2015 at 3:21 pm
SQLRNNR (4/10/2015)
Luis Cazares (4/10/2015)
http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation...
April 10, 2015 at 2:11 pm
Basically, you need a cross tabs solution with an additional row_number to define the order of your columns.
Here's an article on cross tabs: http://www.sqlservercentral.com/articles/T-SQL/63681/
And here's an example:
WITH SampleData (PERSON, ACCOUNT,...
April 10, 2015 at 1:56 pm
Someone just mentioned that you could have 2 clustered indexes on a table. But I'm sure he's high. 😀
http://www.sqlservercentral.com/Forums/FindPost1676220.aspx
But, think about it, what if you're in situation where, if you...
April 10, 2015 at 1:45 pm
Grant Fritchey (4/10/2015)
Brandie Tarvin (4/10/2015)
Grant Fritchey (4/10/2015)
Is everyone OK? Are people ill or something? Because this just happened and it has me concerned:
Not that I've ever been that high, but...
April 10, 2015 at 12:16 pm
Viewing 15 posts - 5,011 through 5,025 (of 8,731 total)