Viewing 15 posts - 76 through 90 (of 152 total)
I agree that a Derived table is your best way. I would probably use:
SELECT DISTINCT DeniedCharge, Account, DenialDate, DenialCode
FROM DenialStore
This should return the equivalent of one, and only one,...
March 2, 2005 at 11:33 am
You can try this UDF - it should do what you need:
Create Function dbo.ufn_LastBusinessDayOfMonth(
@dt datetime
)
RETURNS datetime
AS
BEGIN
Declare @dt2 datetime
Declare...
March 1, 2005 at 7:17 pm
What a great function set - and it truncates off any minutes as well!
Two thumbs up!
February 18, 2005 at 5:03 pm
You should be able to do this in one statement, e.g.:
Select a.EffectiveDate As StartDate,
(Select Min(x.EffectiveDate) FROM MyTable x WHERE x.EffectiveDate > a.EffectiveDate) As EndDate, a.Code1, a.Code2
FROM...
February 17, 2005 at 6:48 pm
As shown, this will be using, not the windows login of the job (or you), but a login chosen as follows:
When xp_cmdshell is invoked by a user who is a...
February 16, 2005 at 6:04 pm
Just as a heads-up, you will probably be better off just appending '01' to the existing data string you have, rather than using the mm/dd/yyyy format. yyyymmdd is an...
February 16, 2005 at 5:51 pm
CAST or CONVERT the variables to datetime, e.g.:
where datesold between Cast(@startdate as Datetime) and Cast(@startdate as Datetime)
June 30, 2004 at 10:28 am
Okay - I am going to play with the query optimizer's mind here:
SELECT * From (
SELECT *, 'a' AS Filter FROM tbl_a INNER JOIN tbl_b ON tbl_a.index = tbl_b.serial WHERE tbl_a.row_id = @row_idUNIONSELECT...
June 30, 2004 at 10:26 am
Well, the basic query structure is fairly straightforward. Your big problem is the first transaction, which has a date before the first entry in your Exchange Rate table.
The correct way...
June 29, 2004 at 11:39 am
A quick run through Query Analyzer would probably tell you more than I can, but I would believe that the conditional field check would cause the analyzer to miss the...
June 29, 2004 at 11:25 am
You are correct in your first supposition -- you need to restore both Log backups.
REASON: One of the things that log backups do is to signal to SQL Server that...
May 13, 2004 at 5:05 pm
Marco has a valid point. However, you probably should just embed the SQL call into a Stored procedure, and return the Identity from that SP, e.g.:
CREATE PROCEDURE usp_MyStoredProc
@Param1 int, @Param2...
May 13, 2004 at 4:57 pm
Your code does not include the MOVE parameter. Thus, by default, the .MDF and .LDF files are placed in the same physical location for both DBs, because RESTORE extracts that...
May 13, 2004 at 4:51 pm
Best bet:
Where are you restoring the DB files to? If you forgot to alter the destination of the .MDF/.LDF files on restore for the second instance, they will default to...
May 11, 2004 at 11:20 am
In SQL Server, the datatype names are a bit different:
BLOB = Image
CLOB = Text or NText
So, to create a BLOB:
CREATE TABLE MyTable (MyBLOB image)
May 11, 2004 at 11:14 am
Viewing 15 posts - 76 through 90 (of 152 total)