Viewing 15 posts - 9,496 through 9,510 (of 10,144 total)
Hi Augusto
This is usually straightforward - what does your source table look like? Can you post DDL with some sample data please?
October 3, 2008 at 5:14 am
samsql, could you help us by showing exactly how your output should look, in tabular format?
October 3, 2008 at 5:11 am
Fuzzy dedupe:
[font="Courier New"]-- Self fuzzy match
SELECT t.VendorID, r.VendorID AS Dupe, COUNT(*) AS TokenCount
FROM FuzzyInputFile r
INNER JOIN [Numbers] n ON n.number < LEN(r.VendorName)
INNER JOIN FuzzyInputFile t ON t.VendorID <> r.VendorID...
October 1, 2008 at 5:56 am
karthikeyan (10/1/2008)
Thanks a lot for your prompt reply with example. It is working fine now.
Can you tell me why you used BIT instead of INT ? Becuase both of them...
October 1, 2008 at 5:39 am
[font="Courier New"]DROP TABLE #Temp
CREATE TABLE #Temp (SomeColumn INT)
DECLARE @HasRowsINT INT, @HasRowsBIT BIT
SELECT @HasRowsINT = COUNT(*) FROM (SELECT TOP 1 * FROM #Temp) d
SELECT @HasRowsBIT = COUNT(*) FROM (SELECT TOP 1...
October 1, 2008 at 5:17 am
Ian Scarlett (10/1/2008)
This only needs to verify that a row exists in the table, and should only do a single I/O, regardless of...
October 1, 2008 at 4:51 am
Karthik, if I run your slight modification of my code as displayed in your post:
DECLARE @HasRows INT
SELECT @HasRows = COUNT(*) FROM (SELECT TOP 1 * FROM INVOICES_Monthly) d
SELECT @HasRows
Then the...
October 1, 2008 at 4:43 am
You don't have to COUNT() all of the rows...
DECLARE @HasRows BIT
SELECT @HasRows = COUNT(*) FROM (SELECT TOP 1 * FROM YourTable) d
SELECT @HasRows
Cheers
ChrisM
October 1, 2008 at 4:30 am
Hi Suresh
You're very nearly there, just a couple of small changes...
[font="Courier New"]DECLARE @UserId BIGINT
SELECT @UserId = UserId
FROM DAMS_Tbl_UsersLogin
WHERE UserName = @UserName
INSERT INTO DAMS_Tbl_RegisteredUsers
(UserId,FirstName,LastName,DateOfBirth ,StreetAddress1 ,StreetAddress2 ,
City,State ,CountryId...
September 30, 2008 at 3:16 am
Philip Horan (9/29/2008)
Chris poor explanation on my part. If the user enters 8 in the hours field then enters 15 in the minutes field this is recorded as 75:00000.Phil.
Many thanks...
September 30, 2008 at 12:56 am
Are they spaces? Or are they non-printing characters?
Try returning the ascii value of
LEFT(REVERSE(yourstring), 1)
and
SUBSTRING(REVERSE(yourstring), 2, 1)
Cheers
ChrisM
September 29, 2008 at 10:29 am
Hi Roger:
Update Billed
set bill_amount =
Case When product_Code like '%0000' then STATE_DUES
When product_code like 'CHAPT/%' and product_code not like '%0000' Then Local_dues
Else '9999'
End
where billed.ID = '123456'
Cheers
ChrisM
September 29, 2008 at 10:25 am
You're welcome maui, many thanks for the feedback.
September 29, 2008 at 10:21 am
September 29, 2008 at 10:07 am
This might help:
[font="Courier New"]DECLARE @Today DATETIME
SET @Today = DATEADD(dd,DATEDIFF(dd, 0, GETDATE()), 0) -- today with no time component
-- Sanity check:
SELECT @Today, DATEADD(dd, 1, @Today) AS Tomorrow_1, DATEADD(dd,1+DATEDIFF(dd, 0, GETDATE()), 0)...
September 29, 2008 at 10:03 am
Viewing 15 posts - 9,496 through 9,510 (of 10,144 total)