Viewing 15 posts - 466 through 480 (of 595 total)
I assume that @Subcategory contains a specific subcategory for which you are searching.
How about:
if (select count(*) from table
where year = @year
and period = @period
and category = @category
and...
December 15, 2004 at 6:06 am
Using the host name, can you identify where the machine is physically located? Is it a shared machine, or does it belong to one user? If you can physically visit...
December 6, 2004 at 7:34 am
Actually, sp_msforeachdb changes the database context to each database as it is processed, so you can do this instead:
exec master.dbo.sp_msforeachdb
"insert tempdb.dbo.DbGrowth select @@servername as Servername, DB_NAME() as Databasename, getdate() as...
December 6, 2004 at 7:09 am
You've got two inner joins:
1. Receipts INNER JOIN Offices ON Receipts.OfficeID = Offices.OfficeID
2. Receipts INNER JOIN UserLogins ON Receipts.UserID = UserLogins.UserID
The problem lies with your data or the JOINs you've chosen.
Try it without the...
December 3, 2004 at 8:47 am
The expression shouldn't limit the number of rows returned. What do you get if you execute:
SELECT
CityID,
RcptDate,
RcptAmt,
PymtTypeID,
PermitNum,
CheckNum,
RecdFrom,
CaseNumber,
CasePlaintiff,
CaseDefendant,
CourtName,
SubpeonaDate,
UserLogins.LastName + ', ' + FirstName AS Username,
Waived,
WaivedReason,
Voided,
VoidDate,
VoidReason
FROM Receipts JOIN Offices ON Receipts.OfficeID =...
December 3, 2004 at 7:41 am
Your query looks okay. Is your fulltext index up to date? When you say you have reviewed the HTML for each document, do you mean that you SELECT the HTML...
December 3, 2004 at 7:22 am
I'm not sure exactly what format you want for the computed column. However, here are some possibilities. Reorganize the expression as needed.
CREATE VIEW vwSelect_Receipts
AS
SELECT ...
SUBSTRING([OfficeCostCtr], 3, 3)
+ '...
December 3, 2004 at 6:39 am
One more way...
--DROP TABLE dates
GO
CREATE TABLE dates (id int PRIMARY KEY, date1 datetime, date2 datetime)
DECLARE @date datetime
SET @date = '02:00 AM'
SET NOCOUNT ON
INSERT...
December 2, 2004 at 9:18 am
As was mentioned earlier, refer to CREATE TABLE and ALTER TABLE in Books Online. Specifically, you can define foreign keys to show table relationships.
ALTER TABLE table
{ [ ALTER COLUMN...
December 2, 2004 at 7:50 am
Still another way to consider:
-- This expression: CONVERT(varchar(6), <datetime value>, 112)
-- Returns: YYYYMM as a character string that will sort/compare correctly.
DECLARE @date1 datetime, @date2 datetime
SET @date1 = '5/1/2004'
SET @date2...
November 23, 2004 at 6:26 am
Here's a bit more code. To simplify the main code, I've used two UDF's, dbo.fRStrBefore() and dbo.fRStrAfter(). You'll have to create those first to use the rest of the code.
I've...
November 17, 2004 at 7:40 am
Here's a quick modification that also includes the long filename with the path stripped off. Your problem is that ALTERNATE_NAME is the 8.3 filename, but your desired files are 9...
November 16, 2004 at 6:56 am
Two possible methods are:
SELECT dbo.Orders.OrderNumber,
dbo.Orders.OrderDate,
dbo.Orders.OrderValue
FROM dbo.Advantage
INNER JOIN dbo.Customer ON dbo.Advantage.CustomerRef = dbo.Customer.CustomerID
INNER JOIN dbo.Orders ON dbo.Customer.CustomerID = dbo.Orders.CustomerRef
WHERE dbo.Orders.OrderNumber like 'CTW%' and...
November 9, 2004 at 7:23 am
Thanks, Steve.
Any change I make to our servers requires documentation, so I wanted to identify the specific security alert (issued by Microsoft). However, I've been unable to locate it so far.
Thanks...
November 8, 2004 at 5:56 am
If you aren't using the program_name column in master..sysprocesses (i.e. explicitly setting it as part of your connection string), then you could use that to store your desired value.
Of course,...
November 5, 2004 at 6:52 am
Viewing 15 posts - 466 through 480 (of 595 total)