Viewing 15 posts - 541 through 555 (of 1,193 total)
Phil Parkin (3/29/2016)
Alan.B (3/29/2016)
You would use AND.
SELECT vend_id, prod_id, pro_price
FROM products
WHERE prod_price <=5
AND vend_id IN (1001, 1002);
Disagree. This requires an OR.
select a from b where condition1
union (should probably be union...
March 29, 2016 at 10:40 am
The original table has a computed column (LineTotal) in it.
When you created the copy of the table with SELECT...INTO, only the data for that column was moved to the...
March 29, 2016 at 7:43 am
DesNorton (3/28/2016)
March 28, 2016 at 9:27 am
Alan.B (3/25/2016)
Jacob Wilkins (3/25/2016)
Sachin Nandanwar (3/25/2016)
...But again it looks to cumbersome with all those conditions in the CASE expression.Your original solution is more subtle.
Your version doesn't have to be that...
March 25, 2016 at 11:34 am
Sachin Nandanwar (3/25/2016)
...But again it looks to cumbersome with all those conditions in the CASE expression.Your original solution is more subtle.
Your version doesn't have to be that complicated.
It could just...
March 25, 2016 at 10:14 am
Sachin Nandanwar (3/24/2016)
DECLARE @TranTable TABLE (AccountID INT NOT NULL
, TranDate ...
March 25, 2016 at 7:17 am
Not sure that this is the most efficient method, but I think it does what you're looking for:
WITH CTE AS
(
SELECT AccountID,
...
March 24, 2016 at 9:47 am
Hugo Kornelis (3/23/2016)
WHERE LEN(ISNULL(sfl.ConvertedContactId, '')) < 1
Alan already commented on this. I see this type of WHERE clause more often and it always me angers me. Just think about it....
March 23, 2016 at 11:29 am
Michael L John (3/22/2016)
rcooper 78099 (3/22/2016)
Incorrect syntax near the keyword 'join'.
Michael L John (3/22/2016)
Select
pc.accountnbr 'account number',
qf.description 'Fund Name',
pc.checknbr 'Check Number',
...
March 22, 2016 at 3:54 pm
jewel.sacred (3/22/2016)
March 22, 2016 at 1:13 pm
Alternatively, you could CROSS APPLY the calculations; those aliases could then be used in the column list.
The FROM clause would become something like this:
FROM dbo.fnItemsIssuedToLocBetwDatesNeedItemType(@DrugOrSupply, @BeginDate, @EndDate) fcnItems
INNER JOIN vwItemQtysOnHandAllItems_SQLViews...
March 22, 2016 at 11:41 am
Steve Jones - SSC Editor (3/22/2016)
Alan.B (3/21/2016)
March 22, 2016 at 8:49 am
To pile on to what Grant said, yeah, there's probably something else going on there. Those queries,table names, and deadlock issues are eerily familiar, so I'm guessing the "something else"...
March 21, 2016 at 9:35 am
John Mitchell-245523 (3/17/2016)
So you want to match every job with every status? Just use a CROSS JOIN.John
To elaborate on this, it sounds like you're looking for something like:
SELECT ...
March 17, 2016 at 8:24 am
You would just need to use dynamic TSQL, which you're already doing.
Something like this:
CREATE PROCEDURE test_use
@db_name sysname
AS
DECLARE @sql nvarchar(max);
SET @sql='USE '+QUOTENAME(@db_name)+'; ';
SET @sql=@sql+'
SELECT table_name=OBJECT_NAME(o.object_id),
...
March 15, 2016 at 9:55 am
Viewing 15 posts - 541 through 555 (of 1,193 total)