Viewing 15 posts - 4,021 through 4,035 (of 10,144 total)
Sean Lange (9/5/2013)
This thread has now moved to a new one...not sure why.http://www.sqlservercentral.com/Forums/Topic1491832-1292-1.aspx
Thanks Sean - I'll post the same question there. Cheers.
September 5, 2013 at 9:23 am
You may get better performance if you detach the SELECT from the INSERT by running the results of the SELECT into a temp table.
Also, since your SELECT reads local and...
September 5, 2013 at 4:20 am
Luis Cazares (9/4/2013)
And why don't you create it? It's a very powerful tool.
Absolutely. But if you can't (your DBA won't let you) then you can hack the code into your...
September 5, 2013 at 3:38 am
Project plan for setting up the server?
Project plan for moving data to it from a different server?
Can you be more specific?
September 5, 2013 at 2:32 am
I've no idea, because it's in the original query:
Original:
WHERE
(dbo.Mobitech_Filtered_Task.PIMS_IMPORTED IS NULL) OR
(dbo.Mobitech_Filtered_Task.PIMS_IMPORTED = 0)
New:
SELECT t.task_id
FROM dbo.Mobitech_Filtered_Task t
WHERE (t.PIMS_IMPORTED IS NULL OR t.PIMS_IMPORTED = 0)
AND t.completed = 1
AND...
September 5, 2013 at 2:28 am
Which I think is the same as this:
INSERT INTO Mobitech_Filtered_Task_Step (
task_step_id,task_id,task_step_type_Id, display_order,int_data, varchar_data,image_data,bit_data,decimal_data,
float_data,lat_data,lon_data,notes,completed,deleted,date_added, server_date_modified,added_by,modified_by,
meter_formula,number_of_dials,additional_info,web_date_modified,mobile_date_modified)
SELECT
task_step_id,task_id,task_step_type_Id, display_order,int_data, varchar_data,image_data,bit_data,decimal_data,
float_data,lat_data,lon_data,notes,completed,deleted,date_added, server_date_modified,added_by,modified_by,
meter_formula,number_of_dials,additional_info,web_date_modified,mobile_date_modified
FROM [23.23.209.111].[mobitechGeneric_qa].[dbo].[filtered_task_step] f
WHERE f.task_id IN (
SELECT t.task_id
FROM dbo.Mobitech_Filtered_Task t...
September 5, 2013 at 2:01 am
I reckon, what you are looking for is this:
INSERT INTO Mobitech_Filtered_Task_Step (
task_step_id,task_id,task_step_type_Id, display_order,int_data, varchar_data,image_data,bit_data,decimal_data,
float_data,lat_data,lon_data,notes,completed,deleted,date_added, server_date_modified,added_by,modified_by,
meter_formula,number_of_dials,additional_info,web_date_modified,mobile_date_modified)
SELECT
task_step_id,task_id,task_step_type_Id, display_order,int_data, varchar_data,image_data,bit_data,decimal_data,
float_data,lat_data,lon_data,notes,completed,deleted,date_added,server_date_modified,added_by,modified_by,
meter_formula,number_of_dials,additional_info,web_date_modified,mobile_date_modified
FROM [23.23.209.111].[mobitechGeneric_qa].[dbo].[filtered_task_step]
WHERE task_id IN (
SELECT t.task_id
FROM dbo.Mobitech_Filtered_Task t
LEFT...
September 5, 2013 at 1:54 am
Almost clear enough to make a stab at it...could you post the expected result set, or, alternatively, add an extra column say 'NewAmount' to your sample data which contains the...
September 5, 2013 at 1:31 am
How are your products uniquely identified, Greg?
September 5, 2013 at 1:25 am
Sean Lange (9/4/2013)
September 5, 2013 at 1:15 am
Sometimes it's easier to work with the expression in an APPLY block, dropping the results down to the WHERE clause like this:
SELECT e.*,
x.Datefilter,
x.LookupFilter
FROM tbl e
INNER JOIN LKUP...
September 4, 2013 at 9:16 am
PearlJammer1 (9/4/2013)
Incidentally how do you copy a...
September 4, 2013 at 8:53 am
PearlJammer1 (9/4/2013)
Example there are...
September 4, 2013 at 8:44 am
sturner (9/4/2013)
select coll,
count(case when coll is not null and value is not null then 1 else 0 end) CntCol,
count(case when coll is not...
September 4, 2013 at 8:38 am
PiMané (9/4/2013)
ChrisM@Work (9/4/2013)
-- sample data
;WITH gennum (tollnum, n1, n2, n3) AS (
SELECT 800123, 1234, 1235, 1236 UNION ALL
SELECT 999123, 9876, 9875, 9874
)
-- solution
SELECT g.tollnum, d.code
FROM gennum...
September 4, 2013 at 8:06 am
Viewing 15 posts - 4,021 through 4,035 (of 10,144 total)