Viewing 15 posts - 316 through 330 (of 898 total)
It depends on the way SQL Server processes your query
We want the SQL Server to process the queries in the following orders
1. Process the WHERE CLAUSE based on datatype and...
April 2, 2013 at 8:01 am
You will have to use DERIVED TABLE to do this
SELECTTOP 10 *
FROM(
SELECT key_value
,convert(datetime2,PV.key_value) as DT2
,convert(datetime,CONVERT(DATETIME2, PV.key_value)) AS DT
FROM parameter_value PV
WHERE PV.datatype = 'D'
) AS PV
WHEREconvert(datetime,CONVERT(DATETIME2, PV.key_value)) BETWEEN...
April 2, 2013 at 6:25 am
rals (4/2/2013)
You can achieve this with Pivot as well..
SELECT Certyear, [HI-Master] , [HI-Instr] , [HI-Train]
FROM
(SELECT Certyear,CertCode,Quantity FROM Certification) C
PIVOT ( SUM (Quantity) FOR CertCode IN ( [HI-Master],...
April 2, 2013 at 3:27 am
We don't have any idea how your table structures look like and hence, it will be very difficult to assist you
It would be really helpful if you provide the DDL...
April 2, 2013 at 1:12 am
I think this is what you are after
SELECTv.CertYear,
SUM( CASE WHEN v.CertCode = 'HI-Master' THEN v.Quantity ELSE 0 END ) AS QtyMaster,
SUM( CASE WHEN v.CertCode = 'HI-Instr' THEN v.Quantity ELSE 0...
March 31, 2013 at 11:34 pm
You can use the DelimitedSplit8K function for your requirement
SELECTPMI.pmid, DS.Item
FROMPMInfo AS PMI
CROSS APPLY dbo.DelimitedSplit8K( PMI.member, '-') AS DS
The code for the function is present in the article by Jeff Moden...
March 28, 2013 at 4:27 am
INCLUDED columns were introduced in SQL Server 2005
They can improve performance by avoiding key look ups as the necessary columns are included along with the key columns in the indexes
You...
March 28, 2013 at 4:19 am
What does your final expected output look like?
March 28, 2013 at 3:45 am
You can use the below mentioned query to find all un-encrypted routines using "TABLEA.ID"
SELECTOBJECT_NAME(object_id) AS RoutineName
FROMsys.sql_modules AS sm
WHEREsm.definition LIKE '%TABLEA.ID%'
You can then manually changes all the SP's
I would suggest you...
March 28, 2013 at 2:04 am
This should work..
DECLARE@tbl_Table TABLE
(
Column1 VARCHAR(100)
)
INSERT@tbl_Table
SELECT'abbc cd ef' UNION ALL
SELECT'abcdef' UNION ALL
SELECT'adb ef cd' UNION ALL
SELECT'ad cd eg'
SELECT*
FROM@tbl_Table AS t
WHEREt.Column1 LIKE 'cd %'
ORt.Column1 LIKE '% cd'
ORt.Column1 LIKE '% cd %'
March 28, 2013 at 1:52 am
We don't have any idea how your tables look like and what are the column names
Can you provide us the DDL of the tables involved along with some sample data...
March 27, 2013 at 3:02 am
You will have to use JOINS for the same
I have used FULL OUTER JOIN in the code below( You can use INNER or LEFT OUTER as per your requirement)
; ...
March 27, 2013 at 2:55 am
astrid 69000 (3/26/2013)
the query...
March 26, 2013 at 3:39 am
Did you check the query I had posted 2 posts back?
http://www.sqlservercentral.com/Forums/FindPost1435316.aspx
This almost has what you require
I had prepared that query based on the assumption of 5 days grouping which you...
March 26, 2013 at 3:25 am
astrid 69000 (3/26/2013)
to calculate the first period i go
select sum(Count) from #table where recordday >= '2008-01-01'...
March 26, 2013 at 2:43 am
Viewing 15 posts - 316 through 330 (of 898 total)