Viewing 15 posts - 1,291 through 1,305 (of 1,439 total)
Something like this?
WITH AvgResponse AS (
SELECT AVG(CAST(response AS DECIMAL (4,2))) AS response,
expectation,
employeenumber,
...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 11, 2008 at 2:30 am
CI - Case Insensistive
AS - Accent Sensitive
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 8, 2008 at 8:22 am
CREATE FUNCTION dbo.GetSubTree(@ID int)
RETURNS XML
BEGIN RETURN
(SELECT ID AS "@ID",
Title AS "@Title",
dbo.GetSubTree(ID)
FROM MyTable
WHERE Parent=@ID...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 3, 2008 at 9:16 am
SELECT
XML.value('(/*[local-name()="Movement"][@Context="Purchase"])[1]','varchar(50)') AS Purchase
from
XMLCollection
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 3, 2008 at 8:41 am
Why do you want to do this dynamically?
Have you tried something like this?
SELECT @var = ParamXML.value('/ROOT[1]/TestCase[position()=sql:variable("@TestCaseID")][1]/Query[1]/@Expected','VARCHAR(MAX)')
FROM dbo.SPParamXML
WHERE SPName = @SPName
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 2, 2008 at 7:21 am
select
tab.col.value('@Descr', 'varchar(100)'),
tab.col.value('.', 'varchar(100)')
from @xml.nodes('/SerialNumber/S') tab(col)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
September 2, 2008 at 4:53 am
select r.value('../@a','int') as A,
r.value('@b','int') as B
from #testA
cross apply xml.nodes('/Tree/Leaf') as x(r)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
August 29, 2008 at 1:29 am
You'll need to post the XML with the namespace declarations
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
August 13, 2008 at 9:43 am
select b.value('@id','int') as CustomerID,
b.value('./name[1]','varchar(20)') as Name,
b.value('./city[1]','varchar(20)') as City,
d.value('@id','int') as...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
August 13, 2008 at 3:35 am
You can use a numbers/tally table
http://www.sqlservercentral.com/articles/TSQL/62867/
For example
DECLARE @Parameter VARCHAR(100)
DECLARE @ch CHAR(1)
SET @Parameter='aaaddddfffggghhhhjjjj'
SET @ch='f'
SELECT ROW_NUMBER() OVER(ORDER BY N) AS nth,
N AS [Position In String]
FROM...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 30, 2008 at 3:26 am
SELECT r.value('.','VARCHAR(20)')
FROM Table1
CROSS APPLY Column1.nodes('/*:Webstore/*:Manifest/*:Version') AS x(r)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 29, 2008 at 1:29 am
Assume that the selected file types are in a table such as this
CREATE TABLE SelectFileTypes(FileTypeID INT)
INSERT INTO SelectFileTypes(FileTypeID) VALUES(2)
INSERT INTO SelectFileTypes(FileTypeID) VALUES(3)
This query should give the results you want
SELECT GroupID
FROM...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 22, 2008 at 1:53 am
WITH XMLNAMESPACES ('urn:WebstoreDeploymentSchema.xsd' AS ns)
SELECT r.value('@Name','VARCHAR(50)') AS 'Element Database Template'
FROM Table1
CROSS APPLY Column1.nodes('/ns:Webstore/ns:DatabaseTemplates/ns:DatabaseTemplate') AS x(r)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 22, 2008 at 1:45 am
RyanRandall (7/14/2008)
declare @t table (id int identity(1, 1), a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 14, 2008 at 9:22 am
antonio.collins (7/10/2008)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
July 11, 2008 at 2:45 am
Viewing 15 posts - 1,291 through 1,305 (of 1,439 total)