Viewing 15 posts - 856 through 870 (of 895 total)
SELECTDISTINCT [Name]
FROMTableName
WHERE[Name] NOT IN ( SELECT DISTINCT [Name] FROM TableName WHERE Fruit = 'Apple' )
I hope the Column Name doesnot contain NULL values
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 4, 2010 at 10:21 pm
Hope this helps...
DECLARE@tiCounter TINYINT
DECLARE@iGroupID INT
SET@tiCounter = 0
SET@iGroupID = 1
--===== Create the test table
CREATE TABLE #mytable
(
ID INT not null,
Stats varchar(15) not null,
EntryDate DATETIME not null
)
--===== Insert data into test table
INSERT INTO...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 4, 2010 at 12:21 am
Oh, sorry i didn't test it. This will work..
DECLARE @strapplication_name VARCHAR(100)
DECLARE @strapplication_version VARCHAR(50)
SET @strapplication_name = 'AlphaApp'
SET @strapplication_version =...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 3, 2010 at 11:13 pm
it's usually not a good idea to hard code values that are stored in a table, too. Even more in this special case where a temp table is used (that's...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 3, 2010 at 9:54 pm
See if this helps..
DECLARE@strapplication_name VARCHAR(100)
DECLARE@strapplication_version VARCHAR(50)
SET@strapplication_name = 'AlphaApp'
SET@strapplication_version = '3.0.20'
; WITH cteTable AS
(
SELECT ROW_NUMBER() OBER ( PARTITION BY application_name, application_version ORDER BY last_used DESC ) Row, *
...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 3, 2010 at 9:43 pm
Remove the Order By Clause from the first statement and put it only in the last statement
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 3, 2010 at 9:28 pm
Check if this works..
SELECT*
FROM cElements A
LEFT JOIN sectionList D ON D.sectionID = A.sectionID
LEFT JOIN fList E ON E.fID = D.fID
WHERE
1 = CASE
WHEN '2006' IN(SELECT acYears =...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 2, 2010 at 10:06 pm
People that wear hats are all hat & no cow & they have no hair; they are bold!!
Before commenting on other's profile have a look at your's buddy. And...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 27, 2010 at 1:17 am
Thank you, I appreciate you constructive feedback.
Please let me know when that that I'm scheduled for the war crimes tribunal.
I ask for the mercy of the Forum and for...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 27, 2010 at 12:36 am
Please post the complete problem in the forum Harsh. I doubt if anybody will even copy your link to paste it in the browser, forget a solution.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 27, 2010 at 12:29 am
Paul White (2/26/2010)
--------------------------------------------------------------------------------
If you have a pain in your finger, chopping your hand off is not the solution.
In fairness, it is *a* solution, just probably not optimal ...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 26, 2010 at 11:57 pm
So there are no DBA's that recognize that there are risk to Dynamic SQL?
If I'm wrong then I respectfully respect that you forgive me for identifying the negatives of Dynamic...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 26, 2010 at 11:37 pm
It does work in my PC though...
Check this out
WITH cteProduct AS
(
SELECT1 ProductID, 'Maruti' ProductName, 1 CategoryID UNION ALL
SELECT2, 'Scoda', 1 UNION ALL
SELECT3, 'Benz', 1
), cteDescriptors AS
(
SELECT1 DescriptorValueID, 'Black' DescriptorValue UNION...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 26, 2010 at 11:29 pm
There are people who love "Dynamic SQL". I being one of them. How can one forget the "Dynamic Cross Bars" and the "Dynamic Pivots". Dynamic SQL is really useful in...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 26, 2010 at 10:59 pm
Check if this satisfies your requirement..
SELECTProductName
FROM(
SELECT P.ProductName, COUNT(*) MappedCount
FROM ProductDescriptorMapping PDM
INNER JOIN Product P ON PDM.ProductID = P.ProductID
GROUP...
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 26, 2010 at 10:48 pm
Viewing 15 posts - 856 through 870 (of 895 total)