Forum Replies Created

Viewing 15 posts - 466 through 480 (of 498 total)

  • RE: Brain not working!

    Put a print statement in the place of your execute statement and it becomes obvious... 🙂 You've got an extra space between the server name the and colon in your...




    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: Introduction to ADO - The Command Object

    erichner,

    Rather than using the

    SET ADOprm = ocommand.CreateParameter(sParmName2, adNumeric, adParamInput)

    Try

    SET ADOPrm = ocommand.CreateParameter (sParmName2)

    ADOPrm.Type = ADNumeric

    ADOPrm.Size = 17

    ADOPrm.Precision = 9 'Note: I could be wrong on this as I'm...




    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: Creating view on remote database

    Try using xp_cmdshell and osql to log into the remote db with your sql command.

    Gary Johnson

    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: OpenDataSource to export to a text file

    I've never had any luck using opendatasource with a text file. I've used it a lot with xls files for importing but not exporting. Can you show us your code...




    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: count the number of data/rows entered

    Hmmm, If all your inserts are done through a Stored Procedure you could use the @@ROWCOUNT after each insert and update a logging table with the amount.

    another way would...




    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: Dynamic SQL in cursor

    Another way is to not use a cursor but instead create a temp table with an IDENTITY column and use a while loop using the identity column to get 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: OpenDataSource problem

    I've had the same problem. What's more is that the UNC path seems to work if the file is on the local machine but once you move to a different...




    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: XML from Hierachical Parent/Child table?

    I think you are correct about using FOR XML EXPLICIT. Be warned that it is a big pain to maintain though! BOL actually has a pretty good example on how...




    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: Another Disaster (Almost)

    All I can say is OUCH!

    I'm sitting here thinking that I sure better go back over my disaster recovery plan again and make another dry run to make sure I...




    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: Users lost permission on restored Databases

    In a situation like you are talking about I think I would create a table to hold the user login and role they belong to for each database. Then simply...




    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 Terminates unexpectedly when cursor called.

    As long as you only want to return 1 record I would use TOP. If you have a situation where you need to use a variable to set the number...




    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_insert problem

    Can you give us the insert statement and explain a little more about what you are doing? And why?

    Basically if your insert statement doesn't explicitly define the fields that may...




    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: Reduce Log File Size

    Take a look at Backup Log <log name> with truncate_only in Books Online. It may do what you want to truncate the log file. You should try to 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: Replicating views and stored procedures

    Change from double quotes to single quotes. Your syntax should be

    col1 + '-' + col2 + '-' + col3 as CombinedField

    Note that I didn't put quotes around the field...




    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 to invoke a job

    Try something like:

    EXEC msdb..sp_start_job @job_name = @JobName

    Gary Johnson

    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.

Viewing 15 posts - 466 through 480 (of 498 total)