Viewing 15 posts - 61 through 75 (of 394 total)
DECLARE @column varchar(50) = 'user1@email.com';
SELECT LEFT(@column, CHARINDEX('@', @column, 1) -1);
March 4, 2015 at 8:51 am
SQLRNNR (3/4/2015)
crookj (3/4/2015)
Ed Wagner (3/4/2015)
ChrisM@Work (3/4/2015)
SQLRNNR (3/4/2015)
tootding
Ping
Pong
Long
Short
March 4, 2015 at 7:52 am
BWFC (3/4/2015)
Ed Wagner (3/4/2015)
djj (3/4/2015)
psingla (3/4/2015)
Woot!Woot!
Cheer
Wine
Vino
March 4, 2015 at 5:42 am
-- Updating a single-table CTE updates the underlying table, so the change is straightforward:
-- (Note that you need to order by Amount DESC to ensure the values are in row...
March 4, 2015 at 5:11 am
Try this:
--==TEST DATA ==--
use tempdb
go
drop table Persons
drop table Knows
drop table TakesClasses
create table Persons (id int, name varchar(50))
insert into Persons values (1, 'Fred'), (2, 'Bill'), (3, 'Mavis'), (4, 'Arthur'), (5, 'Jill'),...
March 3, 2015 at 8:46 am
How about this:
;WITH CTE AS
(
SELECT *, RN = ROW_NUMBER() OVER (PARTITION BY OrderID,ProjectID,ProductID ORDER BY OrderID,ProjectID,ProductID, Amount DESC)
FROM #projects
)
SELECT OrderID
,ProjectID
,Project
,ProductID
,Product
,Amount = CASE WHEN RN = 1 THEN Amount ELSE 0...
March 3, 2015 at 8:30 am
Ed Wagner (3/2/2015)
laurie-789651 (3/2/2015)
SQLRNNR (3/2/2015)
Ed Wagner (3/2/2015)
crookj (3/2/2015)
Ed Wagner (3/2/2015)
TomThomson (3/2/2015)
Revenant (3/2/2015)
whereisSQL? (3/2/2015)
djj (3/2/2015)
Lynn Pettis (3/2/2015)
HOMEHeart
CardioThorasic
Trouble
Tribbles
Klingon
Gorn
Kern
Jar
Head
Beavis
Homer
March 3, 2015 at 4:38 am
SQLRNNR (3/2/2015)
Ed Wagner (3/2/2015)
crookj (3/2/2015)
Ed Wagner (3/2/2015)
TomThomson (3/2/2015)
Revenant (3/2/2015)
whereisSQL? (3/2/2015)
djj (3/2/2015)
Lynn Pettis (3/2/2015)
HOMEHeart
CardioThorasic
Trouble
Tribbles
Klingon
Gorn
Kern
Jar
Head
March 2, 2015 at 2:45 pm
Hi. You need to provide test data so people can easily test your problem... like this:
--Here is the following Data Structure of tbltestnew1
use [tempdb]
go
if object_id('tbltestnew1') is not null...
March 2, 2015 at 9:33 am
How about this:
SELECT Customer, [Type], DueDate1, DueDate2 FROM dbo.myTable mt
WHERE mt.[Type] = @Type
AND ((@Condition1=1 AND mt.DueDate1 BETWEEN @DueDate1 AND @DueDate2) OR (@Condition1<>1))
AND ((@Condition2=1 AND mt.DueDate2 BETWEEN @DueDate1 AND @DueDate2) OR...
March 2, 2015 at 8:30 am
crookj (3/2/2015)
Ed Wagner (3/2/2015)
BWFC (3/2/2015)
Ed Wagner (3/2/2015)
Stuart Davies (3/2/2015)
Ed Wagner (3/1/2015)
SQLRNNR (2/27/2015)
clairvoyantClairaudient
Hokum
Act
Parliament
Government
Waste
Rubbish
March 2, 2015 at 7:05 am
If you run the package using DTEXEC, you can change the connections at run time using a parameter (/CONN) - so that might work.
March 2, 2015 at 2:31 am
BWFC (2/26/2015)
laurie-789651 (2/26/2015)
Stuart Davies (2/26/2015)
Ed Wagner (2/26/2015)
BWFC (2/26/2015)
Ed Wagner (2/26/2015)
djj (2/26/2015)
Stuart Davies (2/26/2015)
BWFC (2/26/2015)
CapitalExcellent
Adventure
Bill
Beak
Peck
Gregory
Girl
Interrrupted
lunchbreak
February 26, 2015 at 7:26 am
Have you got the SQL table definitions?
February 26, 2015 at 7:20 am
Stuart Davies (2/26/2015)
Ed Wagner (2/26/2015)
BWFC (2/26/2015)
Ed Wagner (2/26/2015)
djj (2/26/2015)
Stuart Davies (2/26/2015)
BWFC (2/26/2015)
CapitalExcellent
Adventure
Bill
Beak
Peck
Gregory
Girl
February 26, 2015 at 7:14 am
Viewing 15 posts - 61 through 75 (of 394 total)