Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6712031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:12:42+00:00 2026-05-26T08:12:42+00:00

I am using SQL Server 2008 and have a hashtable which contains data about

  • 0

I am using SQL Server 2008 and have a hashtable which contains data about postcode and its related data. If I take the count of records groupby postcode its like this

5000 HA
6000 NW
4000 S2

I would like to know is there any way of devidng the data into three separate tables.
if we running the first set of records which is HA
which will look like

Table1               Table2                   Table3
1st record of HA     2nd record of HA       3rd record of HA
4th record of HA     ....etc

is it possible to achieve using cursor or any suggestion?

Any help will be appreciate

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:12:43+00:00Added an answer on May 26, 2026 at 8:12 am

    I can’t imagine any possible reason why I would do such a thing. Dividing up into 3 tables will make the data much harder to query later. But if you’re stuck with it then I would do something along the lines of this:

    BUild a mapping table with three columns A, B, C. Populate the table withthe values you want to go in each table. Shoulf look simliar to this, but woudl go out the the max value you will need.

    A   B   C
    1   2   3
    4   5   6
    7   8   9
    10  11  12
    

    Create a temp table using row_number over (don’t forget to order by) to so that you can now tell which record is the first HA and which is the second etc. Now do 3 inserts joining on the number you generated to each column inteh mapping table. If they join to column A insert to tableA, Column B, insert totable B, colmn c insert to table c.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQL Server 2008. I have a Student table in which there
I am using SQL Server 2008. I have tables on which there are duplicate
I'm using SQL Server 2008 R2. I have a source table of data (I_Vendor)
I have been using SQL Server 2008 for about a year now and my
I am using sql server 2008 rc2 and I have a question about naming
I am using SQL Server 2008 R2. I have a table which has several
I am using SQL Server 2008 Enterprise. I have yearly customer data from 2000
I am using SQL Server 2008. I have an INSERT statement which inserts a
Using SQL Server 2008. I have a stored proc which has start and end
I have been using SQL Server 2008 for about a year now and my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.