Viewing 15 posts - 631 through 645 (of 897 total)
subbusa2050 (11/24/2010)
Please read my complete post and reply back. I am asking how Chris Morris got 1319 in that datediff function, other than that u...
November 24, 2010 at 10:14 pm
You will have to use Dynamic SQL for the same
EXECUTE sp_executeSQL @result
Check for sp_executeSQL in Books Online or Google.
November 24, 2010 at 9:52 pm
Not sure if i understood your requirement correctly, but i hope this is what you want.
DECLARE@tbl_Items TABLE
(
Item_NoINT,
LanguageVARCHAR(10),
DescriptionVARCHAR(100)
)
INSERT@tbl_Items
SELECT1, 'EN', 'descr. english1' UNION ALL
SELECT1, 'IT', 'descr. italian1' UNION ALL
SELECT2, 'EN', 'descr. english2'...
November 24, 2010 at 5:16 am
You cannot execute Dynamic queries in this manner
You will have to do some changes as shown below
DECLARE @strSQL NVARCHAR(100)
DECLARE@iCount INT
SET @strSQL = 'SELECT @iCount = COUNT(*) FROM dbo.TableName'
EXECUTE sp_executeSQL @strSQL,...
November 23, 2010 at 11:23 pm
1) There is nothing called the LEFT INNER JOIN. It is always a LEFT OUTER JOIN where the word OUTER is optional. So you can also write the same as...
November 22, 2010 at 10:20 am
You will have to use a nested REPLACE for this like the below example
DECLARE@strVariable VARCHAR(100)
SET@strVariable = 'a1b2c3'
SELECTREPLACE( REPLACE( REPLACE( @strVariable, 'a', '' ), 'b', '' ), 'c', '' )
November 21, 2010 at 11:40 pm
I think you can re-write the query as below or is this a really over simplified example? Anyways, as Mr. Magoo said, you can check the same in the Execution...
November 18, 2010 at 11:56 pm
You can use
INSERT INTO abcde VALUES ( default )
November 17, 2010 at 10:37 pm
You can use the EXISTS clause for the same..
SELECT*
FROMMain M
WHEREEXISTS
(
SELECT*
FROMtbl_Filer F
WHEREM.CODE = F.CODE AND M.CENTER = F.CENTER
)
November 17, 2010 at 9:29 pm
It would be helpful if you post the complete SELECT query at least
But i think this is what you want.
DECLARE @status Varchar (10)
SELECT @status='ALL'
--following is the...
November 17, 2010 at 2:38 am
Not sure but i hope this is what you want..
SELECTQT.QuestionId, QT.QuestionLabel
FROM@QuestionTable QT
WHEREEXISTS
(
SELECT*
FROM@DetailTable DT
WHEREQT.FilterId1 = DT.FilterId1
ANDQT.FilterId2 = DT.FilterId2
ANDQT.FilterId3 = DT.FilterId3
)
November 16, 2010 at 9:46 pm
You can use the SUBSTRING and LEN function as below..
DECLARE@strVariable VARCHAR(100)
SELECT@strVariable = '| hello | world | I love sql server'
SELECTCASE
WHEN SUBSTRING( @strVariable, 1, 1 ) = '|'
THEN SUBSTRING( @strVariable,...
November 16, 2010 at 9:35 pm
Detailed explanation on Query Hints cannot be given as answers to questions on forums. Search for the same in Google or Books Online.
Also take a look the book Dissecting SQL...
November 16, 2010 at 12:16 am
Providing the DDL of the table involved, some sample data and the expected result would help a lot in solving your problem
Also if you tried something yourself provide the proper...
November 11, 2010 at 9:39 pm
Viewing 15 posts - 631 through 645 (of 897 total)