Forum Replies Created

Viewing 15 posts - 1 through 15 (of 97 total)

  • RE: Update Join Query Help!!!!

    Hello prb88,

    why you should do that?. Your lookup table plays a role, it serves to maintain the description out of the main table, and your request just negates the meaning...

  • RE: Excel VBA call to execute stored procedure.

    Kelvin Phayre (4/17/2013)


    How do you surround a stored procedures parameters so that any with a single quote don’t cause a crash.

    Excel VBA code

    ...

  • RE: Avoid DEADLOCK for concurrent DELETE

    Hello,

    maybe you can try to delete rows in small blocks, replacing your DELETE instruction by something like (I cannot check the syntax now)

    Delete TOP 1000 Products where instance = 'XXXX-xxx-xxx-xx'

    WHILE...

  • RE: create variable for IN statement

    Hello,

    my first thought is create a temp table or var table including these relations, then join.

    CREATE TABLE #T (ProdGrpCode varchar(10), ResultCode VARCHAR(10))

    INSERT INTO #T

    SELECT '500', '82' UNION SELECT '510', '82'...

  • RE: Csv list in column to separate columns

    Hello,

    you can do it in an iterative way:

    Find the first colon, keep the left half into Col1 and move the right half into Col2.

    Find the first colon in Col2, keep...

  • RE: repeatin value in my procedure

    Hello raghuldrag,

    I think your first need is help analyzing what the problem is.

    Your process proceed in three steps:

    - Summarize data from @table into #temp1.

    - Summarize data from @table into #tempr.

    -...

  • RE: Case Statement Problem

    Hello schauhan13,

    I think your Stored Procedure is 'perverted' by some kind of procedural thinking, and a set-based approach could be better. Lets me explain:

    Your CASE statement tries to calculate a...

  • RE: Cannot insert duplicate values

    Hello Nathan,

    have you discarded the obvious option?, maybe your Types table contains a duplicate TypeID.

    Francesc

  • RE: Showing all the months in a year

    Hello Sachin,

    I think the easiest way to go through this problem is creating a month table and left-joining it with your query, maybe something like (I have'nt checked it)

    WITH MonthList...

  • RE: How to iterate thru 10million plus records

    Hello,

    you can try to do it without using cursors, that should speed up your process.

    I think in a solution using intermediate tables, let me explain:

    You coded a query to strip...

  • RE: query to get first 2 records

    Hello,

    once I had a similar request and I decided to create a ROW_NUMBER function in Access, like

    Private last_Row_Number As Long

    Private key_Row_Number As String

    Public Function Initialize_Row_Number() As Long

    ...

  • RE: Combining Simple Count Queries

    Brandie Tarvin (1/27/2012)


    Careful, Francesc. You're making assumptions of foreign key relations based on names that could or could not have anything to do with the actual UserID. I've seen a...

  • RE: Combining Simple Count Queries

    Hello jennigirl,

    you coded three queries and now you only need to combine them using JOIN like that:

    SELECT UserId, [Total Asset], [Total Inventory]

    FROM User

    LEFT JOIN (

    SELECT UserIdCreated, COUNT (TimeCreated) AS [Total...

  • RE: Removing Commas in derived Column?

    Hello,

    try it:

    WITH CTE(x) AS (

    SELECT ', Clayton' UNION SELECT 'Township,' UNION SELECT 'Clayton, Dept')

    , NoRightComma (x) AS (

    SELECT CASE RIGHT(x, 1) WHEN ',' THEN LEFT(x, LEN(x) - 1) ELSE x...

  • RE: Select Query - need optimization

    I was believing that a LEFT JOIN was better in performance that a NOT IN clause, more generically, I accepted that a JOIN is generally better in performance than a...

Viewing 15 posts - 1 through 15 (of 97 total)