Forum Replies Created

Viewing 15 posts - 136 through 150 (of 486 total)

  • RE: Copy Database

    The text file is relative to the server, not your machine. So C:\Output.txt will be on the server's C:, not yours.

    I have found that the copy database feature generally works...

  • RE: Usages for Powershell

    Only a problem insofar as you have to actually know that the info is in HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\BackupDirectory, as opposed to simply asking for the server object for it's default backup folder.

  • RE: implementing backup system using PS (a newbie question)

    Here's the basic script I use to backup all DBs in each SQL Server instance on a machine, except tempdb.

    This is saved as a Powershell.ps1 script, and run via...

  • RE: Usages for Powershell

    When I need to create a new instance of our application's DB on several servers, nothing beats PoSh.

    I have a script which:

    restores to a new db from the current base...

  • RE: Use cursor to run dynamic SQL to find special characters used in database

    Scott,

    I'm curious as well as to what the SQL would be to handle all columns at once.

    Been thinking about it -- not too hard -- and coming up...

  • RE: Insert subset of self-referencing table into that table

    Although that does work nicely in the scenario I presented, that won't work in for my real-life case: there are other inserts into identity tables earlier in the procedure.

    I should...

  • RE: Insert subset of self-referencing table into that table

    Hmm not quite: let's say there are x groups, and the parents' ids aren't always sequential.

  • RE: Validating T-SQL

    Very clever.

    Thanks again!

    P

  • RE: Validating T-SQL

    That's working in the back-end Eirikur, thank you!!

    I have to dump the empty result set into a #tmp table so the front-end doesn't puke, but that's a minor detail.

  • RE: Validating T-SQL

    Eirikur,

    This is select @@version:

    Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) Jun 28 2012 08:36:30 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows...

  • RE: Validating T-SQL

    DECLARE @code varchar(max)

    SET @code = 'SELECT * from FROM sys.tables';

    BEGIN TRY

    EXEC ('SET PARSEONLY ON; ' + @code + '; SET PARSEONLY OFF;')

    SELECT 'Success'

    END TRY

    BEGIN CATCH

    SELECT 'Error'

    END CATCH

    This correctly gets...

  • RE: Validating T-SQL

    Thanks for the reply Sigerson,

    What I'm actually after is a T-SQL procedure or function to which I can pass the variable containing the generated code...

    I tried a roll-your-own proc which...

  • RE: xp_cmdshell issues

    One more question:

    Let's assume I go with the certificate method.

    Each night, we do database transfers to various target servers, using smo.Transfer.

    Does the certificate/permissions granted by the cert travel...

  • RE: xp_cmdshell issues

    My apologies Emil, you are correct.

    In fact, Erland's article also covers the Execute As scenario. But I am looking at the Certificates section.

Viewing 15 posts - 136 through 150 (of 486 total)