Forum Replies Created

Viewing 15 posts - 61 through 75 (of 498 total)

  • RE: Cursor declaration.....

    Lars,

    An even better way to declare the cursor would be to use a local variable.

    DECLARE @c1 CURSOR

    SET @c1 = CURSOR FOR...

    Everything else is the same but you have now limited...




    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: Foreign Key Name

    Steve, this is actually in SQL Books Online under Alter Table. It is as follows...

    Syntax

    ALTER TABLE table

    <SNIP>

    < table_constraint > ::=

        [ CONSTRAINT constraint_name ]

        { [ {...




    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: CREATE VIEW doesnt like a join to another DB?

    As Bill stated it looks like the problem is with creating the view in a different database than your current database. So what you need to do is shell out 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.

  • RE: "Copy" a record

    Use a simple Insert statement that selects the old record and puts the new values in as variables...

     

    INSERT INTO Foo(fldlist)

    SELECT @var1, @var2, fldlist FROM Foo WHERE ....




    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: Running a SQL Query from QA

    Cynthia,

    Since you are coming from an Access ADP I would think what you really need to do is create a stored procedure to do this and then call it 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: Need Help removing leading tab

    We actually have a field where we store formatted XML. This usually has quite a few tabs in it. I was handed the db design when I got here. 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: Database migration to Unicode

    Sheetal,

    Can you post some samples that we might be able to see what you are having problems with?

    Basically what I have found is that if your default database collation...




    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 of a single table

    The simple answer is NO. The more detailed answer is that it can be done if you place the table in it's own file group and then just backup 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: system SP - table data needed (column names & datatypes)

    Matt,

    If you open SQL Server Books Online (IE: Sql servers version of help) and put "system stored procedures, listed" in the Index you will get all the publically listed system...




    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 do I make a case-sensitive query?

    Greg another way would be to use the COLLATE clause on your field.

    SELECT I_use COLLATE Latin1_General_Bin

        , COUNT(I_use COLLATE Latin1_General_Bin)

    FROM #t

    OR Better yet when you create your temp table just...




    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: order by w/ NULL at bottom

    I typically cheat a bit and use the ISNULL to replace the nulls with all Z's

    SELECT fld

    FROM Foo

    ORDER BY ISNULL(fld,'zzzzzzzz')

     




    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: Detecting if UniqueIdentifier

    Since the uniqueidentifiers always have the same format you should be able to use that to quickly look up those values.

    IF EXISTS(SELECT * FROM tempdb..sysobjects WHERE id = object_id('tempdb..#Test'))

        DROP...




    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: Need Help removing leading tab

    I chose not to use replace as there may be other places that have valid tabs. Replace is certainly good if you know the data only has the tab as...




    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: Trying to import a text file via a trigger

    Basically what I would do in this situation is to create a JobRequest table that holds the information needed to call the SP that does the bulk insert. Then in...




    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: Update Help

    Is the last character of the string always what you want at the beginning? If so try something like the following.

    UPDATE Foo

    SET fld = RIGHT(fld,1) + LEFT(REPLACE(fld,'-',''), LEN(REPLACE(fld,'-',''))-1)

    I don't have...




    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 - 61 through 75 (of 498 total)