473,667 Members | 2,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regarding insertion of records

1 New Member
Hi,

While inserting records in the table, is there any way we can change the order in which we insert the records.

Eg: Say i have 3 columns in a table, while inserting the records can i make the system such that rather than inserting the records in a first come first serve basis they are inserted based on ascending or descending order of any column value.
Mar 28 '07 #1
3 1385
205210864
11 New Member
you can try inserting data implicitly


example; insert into emp(name,surnam e)
values('john',' james')
where.......

by including the column names in the insert ststement you can control what column gets its value inserted first that means, if name is first as it is it gets its value first or if surname is first it gets its value first.
Mar 29 '07 #2
rushdishams
24 New Member
just clarifying the previous answer-

if you have table called name with fields firstname, surname then if you just make the following querie-

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO name (firstname, surname) values ('Rushdi', 'Shams');
  2.  
it will give you the same functionality as the following one-


Expand|Select|Wrap|Line Numbers
  1. INSERT INTO name (surname, firstname) values ('Shams, 'Rushdi');
  2.  
Cheers!
Mar 29 '07 #3
debasisdas
8,127 Recognized Expert Expert
Hi,
asper the basic ruleof RDBMS the physical position is not at all important.
While inserting records in the table, there can be several way you can change the order in which you insert the records.
the only thing is that the order of the columns ans there corresponding values should match thats all
Apr 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1946
by: narasimha | last post by:
Hello, I have a data record with two fields...<value, date>. I have more than a million of these records. As I add more records into this set, I want a data structure that would be efficient enough to find duplicate records with the same value, and earliest possible date. It should be efficient to insert the records into the data structure. Is there any database structure that I can get help with ?? -Narasimha
20
3858
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in a named namespace namespace foo { class Foo
10
2724
by: Anton.Nikiforov | last post by:
Dear all, i have a problem with insertion data and running post insert trigger on it. Preambula: there is a table named raw: ipsrc | cidr ipdst | cidr bytes | bigint time | timestamp Triggers:
3
2015
by: Sunny | last post by:
Hi All, I am working on a Data Project, that involves records (rows) to be inserted from a Table in one database to an exactly similar table in another database. The table names and all field names and values are exactly same. I am looking for Mass insertions or should i say, the easiest way to insert these records. What are my options? i don't want to use the individual OleDbCommand insert statements since that is a rather slow process. Also...
0
3843
by: polocar | last post by:
Hi, I have noticed a strange behaviour of CurrencyManager objects in C# (I use Visual Studio 2005 Professional Edition). Suppose that you have a SQL Server database with 2 tables called "Cities" and "Persons", and that: "Cities" has 2 fields called "IDCity" and "NameCity" "Persons" has 3 fields called "IDPerson", "NamePerson" and "IDCityAddress" with "IDCity" and "IDCityAddress" fields relationed with the classical father-child relation...
1
2180
by: =?Utf-8?B?TWljaGFlbCBCbHVtZW50aGFsLCBNQ1NFLCBNQ0FE | last post by:
I am writing a .NET 1.1 C# windows service that writes to a dedicated event log (not the application event log, but one that I created). I want to make full use of all the fields in an event log record - category, event ID, etc. I would like to make use of a message file as well. I have created a message file DLL per the instructions at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wes/wes/sample_message_text_file.asp...
4
2856
by: vfpuglia | last post by:
Hi, Lets get it out there... I'm a newbie to javascript. I'm trying to build a string for the external source file destination and be able to change the keywords in the string based on what the user presses/inputs. So here is what I have so far <script>
3
1691
by: dilippanda | last post by:
Hi All, I am experiencing performance issue while merging records from a select query. Also it is getting difficult to insert 100000 selected records into table which is taking around 30 mins. I have tested the select query which is taking around 40 sec to fetch 1Lakh records. Is there anyway to improve the insertion rate? Thanks,
13
1919
by: prasadmpatil | last post by:
I am new STL programming. I have a query regarding vectors. If I am iterating over a vector using a iterator, but do some operations that modify the size of the vector. Will the iterator recognize this? I wrote the following program to test this out. #include <fstream> #include <iostream> #include <string>
0
8458
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8366
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8565
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.