Wednesday, November 29, 2017

Copy Data from One Table to Another Table and insert values


There are multiple ways to do this.

1) INSERT INTO SELECT
This method is used when table is already created in the database earlier and data have to be inserted into this table from another table. If columns listed in the INSERT clause and SELECT clause are same, listing them is not required.

INSERT INTO table-name (column-names)
SELECT column-names 
FROM table-name
WHERE condition


2) SELECT INTO
This method is used when table is not created earlier and it needs to be created when data from one table must be inserted into a newly created table from another table. The new table is created using the same data types as those in selected columns.

select * into dbo.CopyTo from dbo.CopyFrom


3) INSERT BY VALUE
By using a values clause to specify the data values for one row.
          INSERT INTO MyTable (Column1, Column2)
              VALUES (‘Column1Value’, Column2 Value.')

3 comments:

  1. Data is the business asset for any organisation which is audited and protected. To gain in their business, it is become very urgent for every organization to choose few good predictive data models and validates them using test data before figuring out an operationalization plan for the model to be deployed to production so that applications can consume it.
    Artificial intelligence with SQL Server

    ReplyDelete
  2. Selling USA FRESH SPAMMED SSN Leads/Fullz, along with Driving License/ID Number with EXCELLENT connectivity.

    **PRICE**
    >>2$ FOR EACH LEAD/FULLZ/PROFILE
    >>5$ FOR EACH PREMIUM LEAD/FULLZ/PROFILE

    **DETAILS IN EACH LEAD/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER WITH EXPIRY DATE
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL, I.P ADDRESS
    ->EMPLOYEE DETAILS
    ->REALTIONSHIP DETAILS
    ->MORTGAGE INFO
    ->BANK ACCOUNT DETAILS

    >All Leads are Tested & Verified.
    >Invalid info found, will be replaced.
    >Serious buyers will be welcome & I will give discounts for bulk orders.
    >Fresh spammed data of USA Credit Bureau
    >Good credit Scores, 700 minimum scores
    >Bulk order will be preferable
    >Minimum order 20 leads/fullz
    >Hope for the long term business
    >You can asked for samples, specific states & zips (if needed)
    >Payment mode BTC, PAYPAL & PERFECT MONEY

    Email > leads.sellers1212@gmail.com
    Telegram > @leadsupplier
    ICQ > 752822040

    ''OTHER GADGETS PROVIDING''

    >SSN Fullz
    >Dead Fullz
    >Carding Tutorials
    >Hacking Tutorials
    >SMTP Linux Root
    >DUMPS with pins track 1 and 2
    >Sock Tools
    >Server I.P's
    >USA emails with passwords (bulk order preferable)

    **Contact 24/7**

    Email > leads.sellers1212@gmail.com
    Telegram > @leadsupplier
    ICQ > 752822040

    ReplyDelete

SQL Script to list out name of tables and its records in the database

SET NOCOUNT ON  DBCC UPDATEUSAGE(0)  -- DB size. EXEC sp_spaceused -- Table row counts and sizes. CREATE TABLE #temptable  (      [name] NVA...