i get timestamp.
Is the query below the correct syntax though?
insert into Table (A, A1, A2, A3, A4, A5)
select 'pear',A1, A2, A3, 'XXX', 'YYY', 'default'
from Table
where A=apple
How can you do the above if 'XXX', 'YYY', 'default' does not come from table Table?
When i do:
insert into Table (A, A1, A2, A3, A4, A5)
select 'pear',A1, A2, A3, 'XXX', 'YYY', 'default'
from Table
where A=apple
I get:
Incorrect syntax near the keyword 'default'.
How can you do the above if 'XXX', 'YYY', 'default' does not come from table Table?
Hi,
I need to copy data from one table into the same table but with some different values as well. Also i'm having trouble since row_timestamp cannot be null.
Example: Table has columns A, A1, A2, A3, A4, A5
I need columns A1, A2, A3 to be copied and i also want to insert new values into A4...
I have 2 columns from an excel sheet that is in the order that i want to reorder my table into.
Example:
my current table A:
pat 2
ryan 33
bob 45
chris 6
My excel sheet has the correct sequence:
pat 33
ryan 6
bob 2
chris 45
How can i update my table A so that it matches my excel sheet...
Hi,
I need to convert a date 20091011 to 10/11/2009.
This is how i'm converting it:
convert(varchar,cast(ap.appt_date as dateTime),101) as Date
but my return is 10/11/20
it keeps leaving out the last two numbers of the year.
hum..i guess it will..i was sure i did that previously and i still had duplicates. I guess i didn't go that route because i needed to do a stored procedure with a union and that didn't work.
Hi,
I need a way to eliminate data from table A if it exists in table B. I need to combine these two tables but show their similar data only once..how can i do that?
Example:
Table B data:
john 10/11/2008 book
john 5/10/2008 novel
table A fields:
john 10/11/2008 book
Results...
Thanks for the link, i'll try that. I did think about isnumeric() but wasn't sure if that was what i needed..unfortunately i can't change the database architecture :(
Hi,
How can I only select numeric data from a varchar field that consists of both numeric and string data?
Example:
Column Name contains the following data:
23546
16565
43546
Jeff
John
Jack
How can I only display the following, is there a function in sql server that does that?
23546
16565
43546
Thanks, I've been changing this procedure so much that i didn't even realize that i don't need them as output anymore if i'm just going to insert them into a table.
I was trying to set up a trigger that calls a stored procedure that retrieves all information from a personId within table1 and...
Hi, I have table1 and table2 and i want to fill information from table1 into table2 using a stored procedure. Here's what i have:
create sp_table2
(@personId varchar(36),
@value varchar(40) OUTPUT
@value1 varchar(40) OUTPUT)
as
begin
insert into table2 (date, first_name, last_name...
Hi, I have table1 and table2 and i want to fill information from table1 into table2 using a stored procedure. Here's what i have:
create sp_table2
(@personId varchar(36),
@value varchar(40) OUTPUT
@value1 varchar(40) OUTPUT)
as
begin
insert into table2 (date, first_name, last_name...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.