Forum Replies Created

Viewing 15 posts - 421 through 435 (of 441 total)

  • RE: using varchar variable to query a table

    Use dynamic SQL to complete your query, and you can send the amount of employee you want:

    Here's an example:

    DECLARE @SQL NVARCHAR(1000)

    DECLARE @ab NVARCHAR(100)

    set @ab = '''483503'',''483504'''

    SET...

    Cheers,

    J-F

  • RE: dealing with timestamp

    A trigger is good for the update statement, but I propose you use a simple default value for the new value. Here's how:

    USE tempdb

    GO

    CREATE TABLE [dbo].[Test]

    (

    ...

    Cheers,

    J-F

  • RE: Indexed views : Not the same behavior in Express Vs Standard Editions

    If I understand what you mean correctly, you are saying it would be quicker to do something like this:

    UPDATE vwGICSPFVendorUpdateAndKey

    SET MfrCode...

    Cheers,

    J-F

  • RE: Indexed views : Not the same behavior in Express Vs Standard Editions

    Maybe the query itself would help, even though I cannot give the tables or some data for them.

    Here is the query:

    UPDATE vwGICSPFVendorUpdateAndKey

    SET MfrCode = sub.MfrCode

    ...

    Cheers,

    J-F

  • RE: Indexed views : Not the same behavior in Express Vs Standard Editions

    Yes the query plan differs, but only a bit. I can post both here, but I don't think it would help. The only thing that differs is an "index spool",...

    Cheers,

    J-F

  • RE: Select Statement: Generate results from last 6 months

    Here is a dynamic procedure that should work better, since you can reuse it with a different parameter

    CREATE PROCEDURE SelectLastXMonths ( @nbMonths AS INT )

    as

    BEGIN

    ...

    Cheers,

    J-F

  • RE: OPENROWSET METHOD For unicode Charchters

    I would love to know the answer for that, as the damned architect decided to change the exporting method, and export as Unicode now, 😉

    If anyone has the answer, or...

    Cheers,

    J-F

  • RE: Inserting Nulls?

    Hi, it depends on what you want to do, insert another value to replace the Null value, or simply not insert. Here is an example if you want to insert...

    Cheers,

    J-F

  • RE: TRIM is driving me nut

    Works perfectly for me, are you sure the string is the right type? Why is there 49 length values and then 50? It works correctly for the NULL saying 4....

    Cheers,

    J-F

  • RE: TRIM is driving me nut

    Hi,

    When you use Len(String), it returns the length of the string before it finds only blanks. So a string with 2 blanks and 4 characters returns a length of 6,...

    Cheers,

    J-F

  • RE: Dynamic Query

    Simply append your query with the insert into query. Using the parameter itself, because you cannot execute an appened string unless it's in a single string. Here's an example:

    DROP TABLE...

    Cheers,

    J-F

  • RE: Problem with DeadLock Transaction

    It is actually a requirement to try importing the data as is, because we want to know if errors occured. That update will happen in 100 stores, and we need...

    Cheers,

    J-F

  • RE: Problem with DeadLock Transaction

    That would be interesting, since the BULK or OpenRowSet would use the same connection, so the same transaction, and access the "Uncommited rows".

    Can you give me a link or a...

    Cheers,

    J-F

  • RE: Problem with DeadLock Transaction

    Thanks for the reply, unfortunately, the idea does not work, the query still freezes when I try adding a new transaction in the current one. The top transaction is blocking...

    Cheers,

    J-F

  • RE: Loading text file to SQL Server 2005 using bulk insert

    Hi,

    I have an issue with using openrowSet:

    When using on real data, i got several products that with double quotes in the description, and caused me problems.

    Here is an example:

    ProductID ...

    Cheers,

    J-F

Viewing 15 posts - 421 through 435 (of 441 total)