Viewing 15 posts - 136 through 150 (of 2,893 total)
I don't think that there is any "generic" approach.
Nothing usefull can be advised without knowing any sort of details.
Providing invloved table's and other objects DDLs, query itself and its...
May 23, 2014 at 5:04 am
That is the first step to get the answer you need:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you follow the above, you most likely will get relevant help quite promptly...
May 21, 2014 at 2:47 am
...
Why are you making a copy of the table? Why not just use Table2?
And if you really want a complete copy of Table2 in Table1 then you can do...
May 21, 2014 at 2:44 am
I guess the first step whould be reading this:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 20, 2014 at 6:45 am
Not enough details to suggest a solution.
What do you mean by merge in your case?
1. May you have the same data in both databases?
If Q#1 = Yes:
2....
May 20, 2014 at 4:01 am
Create a temp table to hold results in a way you need.
Then decalre a cursor over your query which lists db names, table names and column names
Then you will need...
May 19, 2014 at 11:38 am
The best way would be using pre-build calendar table. The following example creates on-fly calendar containing weekend days for 100 years starting from 1 Jan 2000.
declare @sample table (StartDate datetime,...
May 19, 2014 at 11:12 am
or without calendar table:
declare @dtFrom date
declare @dtTo date
select @dtFrom = '2013-12-15'
,@dtTo = '2014-02-18'
select year(dt) [Year], month(dt) [Month], count(*)
from (select top(datediff(d,...
March 11, 2014 at 11:36 am
It's almost impossible to build solution which will cover all posible permitations of something which looks like the free-text.
He is a bit more comprehensive logic which cover most of your...
March 11, 2014 at 5:35 am
You can try
SELECT a.accountId
,(SELECT SUM(m.debit) FROM accountMovs m WHERE m.accountId LIKE a.accountId + '%') Debit
...
March 10, 2014 at 10:37 am
declare @XML xml
set @XML =
'<Recordset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Products>
<Productdetails>
...
March 10, 2014 at 7:44 am
1. Wrong syntax
2. Danger of converting date into non ISO formatted date string (code 101, means that potentially you may have something like 05/06/2014. Now tell me is it 5th...
February 20, 2014 at 10:16 am
mandrewthebarbarian (2/20/2014)
February 20, 2014 at 10:04 am
...
I need to split (2014-02-01, 2014-02-05) into (2014-02-01, 2014-02-02) and (2014-02-03, 2014-02-05) because on 2014-02-03 stock increases +5 pieces
FROM_DATETO_DATESTOCK
2014-02-012014-02-0210
2014-02-032014-02-0515
2014-02-062014-02-145
2014-02-152014-02-2825
2014-03-01null20
What in your "sample data " indicates that the stock changed on...
February 20, 2014 at 9:48 am
I cannot see from your example, what kind of logic splits set of dates:
FROM 2014-02-01 TO 2014-02-05
FROM 2014-02-03 TO 2014-02-28
FROM 2014-02-15
to
FROM 2014-02-01 TO 2014-02-02
FROM 2014-02-03 TO 2014-02-05
FROM 2014-02-06 TO 2014-02-14
FROM...
February 20, 2014 at 7:50 am
Viewing 15 posts - 136 through 150 (of 2,893 total)