Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

14 November 2006

SQL Procedure to script your data

Sometimes you need to insert a few records from a table into another table or another database. Here's the solution: http://vyaskn.tripod.com/code.htm#inserts

SQL Server file locations

In MS SQL Server you can get an overview of all database file locations using the 'sysfiles' table. In combination with the stored procedure 'sp_msforeachdb' (which will loop through the databases) you can get a list of all database files used by the SQL Server instance.

USE master
EXEC sp_msforeachdb 'use ? SELECT ''?'' as dbname, filename FROM sysfiles'