Forum Replies Created

Viewing 15 posts - 466 through 480 (of 497 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...

  • 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...

  • 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

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • RE: How to invoke a job

    Try something like:

    EXEC msdb..sp_start_job @job_name = @JobName

    Gary Johnson

    DBA

    Sr. DB Engineer

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