Viewing 15 posts - 181 through 195 (of 479 total)
There are probably better ways...
[font="Courier New"]
DECLARE @temp VARCHAR(30)
SET @temp = 'Pravin,Mit,Sid'
DECLARE @rest VARCHAR(30)
DECLARE @table_var TABLE (name VARCHAR(30))
SET @rest=@temp
WHILE PATINDEX('%,%',@rest) <> 0
BEGIN
INSERT @table_var VALUES(LTRIM(RTRIM(SUBSTRING(@rest,1,PATINDEX('%,%',@rest)-1))))
SET @rest = SUBSTRING(@rest,PATINDEX('%,%',@rest)+1,LEN(@rest))
END
INSERT @table_var VALUES(LTRIM(RTRIM(@rest)))
SELECT...
February 17, 2009 at 10:43 am
I got the same wrong (but right) answer as everyone else (Option 4 only), but learned something while testing the result.
select '2009-02-01 00:00:00:000' union
select '2009-01-31 23:59:59:999'Produces 2 rows.
select convert(datetime,'2009-02-01 00:00:00:000')...
February 17, 2009 at 10:22 am
Ramesh (2/17/2009)
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/3b76545e-ad7d-4a05-8766-272546aeed2e.htm
How to: Create a SQL Server Agent Job (Transact-SQL)
This topic describes how to use stored procedures to create a Microsoft SQL Server Agent job.
To create...
February 17, 2009 at 10:06 am
If you can guarantee that each 'Running' state has a matching 'Success' or 'Error' (i.e. you never get consecutive 'Running' state) you could tryDROP TABLE #Table
CREATE TABLE #Table (ObjectID INT,...
February 17, 2009 at 7:21 am
Jeff Moden (2/16/2009)
Derek Dongray (2/16/2009)
bitbucket (2/13/2009)
shhh tell no one, but heck it was better than using a slide rule to do the calculations.
I still have my slide rule and can...
February 17, 2009 at 3:51 am
That make UK holidays seem generous.
My package, which I don't think is unusual, is to get 25 days off per year plus 8 public holidays (New Year, Good Friday, Easter...
February 16, 2009 at 10:00 am
If you are willing to use a (free) 3rd party tool, Konesans' File Watcher Task sounds like it does exactly what you want.
NB: I haven't use this particular tool myself...
February 16, 2009 at 9:30 am
Leo (2/14/2009)
INSERT INTO Employee(Name, CardNo)SELECT (Name, CardNo)
From Emp_Detail T
LEFT JOIN Stuff_Detail I
ON T.CardNo = I.CardNo COllate database_Default
WHERE I.CardNo IS NULL
This is an invalid query because:
1....
February 16, 2009 at 9:20 am
It's a LEFT JOIN.
Unmatched records have NULLs in all the fields from the unmatched table. See http://msdn.microsoft.com/en-us/library/ms177634(SQL.90).aspx
February 16, 2009 at 9:08 am
This isn't actually a bad question, but my thought when I read
louisevb (2/16/2009)
February 16, 2009 at 8:56 am
"Process completed successfully for " + (DT_STR,4,1252)[YEAR]([DATEADD]("d",-1,[GETDATE]())) + "-" +
("0" + (DT_STR,2,1252)[MONTH]([DATEADD]("d",-1,[GETDATE]())),2) + "-" +
("0" + (DT_STR,2,1252)[DAY]([DATEADD]("d",-1,[GETDATE]())),2)
February 16, 2009 at 8:45 am
How about...create table #t ([inc_id] int, player varchar(10))
insert #t
select 1, 'Ned' union all
select 1, 'Bob' union all
select 1, 'Steve' union all
select 2, ...
February 16, 2009 at 8:36 am
Or DATEADD("d",-1,GETDATE())
(I forgot that SSIS needs the quotes).
February 16, 2009 at 8:09 am
Derek Dongray (2/16/2009)
How about using DATEADD(d,-1,GETDATE()) ?
For SSIS, it's DATEADD("d",-1,GETDATE()).
BTW, I tested this with a flat source file (with 1 line in it), a Derived Column Transform (with the OP's...
February 16, 2009 at 7:48 am
Viewing 15 posts - 181 through 195 (of 479 total)