Reset Column Header IndexExporting from SQL Server 2005 for import into ER Studio 9.0Why does Management Studio not automatically create FK column in the parent table?Header and line item data source mismatchIndex will be removedChanging an nvarchar column to datetimeCode required to make column not nullableColumn Name in separate table SQL ServerTwo SQL Server databases share the same MDF and LDF files but have different datajoin two tables, include one row from the parent table for each primary keySQL don't display ORDER BY column
Do I care if the housing market has gone up or down, if I'm moving from one house to another?
Can a creature sustain itself by eating its own severed body parts?
What is the best word describing the nature of expiring in a short amount of time, connoting "losing public attention"?
What are "the high ends of castles" called?
Killing a star safely
Is there an English word to describe when a sound "protrudes"?
Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?
What kind of vegetable has pink and white concentric rings?
Why Lie algebras if what we care about in physics are groups?
Is it ethical to tell my teaching assistant that I like him?
1025th term of the given sequence.
is FIND WORDS in P?
Reissue US, UK, Canada visas in stolen passports
Plotting maxima within a simplex
Why do we need an estimator to be consistent?
Book in which the "mountain" in the distance was a hole in the flat world
Can the caster of Time Stop still use their bonus action or reaction?
What does a Nintendo Game Boy do when turned on without a game cartridge inserted?
Found old paper shares of Motorola Inc that has since been broken up
Can I make Ubuntu 18.04 switch between multiple windows of the program by just clicking the icon?
Count the identical pairs in two lists
Found more old paper shares from broken up companies
Function pointer parameter without asterisk
Is it better to deliver many low-value stories or few high-value stories?
Reset Column Header Index
Exporting from SQL Server 2005 for import into ER Studio 9.0Why does Management Studio not automatically create FK column in the parent table?Header and line item data source mismatchIndex will be removedChanging an nvarchar column to datetimeCode required to make column not nullableColumn Name in separate table SQL ServerTwo SQL Server databases share the same MDF and LDF files but have different datajoin two tables, include one row from the parent table for each primary keySQL don't display ORDER BY column
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I uploaded some tables to SQL Server Management Studio. Upon inspecting the tables I've found that the column headers area actually values. Is there any way to bump the headers down into a new row and to create new column headers, or will I have to re-upload all of the tables and remember to select the 'has header' option?
Thanks.
sql-server
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I uploaded some tables to SQL Server Management Studio. Upon inspecting the tables I've found that the column headers area actually values. Is there any way to bump the headers down into a new row and to create new column headers, or will I have to re-upload all of the tables and remember to select the 'has header' option?
Thanks.
sql-server
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago
add a comment |
I uploaded some tables to SQL Server Management Studio. Upon inspecting the tables I've found that the column headers area actually values. Is there any way to bump the headers down into a new row and to create new column headers, or will I have to re-upload all of the tables and remember to select the 'has header' option?
Thanks.
sql-server
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I uploaded some tables to SQL Server Management Studio. Upon inspecting the tables I've found that the column headers area actually values. Is there any way to bump the headers down into a new row and to create new column headers, or will I have to re-upload all of the tables and remember to select the 'has header' option?
Thanks.
sql-server
sql-server
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
CharlesDCharlesD
233 bronze badges
233 bronze badges
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
CharlesD is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago
add a comment |
1
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago
1
1
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Probably the least complicated option would be to select all your data into a new table with the correct column names, filtering out the row of values containing the header values. From there, you can drop the malformed table, and rename the new one.
Example:
CREATE TABLE dbo.wrongo(wrong INT, [column] INT, names INT);
CREATE TABLE dbo.righto(correct INT, [column] INT, names INT);
INSERT dbo.righto ( correct, [column], names )
SELECT wrong, [column], names
FROM dbo.wrongo
WHERE wrongo.wrong <> 'column name'; --this will throw an error, but you get the idea.
DROP TABLE dbo.wrongo;
EXEC sp_rename 'dbo.righto', 'wrongo', 'OBJECT';
add a comment |
There are two ways you can avoid having values as columns name while loading data from excel source.
- Create the table in the database using the
CREATE TABLEstatement and then upload data using DTS. - Mention column names as the first record in the excel sheet and upload it.
There are other ways too, but these are easier steps.
Thanks!
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "182"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
CharlesD is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f243468%2freset-column-header-index%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Probably the least complicated option would be to select all your data into a new table with the correct column names, filtering out the row of values containing the header values. From there, you can drop the malformed table, and rename the new one.
Example:
CREATE TABLE dbo.wrongo(wrong INT, [column] INT, names INT);
CREATE TABLE dbo.righto(correct INT, [column] INT, names INT);
INSERT dbo.righto ( correct, [column], names )
SELECT wrong, [column], names
FROM dbo.wrongo
WHERE wrongo.wrong <> 'column name'; --this will throw an error, but you get the idea.
DROP TABLE dbo.wrongo;
EXEC sp_rename 'dbo.righto', 'wrongo', 'OBJECT';
add a comment |
Probably the least complicated option would be to select all your data into a new table with the correct column names, filtering out the row of values containing the header values. From there, you can drop the malformed table, and rename the new one.
Example:
CREATE TABLE dbo.wrongo(wrong INT, [column] INT, names INT);
CREATE TABLE dbo.righto(correct INT, [column] INT, names INT);
INSERT dbo.righto ( correct, [column], names )
SELECT wrong, [column], names
FROM dbo.wrongo
WHERE wrongo.wrong <> 'column name'; --this will throw an error, but you get the idea.
DROP TABLE dbo.wrongo;
EXEC sp_rename 'dbo.righto', 'wrongo', 'OBJECT';
add a comment |
Probably the least complicated option would be to select all your data into a new table with the correct column names, filtering out the row of values containing the header values. From there, you can drop the malformed table, and rename the new one.
Example:
CREATE TABLE dbo.wrongo(wrong INT, [column] INT, names INT);
CREATE TABLE dbo.righto(correct INT, [column] INT, names INT);
INSERT dbo.righto ( correct, [column], names )
SELECT wrong, [column], names
FROM dbo.wrongo
WHERE wrongo.wrong <> 'column name'; --this will throw an error, but you get the idea.
DROP TABLE dbo.wrongo;
EXEC sp_rename 'dbo.righto', 'wrongo', 'OBJECT';
Probably the least complicated option would be to select all your data into a new table with the correct column names, filtering out the row of values containing the header values. From there, you can drop the malformed table, and rename the new one.
Example:
CREATE TABLE dbo.wrongo(wrong INT, [column] INT, names INT);
CREATE TABLE dbo.righto(correct INT, [column] INT, names INT);
INSERT dbo.righto ( correct, [column], names )
SELECT wrong, [column], names
FROM dbo.wrongo
WHERE wrongo.wrong <> 'column name'; --this will throw an error, but you get the idea.
DROP TABLE dbo.wrongo;
EXEC sp_rename 'dbo.righto', 'wrongo', 'OBJECT';
answered 8 hours ago
Erik DarlingErik Darling
25.9k13 gold badges79 silver badges128 bronze badges
25.9k13 gold badges79 silver badges128 bronze badges
add a comment |
add a comment |
There are two ways you can avoid having values as columns name while loading data from excel source.
- Create the table in the database using the
CREATE TABLEstatement and then upload data using DTS. - Mention column names as the first record in the excel sheet and upload it.
There are other ways too, but these are easier steps.
Thanks!
add a comment |
There are two ways you can avoid having values as columns name while loading data from excel source.
- Create the table in the database using the
CREATE TABLEstatement and then upload data using DTS. - Mention column names as the first record in the excel sheet and upload it.
There are other ways too, but these are easier steps.
Thanks!
add a comment |
There are two ways you can avoid having values as columns name while loading data from excel source.
- Create the table in the database using the
CREATE TABLEstatement and then upload data using DTS. - Mention column names as the first record in the excel sheet and upload it.
There are other ways too, but these are easier steps.
Thanks!
There are two ways you can avoid having values as columns name while loading data from excel source.
- Create the table in the database using the
CREATE TABLEstatement and then upload data using DTS. - Mention column names as the first record in the excel sheet and upload it.
There are other ways too, but these are easier steps.
Thanks!
answered 8 hours ago
Rajesh RanjanRajesh Ranjan
1,3345 silver badges23 bronze badges
1,3345 silver badges23 bronze badges
add a comment |
add a comment |
CharlesD is a new contributor. Be nice, and check out our Code of Conduct.
CharlesD is a new contributor. Be nice, and check out our Code of Conduct.
CharlesD is a new contributor. Be nice, and check out our Code of Conduct.
CharlesD is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f243468%2freset-column-header-index%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
from what source you uploaded the tables? Excel or CSV?
– Rajesh Ranjan
9 hours ago
Sorry, I should have mentioned that. Excel, it was one sheet with several tabs.
– CharlesD
8 hours ago