Forum Replies Created

Viewing 15 posts - 271 through 285 (of 498 total)

  • RE: UPDATE, there has got to be an easy way

    Try

    
    
    UPDATE foo
    SET Field = REPLACE(Field, '"','')

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: i dont understand

    I think the problem is that you are using the Like statement on the outer table in the where clause rather than the join clause. This will in effect cause...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: On Error Resume in a Stored Procedure

    I don't believe you will be able to trap the error in TSQL when the file can't be opened. Personally I feel that this should be done the other way...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: INSERT Problem

    Use the same technique we do when deleting large amounts of data...

    
    
    DECLARE @NumRows int
    , @iErr int
    , @PK ...
    --...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: variable for DB name in sql script

    Better yet just store the scripts as a file WITHOUT the DB Name. Then use a batch file to run the scripts via osql. Since the scripts will be running...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: variable tablename in cursor select stmt

    jxflagg is correct. If you create a temp table and then use dynamic sql to fill it you should be able to create a cursor against it with no problems....




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: Init cap

    Give this a try Bruce,

    
    
    SELECT fName
    FROM Names
    WHERE fName COLLATE Latin1_General_BIN LIKE ('[a-z]%')

    Basically this is using psuedo regular expressions inside the Like function. I've added the collate...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: Problem with SubQuery and 'IN' clause

    I've never seen that. But just out of curiosity what happens if you change the query to the following?

     
    
    SELECT X.*
    FROM ACCOM_LIVE X
    ...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: BULK INSERT - Identity values not in sequence

    If that is the case I would write a batch file to add a "LineNumber" field to your text file and import it as a field in your table. Then...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: SQL XML generation

    Andy,

    I too wish there were an easier way to do this as my SP that uses the Explicit XML conversion is almost 3000 lines long! Trying to debug it...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: Help! Is it a replicated database?

    I'm afraid that the sp_helpreplicationoption only works on publishers. The only thing I can think of is to check to see if there are any tables in your database that...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: How would you do this?

    Are you stuck with this data model? It would seem much easier if you had a table to hold the case information (tblCase) and just one table to hold the...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: updating different records in one SP

    I have a UDF that will do the parsing of the string and return a table. I then simply write something like the following.

    
    
    UPDATE T
    SET BTI...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: T-SQL Bug

    While your resolution may work I would still suggest putting your field names explicitly in the query as was suggested by Chris and Jeremy. You are taking sloppily written bug...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • RE: Alternative to NOT IN

    For a left join you could try something like the following...

    
    
    SELECT T.IDFromTable1 , T.IDFromTable2
    FROM Table T
    LEFT JOIN Table T2 ON T.IDFromTable1...




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 15 posts - 271 through 285 (of 498 total)