Search This Blog

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

Monday, February 4, 2013

SSIS Tutorials with Screenshots

This tutorial of SSIS is very nice. Presented every section with screenshots..

http://www.mssqltips.com/sqlservertutorial/200/sql-server-integration-services-ssis/

Import MDF file into SQL Server Management Studio

1. Open SQL Management Studio Express and log in to the server to which you want to attach the database.
2. In the 'Object Explorer' window, right-click on the 'Databases' folder and select 'Attach...' The 'Attach Databases' window will open.
3. Inside that window click 'Add...' and then navigate to your .MDF file and click 'OK'.
4. Click 'OK' once more to finish attaching the database and you are done.

The database should be available for use.

NOTE: Pleate take a backup of the *.mdf file before you import. This is because, if you import an MDF file from SQL Server 2000 into SQL Server 2005, for example. There is no way you can reattach the file to the earlier version of SQL Server.

Wednesday, August 29, 2012

Import a package by Using SQL Server Management Studio

  1. Click Start, point to Microsoft SQL Server, and then click SQL Server Management Studio.
  2. In the Connect to Server dialog box set the following options:
    • In the Server type box, select Integration Services.
    • In the Server name box, provide a server name or click <Browse for more…> and locate the server to use.
  3. If Object Explorer is not open, on the View menu, click Object Explorer.
  4. In Object Explorer, expand the Stored Packages folder.
  5. Expand the subfolders to locate the folder into which you want to import a package.
  6. Right-click the folder, click Import Package. and then do one of the following:
    • To import from an instance of SQL Server, select the SQL Server option, and then specify the server and select the authentication mode. If you select SQL Server Authentication, provide a user name and a password.
      Click the browse button (…), select the package to import, and then click OK.
    • To import from the file system, select the File system option.
      Click the browse button (…), select the package to import, and then click Open.
    • To import from the SSIS Package Store, select the SSIS Package Store option and specify the server.
      Click the browse button (…), select the package to import, and then click OK.
  7. Optionally, update the package name.
  8. To update the protection level of the package, click the browse button (…) and choose a different protection level by using the Package Protection Level dialog box. If the Encrypt sensitive data with password or the Encrypt all data with password option is selected, type and confirm a password.
  9. Click OK to complete the import.

 Source: http://msdn.microsoft.com/en-us/library/ms141235%28v=sql.105%29.aspx

Export an SSIS package by Using SQL Server Management Studio

  1. Click Start, point to Microsoft SQL Server, and then click SQL Server Management Studio.
  2. In the Connect to Server dialog box, set the following options:
    • In the Server type box, select Integration Services.
    • In the Server name box, provide a server name or click <Browse for more…> and locate the server to use.
  3. If Object Explorer is not open, on the View menu, click Object Explorer.
  4. In Object Explorer, expand the Stored Packages folder.
  5. Expand the subfolders to locate the package you want to export.
  6. Right-click the package, click Export, and then do one of the following:
    • To export to an instance of SQL Server, select the SQL Server option, and then specify the server and select the authentication mode. If you select SQL Server Authentication, provide a user name and a password.
      Click the browse button (…), and expand the SSIS Packages folder to locate the folder to which you want to save the package. Optionally, update the default name of the package, and then click OK.
    • To export to the file system, select the File System option.
      Click the browse button (…) to locate the folder to which you want to export the package, type the name of the package file, and then click Save.
    • To export to the SSIS package store, select the SSIS Package Store option, and specify the server.
      Click the browse button (…), expand the SSIS Packages folder, and select the folder to which you want to save the package. Optionally, enter a new name for the package in the Package Name text box. Click OK.
  7. To update the protection level of the package, click the browse button (…) and choose a different protection level by using the Package Protection Level dialog box. If the Encrypt sensitive data with password or the Encrypt all data with password option is selected, type and confirm a password.
  8. Click OK to complete the export.
 Source: http://msdn.microsoft.com/en-us/library/ms141235%28v=sql.105%29.aspx

MS SQL Server Basic Queries

1. List all the database objects 
Select * from Sysobjects
The list of all of the possible values for the xtype column in the sysobjects table of a SQL Server database:
  • C - CHECK constraint
  • D - Default or DEFAULT constraint
  • F - FOREIGN KEY constraint
  • L - Log
  • P - Stored procedure
  • PK - PRIMARY KEY constraint
  • RF - Replication filter stored procedure
  • S - System table
  • TR - Trigger
  • U - User table
  • UQ - UNIQUE constraint
  • V - View
  • X - Extended stored procedure
2. List all the columns on the database

Select * from syscolumns