Viewing 15 posts - 3,736 through 3,750 (of 13,462 total)
assuming the data types of col1 and col2 are varchars:
update SomeTable
SET Col3 = Col1 + Col2
if they are integers, you will have to explicitly cast/convert the two columns.
April 4, 2013 at 2:44 pm
the actual execution plan, if oyu can post it as a .SQLPlan file, would give us the most detailed information;
aside from that, here's what i see:
i see six objects in...
April 4, 2013 at 12:50 pm
would doing something like selecting a newid() help?
for example, have them do something like this:
SELECT
NEWID() AS RefID,
OtherColumnsButNotTheRealID
Into TableForExport
From tblPatients
--OR
SELECT
identity(int,1,) AS RefID,
OtherColumnsButNotTheRealID
Into TableForExport
From tblPatients
then...
April 4, 2013 at 12:10 pm
sql has the ability to update a table based on another table, you just need to get used to the syntax.
the advantage is it would be set based,and allow you...
April 4, 2013 at 12:03 pm
glad i could help a little Sapan;
note that sp_msForEachDb is really is a cursor behind the scenes;
while cursors are generally frowned upon, when fiddling with metadata, this is one...
April 4, 2013 at 11:56 am
rajarshi_ghosh_05 (4/4/2013)
No. We dont bother about the temp table data not if anything happens like network failure or server restart or user system restart! We dont have to preserve that...
April 4, 2013 at 11:51 am
you restore the last good backup as a new database name.
then you can use cross database queries move differences from one table to another;
depending on the foreign keys, you might...
April 4, 2013 at 11:24 am
RexHelios (4/4/2013)
Lowell (4/4/2013)
....see how i modified it to sue sp_msForEachDb,....
Didn't realize we could sue other members' stored procedures 😉 Just an attempt to pump some humor, Lowell. No offense meant....
April 4, 2013 at 11:22 am
something like this seems to work for me, see how i modified it to sue sp_msForEachDb, and to INSERT INTO a #temp table, and read the results at
the end.
CREATE...
April 4, 2013 at 11:10 am
you have to select form a CalendarTable, which would contain all possible dates, and left join it to your data that has the rest of the data.
you can generate a...
April 4, 2013 at 10:02 am
i though blank() was a new SQL 2012 function, haha; pasted it to test and everything!
April 4, 2013 at 9:42 am
without the real code, i could just post a snippet:
but it something like this:
SELECT ColumnList,Priority
From YourTable
GROUP BY ColumnList,Priority
ORDER BY
CASE Priority --the column we will custom...
April 4, 2013 at 8:41 am
not sure what you can do yet;
two of the values cannot be directly converted to TIME datatype (the zero and negative values)
msdn says the possible values for TIME datatypes are...
April 4, 2013 at 8:09 am
Sure :
...
ORDER BY
CASE
WHEN 'Top Priority'
THEN 1
WHEN 'High'
THEN ...
April 4, 2013 at 7:30 am
holy crap! you have people with sysadmin permissions, on the Live server, Klutzing around and making DDL changes at will?
time to update your resume, it's only a matter of time...
April 4, 2013 at 7:27 am
Viewing 15 posts - 3,736 through 3,750 (of 13,462 total)