Forum Replies Created

Viewing 15 posts - 46 through 60 (of 152 total)

  • RE: Single Quotes

    "...how do I get the list of names into the procedure incuding the single quotes?"

    That depends on the source of the list. I could provide you with Visual Basic...

  • RE: Single Quotes

    The most common way to do this is to use dynamic SQL and create your SQL String on the fly, e.g.:

    CREATE PROCEDURE sp_GetCertainNames

    @variable varchar (100) AS

    DECLARE @sql varchar(2000)

    SET...

  • RE: xp_cmdshell zipping back ups?

    You still may have permission issues related to the user accounts being used by SQL Server. From BoL:

    When xp_cmdshell is invoked by a user who is a member of...

  • RE: what''''s wrong with this code

    Did your previous restore steps (including RESTORE DATABASE) include either WITH STANDBY or WITH NORECOVERY? If not, this message is expected. All of the steps, except the final...

  • RE: update statement trouble

    You can only have one JOIN / WHERE combination in an update statement. Thus, this should be:

    UPDATE reportTable

    SET programName = description,

    period = currentPeriod

    FROM ReportTable...

  • RE: 3 tables, one query?

    First, I would recommend that you look at this article here:

    http://www.sqlservercentral.com/columnists/dpeterson/lookuptablemadness.asp

    What you are doing seems to me to be an example of what he talks about.  However, back to your question.

    The...

  • RE: Concatenate Column

    IMO, this calls for a User-defined function:

    -- Create a testing table

    Create Table TestTable (ID int, TestStr varchar(20))

    GO

    Insert Into TestTable Values (1, 'ABC')

    Insert Into TestTable Values (1, 'DDD')

    Insert Into TestTable Values...

  • RE: How to Define Global Variable

    There is, in fact, a mechanism to do what you need (though it is not in the most convenient format ever):  Session Context information.  To quote from BoL:

    February 22, 2006 at 11:50 am

    #622713

  • RE: easier way??

    Personally, I would use something like this structure (Sample code and test below):

    Create Table ConditionChecks (

     CheckID int identity,

     CheckDescription varchar(250))   --  Just descriptions so you know what conditions mean what

    GO

    Create...

  • RE: Another user trying get around a TEMP table

    I don't see the need for a temp table here when a derived table is just as easy. Also, the check for Yesterday will go slightly faster in this...

  • RE: Updating rows for my shopping cart

    There are a few details that I feel are missing. Without this information, I could not answer your question. Looking at the items in your cart:

    2302, '000765-03', 'IDS...

  • RE: Join SQL needed to Update column

    I think that this can be done with a simpler, single query, thusly:

    Update TBL_B

    Set OrderItemID =

       Coalesce((Select Max(ID) maxID

          FROM TBL_A A2

          INNER JOIN

             (Select OrderID, InstanceID

             FROM TBL_A A3...

  • RE: Failed BETWEEN Operator

    Just as a debugging question, did you run the alternate form:

    INSERT INTO @tmpView (ID)

    SELECT ID FROM @tmpTasks

    WHERE ID >= @BlockStart AND ID <= @BlockEnd

    If so, did it give similar or...

  • RE: DTS import

    One approach would be a custom transformation script. Here is a simplistic example (for a table with two columns only)

    '**********************************************************************

    ' Visual Basic Transformation Script

    ' Copy each source...

  • RE: How to subtract two values to give me a total and grand total

    I'm not *quite* certain what you are attempting here - SUM works across rows, and you are using it within a single row?

    Perhaps a small dataset showing what you want...

Viewing 15 posts - 46 through 60 (of 152 total)