Forum Replies Created

Viewing 15 posts - 76 through 90 (of 498 total)

  • RE: Need Help removing leading tab

    Take a look at the Right() function.

    SELECT @tabremove = RIGHT(@stringWithTab, LEN(@strWithTab) - 1)

    OR

    SELECT @tabremove = RIGHT(@stringWithTab, LEN(@strWithTab) - LEN(chr(9)))




    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: Where is it best to place "where conditions" in the join or inthe final where statement

    Looking at this query I'm not sure why you don't just use a self join. Maybe I don't know the data very well, but it seems that doing a Not...




    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: Identity on a Insert Select

    Actually I'm removing the URL. After re-reading it the page is more geared for me than you Oh well. As an MS Employee...




    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: CheckSum routine

    If you want to get a checksum against the full table you can do something like the following...

    SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*))

    FROM Foo WITH(NOLOCK)




    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: Schedule a transaction log backup via T-SQL

    If you are using transactions within your script you can simply use the "With Mark" portion of the begin transaction call. This will mark your transaction log for you. You...




    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: Where is it best to place "where conditions" in the join or inthe final where statement

    I've found the same as David. It really depends on the data and how much of it you have!

    BTW: My query above was NOT about a Not Exists query but...




    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: Identity on a Insert Select

    David,

    I would probably still use the approach I posted. I would just use table variables or temp tables as an interim step before doing the actual insert into the main tables....




    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: Trimmimg off trailing tab charater

    Sorry Peter but if you have Latin1_General_Bin as your default database collation that is not the case. I just ran the following to test it.

    DECLARE @vTest nvarchar(255)

    SET @vTest = 'string with...




    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: Backup and Restoring from several different sources

    Angela, You're right. Although I've never much worried about changing the logical filenames. I just always create the copied db on the fly and change the physical filename. In fact...




    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: Stored Procedure Changes

    I made a stored procedure a while ago to do this. Unfortunately I can't post it here. What I did was to take the sp_helptext sql (IN QA execute sp_helptext...




    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: Building a series of strings while in a cursor or while loop

    demicoq,

    I noticed that you were using the name sp_name for your stored procedure. I would highly suggest you don't use sp_ as a prefix to your stored procedures!

    FROM SQL...




    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: Trimmimg off trailing tab charater

    After your statement for the concatenation do something like the following...

    SET @concatstring = LEFT(@concatstring , LEN(@concatstring ) - LEN(char(9)))




    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: using nvarchar & ntext datatypes

    Anytime you expect to have unicode characters you need to use the N.

    IE:

    DECLARE @v-2 nvarchar(255)

    DECLARE @t TABLE

        (

        strWord nvarchar(255)

        )

    SET @v-2 = N'?'

    INSERT INTO @t

    VALUES(@v)

    SELECT * FROM...




    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: Identity on a Insert Select

    Ummm I think what you want would be something like this...

    DECLARE @iMin int

        , @iMax int

    DECLARE @t TABLE

        (

        intID    int    identity(1,1)

        , value nvarchar(255)

        )

    DECLARE @t2 TABLE

       ...




    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: backup MSSQL database remotely?

    I too would work with the sysadmin and make sure that they have daily/hourly backups as needed to keep your production data safe. I would also work with them to...




    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 - 76 through 90 (of 498 total)