Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

30 July 2016

Fill Data To a Different Table Database

Sometimes we have to be able to fill the data in a different database tables. For example, the data in the table in the database that is now being used accidentally deleted, this is one of the terrible things that could happen to a programmer, to overcome it we can use the database backup to restore the data, although not all data can be restored , but a minimum of 90% or 95% of the data can be restored if we have a database backup, but otherwise it would be difficult to overcome, or even can not be at all: D. 

To fill the data in different tables database in Sql Server 2008, code is essentially as follows: 

Insert Into [database name]. [Dbo]. [Table Name] 
Select * From [database name]. [Dbo]. [ The table name] 

Example: 
Insert Into RunningDatabase.dbo.Patient 
Select * From BackupDatabase.dbo.Patient

29 July 2016

How To Execute a Stored Procedure in Sql Server 2008

Sometimes there are moments when we have to reexecute a Stored Procedure in SQL Server, for example due to an error on the line before the Stored Procedure executed that causes the data that should be inserted through the Stored Procedure be entered. Let's say this happened in the case which led to the registration module registration fails. One way to do this is by executing back Stored Procedure that have not been executed, but of course before must be identified first Stored Procedures are not being executed. The easiest way to execute a Stored Procedure is to use strored Execute feature in SQL Server Management Studio.

1. Right-click in the Object Explorer, select Execute Stored Procedure



2. Fill in the value for each parameter.


3. Click OK, SQL Server Management stuido will immediately generate the code to execute Stored Procedures complete with pre-loaded parameter value already filled out before us and the code will be directly executed

Pengumuman