Forum Replies Created

Viewing 15 posts - 6,721 through 6,735 (of 7,191 total)

  • RE: Column name passed in as a parameter

    Debra

    The best solution to your problem would be to redesign your database so that it's properly normalised.  If you can't do that, the only option you have is to use...

  • RE: Automate creating the text log file in Windows environment

    I'm not sure what you mean.  What are you trying to create a text log file of?

    John

  • RE: Looking for any problems in SQL error log

    We search for the strings "MSG ", "ERROR:" and "ERROR." during our check.  This procedure is generic for SQL Server (7.0 and 2000) and Sybase, so you may not need...

  • RE: Validating VAT Numbers

    David

    This function should be what you're looking for.  It returns 1 if the number is valid, and 0 otherwise.  It only does the mathematical algorithm part, so you'll need to...

  • RE: Large Table Design

    Rob

    If you don't have any indexes on your table then you can't have a fill factor.  I would recommend starting off by creating a clustered index at the very least.  You...

  • RE: Plzzzzzzzzzzzz help - Replication Problem

    Shaimaa

    I'd be surprised if it's the speed of your connection that's causing the failure.  When you get the failure message, double-click on the failed agent in Enterprise Manager and you...

  • RE: Simple Select statement help

    Should work... Try this:

    SELECT show_name FROM My_Table WHERE show_name LIKE 'My hunter%'

    This will verify whether you have the correct data in your table.

    John

  • RE: Execute Query

    Make sure you have indexes properly defined on the two tables you are selecting from.  Best candidates are those columns used in joins and WHERE clauses.  Maybe a covering index...

  • RE: Get last record only if multiple exist

    Jim

    Yes - you did specify "based on a date".  So you can do it like this:

    SELECT TOP 1 EmpName, EmpDateTime, EmpData

    FROM Employees

    WHERE EmpID = @EmpID

    ORDER BY EmpDateTime DESC

    John

  • RE: Get last record only if multiple exist

    Jim

    You haven't given us much to go on!  Assuming you're not bothered which record you retrieve, something like this:

    SELECT TOP 1 EmpName, EmpDateTime, EmpData

    FROM Employees

    WHERE EmpID = @EmpID

    John

  • RE: Different Query plans for a same query on the same database

    Have you read about parameter sniffing?

    John

  • RE: T-SQL required

    Hemant

    I've run the query with your data and got 21 rows, as expected.  I suspect that what you have done is not to have cleared out the temp table before...

  • RE: Different Query plans for a same query on the same database

    You should not be surprised that changing the parameters results in a different executions plan since the number of rows returned is likely to be different and so the most...

  • RE: Replicating large batch inserts

    Anil

    If Andrew's suggestion doesn't work in your environment, try breaking down your insert into smaller batches.  That way, the first batch can be replicating on to the subscriber while the...

  • RE: T-SQL required

    Hemant

    Please post the output of this query:

    SELECT CustomerCode, InvoiceDate, InvoiceAmount

    FROM tblCustomerInvoice 

    ORDER BY CustomerCode ASC, InvoiceDateTime DESC

    John

Viewing 15 posts - 6,721 through 6,735 (of 7,191 total)