Error on SQL Query (UPDATE) - Error varchar
I'm trying to execute a query on SQL Server:
UPDATE Clientes
SET CodigoCanal = IdDelegacion
WHERE (CodigoEmpresa = '1')
It is very simple, really. It's just to copy column A on column B (CodigoCanal and IdDelegacion).
But it gives me this error:
la conversion del tipo de datos varchar en datetime produjo un valor fuera del intervalo
The conversion of the varchar data type into datetime produced a value outside the range
UPDATE:
I add pictures of both column's properties:
First column
Second Column
sql sql-server
|
show 7 more comments
I'm trying to execute a query on SQL Server:
UPDATE Clientes
SET CodigoCanal = IdDelegacion
WHERE (CodigoEmpresa = '1')
It is very simple, really. It's just to copy column A on column B (CodigoCanal and IdDelegacion).
But it gives me this error:
la conversion del tipo de datos varchar en datetime produjo un valor fuera del intervalo
The conversion of the varchar data type into datetime produced a value outside the range
UPDATE:
I add pictures of both column's properties:
First column
Second Column
sql sql-server
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
Please post the definition for theClientes
table.
– Tim Biegeleisen
Nov 16 '18 at 11:29
1
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
1
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
2
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35
|
show 7 more comments
I'm trying to execute a query on SQL Server:
UPDATE Clientes
SET CodigoCanal = IdDelegacion
WHERE (CodigoEmpresa = '1')
It is very simple, really. It's just to copy column A on column B (CodigoCanal and IdDelegacion).
But it gives me this error:
la conversion del tipo de datos varchar en datetime produjo un valor fuera del intervalo
The conversion of the varchar data type into datetime produced a value outside the range
UPDATE:
I add pictures of both column's properties:
First column
Second Column
sql sql-server
I'm trying to execute a query on SQL Server:
UPDATE Clientes
SET CodigoCanal = IdDelegacion
WHERE (CodigoEmpresa = '1')
It is very simple, really. It's just to copy column A on column B (CodigoCanal and IdDelegacion).
But it gives me this error:
la conversion del tipo de datos varchar en datetime produjo un valor fuera del intervalo
The conversion of the varchar data type into datetime produced a value outside the range
UPDATE:
I add pictures of both column's properties:
First column
Second Column
sql sql-server
sql sql-server
edited Nov 16 '18 at 13:55
karel
2,28872732
2,28872732
asked Nov 16 '18 at 11:26
Albert SunyerAlbert Sunyer
143
143
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
Please post the definition for theClientes
table.
– Tim Biegeleisen
Nov 16 '18 at 11:29
1
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
1
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
2
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35
|
show 7 more comments
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
Please post the definition for theClientes
table.
– Tim Biegeleisen
Nov 16 '18 at 11:29
1
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
1
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
2
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
Please post the definition for the
Clientes
table.– Tim Biegeleisen
Nov 16 '18 at 11:29
Please post the definition for the
Clientes
table.– Tim Biegeleisen
Nov 16 '18 at 11:29
1
1
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
1
1
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
2
2
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35
|
show 7 more comments
3 Answers
3
active
oldest
votes
Data tipes of your columns doesn't match. It looks like CordigoCanal is datetime and IdDelegacion varchar.
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
add a comment |
The error message indicates that you are using a datetime datatype at some point.
Looking at the definition of your columns CodigoCanal and IdDelegacion those are of type varchar. The only columns that might have the datetime data type are:
- Columns used in a trigger, as Dan Guzman mentioned
- The CodigoEmpresa column (you did not post the definition here)
add a comment |
All right.
I've checked on triggers, and there was 2 of them enabled.
I disabled them, ran the query and then enabled again ;)
Thank you for all your help!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
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%2fstackoverflow.com%2fquestions%2f53336950%2ferror-on-sql-query-update-error-varchar%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Data tipes of your columns doesn't match. It looks like CordigoCanal is datetime and IdDelegacion varchar.
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
add a comment |
Data tipes of your columns doesn't match. It looks like CordigoCanal is datetime and IdDelegacion varchar.
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
add a comment |
Data tipes of your columns doesn't match. It looks like CordigoCanal is datetime and IdDelegacion varchar.
Data tipes of your columns doesn't match. It looks like CordigoCanal is datetime and IdDelegacion varchar.
answered Nov 16 '18 at 11:32
misobabmisobab
11
11
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
add a comment |
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
Please, see pictures attached on post
– Albert Sunyer
Nov 16 '18 at 11:36
add a comment |
The error message indicates that you are using a datetime datatype at some point.
Looking at the definition of your columns CodigoCanal and IdDelegacion those are of type varchar. The only columns that might have the datetime data type are:
- Columns used in a trigger, as Dan Guzman mentioned
- The CodigoEmpresa column (you did not post the definition here)
add a comment |
The error message indicates that you are using a datetime datatype at some point.
Looking at the definition of your columns CodigoCanal and IdDelegacion those are of type varchar. The only columns that might have the datetime data type are:
- Columns used in a trigger, as Dan Guzman mentioned
- The CodigoEmpresa column (you did not post the definition here)
add a comment |
The error message indicates that you are using a datetime datatype at some point.
Looking at the definition of your columns CodigoCanal and IdDelegacion those are of type varchar. The only columns that might have the datetime data type are:
- Columns used in a trigger, as Dan Guzman mentioned
- The CodigoEmpresa column (you did not post the definition here)
The error message indicates that you are using a datetime datatype at some point.
Looking at the definition of your columns CodigoCanal and IdDelegacion those are of type varchar. The only columns that might have the datetime data type are:
- Columns used in a trigger, as Dan Guzman mentioned
- The CodigoEmpresa column (you did not post the definition here)
answered Nov 16 '18 at 11:49
cpt_doodcpt_dood
2116
2116
add a comment |
add a comment |
All right.
I've checked on triggers, and there was 2 of them enabled.
I disabled them, ran the query and then enabled again ;)
Thank you for all your help!
add a comment |
All right.
I've checked on triggers, and there was 2 of them enabled.
I disabled them, ran the query and then enabled again ;)
Thank you for all your help!
add a comment |
All right.
I've checked on triggers, and there was 2 of them enabled.
I disabled them, ran the query and then enabled again ;)
Thank you for all your help!
All right.
I've checked on triggers, and there was 2 of them enabled.
I disabled them, ran the query and then enabled again ;)
Thank you for all your help!
answered Nov 16 '18 at 15:22
Albert SunyerAlbert Sunyer
143
143
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f53336950%2ferror-on-sql-query-update-error-varchar%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
It would be great if you could provide the error message in english..
– holder
Nov 16 '18 at 11:28
Please post the definition for the
Clientes
table.– Tim Biegeleisen
Nov 16 '18 at 11:29
1
looks like CodigoCanal is a date data type and IdDelegacion is a varchar, IdDelegacion has a value in it that cannot be implicitly converted to a date
– RegBes
Nov 16 '18 at 11:31
1
Hi! This is message in english: the conversion of the varchar data type into datetime produced a value outside the range @holder
– Albert Sunyer
Nov 16 '18 at 11:32
2
@AlbertSunyer, if both columns are varchar, it is likely there's an update trigger on the table which is causing the error.
– Dan Guzman
Nov 16 '18 at 11:35