Forum Replies Created

Viewing 15 posts - 466 through 480 (of 595 total)

  • RE: When does a null not equal a null?

    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...

  • RE: sa Audit Trail

    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...

  • RE: Incorrect syntax near -.

    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...

  • RE: Incorrect Syntax Error Message

    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...

  • RE: Incorrect Syntax Error Message

    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 =...

  • RE: Fulltext query funky.

    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...

  • RE: Incorrect Syntax Error Message

    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)

             + '...

  • RE: Help With DateTime Values

    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...

  • RE: Creating Relations with T-SQL

    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...

  • RE: Date Comparision of the Month Part

    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...

  • RE: Text Conversion Problem

    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...

  • RE: Text Conversion Problem

    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...

  • RE: Using Count is a Proc

    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...

  • RE: SQL Server UDP 1434 Database Instance TCP Information Disclosure

    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...

  • RE: Handle on Host Machine.

    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,...

Viewing 15 posts - 466 through 480 (of 595 total)