Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

How to script out data from a table with Powershell

$
0
0

Hi,

I have few lookup tables I need to script data for in order to rebuild an empty database.  I've already developed the scripts for the database schema.

For example I have a table User:

UserId, UserName, Department

1, John Smith, IT

2, Peter Donald, Accounting

...

I need to build a script:

 

insert into User(UserId, UserName, Department) values (1, 'John Smith', 'IT')

insert into User(UserId, UserName, Department) values (2, 'Peter Donald', Accounting')

...

Thanks.

 

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles