Forum Replies Created

Viewing 15 posts - 1 through 15 (of 28 total)

  • RE: Extracting data with headers using PowerShell

    muthyala_51 (6/3/2014)


    Can the script.sql file can have a select statement with joins? or this can be only used to export for just plain tables?

    There is no restriction on what SQL...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Extracting data with headers using PowerShell

    it.ma (6/3/2014)


    tried the same. (with master.sql in the same directory as .ps1 script)

    It says

    "You cannot call a method on a null-valued expression.

    Line:16 / Char:18

    +$ds = $server.Databases[$database].ExecuteWithResults("$(Echo $1.OpenText().ReadToEnd())")

    +

    + CategoryInfo :...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Extracting data with headers using PowerShell

    Jeff Moden (6/3/2014)


    @louis Li,

    I realize that $dt is a loop variable but what did you intend that "dt" stand for? I'd also like to know why the use of...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Extracting data with headers using PowerShell

    sql_er (6/3/2014)


    Will it properly extract .csv file and show in excel if some columns are nvarchar and contain data in Russian for example?

    One good way to find out is to...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Extracting data with headers using PowerShell

    it.ma (6/3/2014)


    where do we need to keep this master.sql script file? same directory where the PowerShell script resides?

    Yes, same directory.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Creating Memory-Optimized Tables

    Submitted.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Exporting data with header using Powershell

    swebster (4/28/2014)


    I really wish I understood what this script is doing. To me, the article assumes the reader already knows a lot of what is being referred to.

    I can write...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Creating Memory-Optimized Tables

    I will take this one.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Export with Headers

    Steve Jones - SSC Editor (4/8/2014)


    Louis Li (4/7/2014)


    Submitted.

    Louis, I see a script from you and that's good, but I'm still looking for an article with explanation of how to do...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Export with Headers

    Sure, Steve.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: Export with Headers

    Submitted.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    The result returns tables and all indexes, you see multiple rows of same table because these tables have indexes created on them. They are not related to fragmentation or operation...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    First line of this script should be

    SELECT

    Add SELECT as your first line, anything else seems OK.

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    Carolyn S. White (1/20/2014)


    I literally copied and pasted the code verbatim from your post as a new query on the database I wanted to get the results on.

    Does it work...

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

  • RE: List table space usage and row counts

    Can you copy / paste the script from your SSMS here?

    ----------------------------------------------------------------------------------------------
    Microsoft Certified Solution Master: Data Platform, Microsoft Certified Trainer
    Email: Louis.Li@rrlminc.com | Blog[/url] | LinkedIn[/url]

Viewing 15 posts - 1 through 15 (of 28 total)