May 2014 Entries

SQL Server: How do I generate the table schema and populate it with inserts in a script?
In SSMS, there's a Generate Script utility (read: only available under version 2008 and up) . Here are the steps you would need to take to make use of the utility: Right click on the database you're interested in and go to Tasks -> Generate ScriptsSelect the tables and/or any other objects you'd like in order to get them into the script.Navigate to Set scripting options. Click on Advanced.Under the General category, navigate to Type of data to scriptSelect the Schema and Data option to get the ......

Posted On Tuesday, May 20, 2014 5:46 PM | Comments (0)

How do I find the largest files on my disk (storage)?
Here's an example using forfiles to scan your storage. This command line will look for files over 200mb on the C:\ drive after 1/1/2014.

forfiles /P C:\ /M *.* /S /D +"01/01/2014"  /C "cmd /c if @fsize gtr 209715200 echo @path @fsize @fdate @ftime"

For more information, check out Microsoft's examples and syntax page:

http://technet.microsoft.com/en-us/library/cc753551.aspx

Posted On Tuesday, May 6, 2014 10:06 AM | Comments (0)