Viewing 15 posts - 316 through 330 (of 426 total)
If all you need is to parse the strange date format, then Try:
DECLARE @DateStr varchar(50)
SET @DateStr = '03/Jun/2005:11:16:40'
SELECT CONVERT(varchar,REPLACE(LEFT(@DateStr,11),'/',' ')+' '+ RIGHT(@DateStr,8),113) AS Europe_default
Andy
August 1, 2005 at 11:29 pm
You can take advantage of COUNT ignoring NULL like this:
SELECT SourceFile,
COUNT(ID) AS Records,
COUNT(NULLIF(Processed,'some value to exclude')) AS RecordsProcessed
FROM dbo.tbl_1
GROUP BY SourceFile
Andy
July 29, 2005 at 2:44 am
I would suggest changing your code structure like this:
DECLARE @object int
-- the rest of your variables
, @hr int
, @src varchar(255)
, @desc varchar(255)
...
--##Create Message object
EXEC @hr = sp_OACreate 'CDO.Message', @object OUT
IF...
July 29, 2005 at 2:34 am
Depending on the data load and the indexed values, sometimes you are better off dropping the index, loading the data, then creating the index. The only way to know is...
July 29, 2005 at 2:02 am
I agree with Ford that the best would be 3, script the existing server, and transfer to the New server after tweaking the scripts for the desired re-organization.
I would...
July 28, 2005 at 12:52 am
Make sure that the Connection string does not have a Mode= setting that may be causing multi-user issues.
If you are using IIS, on the Web server: Add the IUSR_<machinename> and...
July 28, 2005 at 12:25 am
Try this:
if exists (select * from dbo.sysobjects
where id = object_id(N'Test')
and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table Test
GO
CREATE TABLE Test (MemberNo varchar(6)
, ClaimCount int
, RunningTot int)
GO
INSERT INTO Test (MemberNo,ClaimCount)
VALUES...
July 26, 2005 at 12:30 am
Try:
SELECT resid.[name] as typename,
COUNT(re.renderedemailstatusid) AS numEmails
FROM renderedemailstatustypes as resid
LEFT JOIN renderedemails AS re
ON resid.renderedemailstatusid = re.renderedemailstatusid
AND re.emailsessionid = 313
GROUP BY resid.[name]
Andy
July 21, 2005 at 8:26 pm
July 18, 2005 at 2:17 am
Use the ISO date format and it will not matter what DATEFORMAT your server or client uses:
declare @x varchar(8)
SET @x ='20030311'
select * from task where convert(varchar(8),task.entrydt,112) >= @x
select * from...
July 14, 2005 at 10:32 pm
Try this one:
DECLARE @Name varchar(80)
SET @Name = 'Sara Jane Smith-Jones'
SELECT
RTRIM(LEFT(@Name,LEN(@Name)-CHARINDEX(' ',REVERSE(@Name)))) AS FirstName
, LTRIM(RIGHT(@Name,CHARINDEX(' ',REVERSE(@Name)))) AS LastName
Andy
July 14, 2005 at 10:23 pm
If SQL Server is installed as the default instance, then SELECT @@SERVERNAME will return the netbios server name.
Andy
July 12, 2005 at 11:48 pm
I have used Visio 2003 for Enterprise Architects, be aware that even with 2003 in the name, it is actually Visio 2002. This is part of the Visual Studio .NET...
July 12, 2005 at 11:44 pm
CInt converts to a smallint, could that be the problem, if your SessionID is an int then use CLng instead of CInt.
Andy
July 12, 2005 at 11:24 pm
DECLARE @MerchID varchar(16)
, @LastMerchID varchar(16)
SELECT TOP 1 @MerchID = MerchID
FROM DailyData
WHERE MerchID > @LastMerchID
ORDER BY MerchID
WHILE LEN(@MerchID) > 0
BEGIN
...
-- Loop
SET @LastMerchID = @MerchID
SELECT...
July 12, 2005 at 1:16 am
Viewing 15 posts - 316 through 330 (of 426 total)