Viewing 15 posts - 2,521 through 2,535 (of 3,957 total)
I think interviewers should play Jeopardy with the interviewees.
Answer: ambiguous column
Question: What is the error message you get when you don't sufficiently qualify a column reference with the associated table...
November 2, 2012 at 4:20 am
Luis Cazares (10/31/2012)
GSquared (10/31/2012)
On the other hand ... if anyone ever publishes "Trivial Pursuit, DBA Edition", they could come in very handy indeed!
Would you buy it? Or would you...
November 1, 2012 at 11:09 pm
Jeff Moden (11/1/2012)
Jason Selburg (11/1/2012)
I need only to check the syntax.
Also, the syntax can be...
November 1, 2012 at 9:03 pm
Still haven't found the definitive answer but I did think of this approach.
It might work a little better and could conceivably be used with INSERTs, UPDATEs and DELETEs!
DECLARE @sql VARCHAR(8000)...
November 1, 2012 at 7:31 pm
A pure SQL solution, using Lowell's example might be like this:
DECLARE @sql VARCHAR(8000) = 'SELECT * FROM FROM sys.objects'
BEGIN TRY
EXEC (@SQL)
END TRY
BEGIN CATCH
...
November 1, 2012 at 7:07 pm
computergirl (10/16/2012)
November 1, 2012 at 6:55 pm
Perhaps it is something like this that you seek:
;WITH Dates AS (
SELECT MyDate
FROM (
VALUES ('2012-10-28'),('2012-10-29'),('2012-10-30')) a (MyDate)),
Tally (n)...
November 1, 2012 at 6:44 pm
matt6749 (10/29/2012)
Each doctor in my doctors table has a main zip code and an alternate zip code.
SELECT D.*
FROM Doctors D
INNER JOIN ZipCodes Z
ON D.MainZip = Z.ZipCode
OR D.AlternateZip =...
November 1, 2012 at 12:04 am
28.kanikasoni (10/31/2012)
Hi,Thanks 4 ur solution but I am getting error in order clause
Incorrect syntax near the keyword 'order'.
Incorrect syntax near the keyword 'ELSE'.
Incorrect syntax near the keyword 'ELSE'.
Try removing the...
October 31, 2012 at 11:52 pm
I believe Jerry's answer is correct.
What you want to do is this:
WHEN MATCHED THEN BEGIN
INSERT INTO @BookChangeTracking(TitleID,OldQuantity,NewQuantity,ChangeDate)
VALUES(bi.TitleID,bi.Quantity,bi.Quantity+bo.Quantity,getdate())
UPDATE SET bi.Quantity = bi.Quantity + bo.Quantity
END
But the MERGE statement doesn't support BEGIN...
October 31, 2012 at 11:46 pm
While it will, you won't be able to manipulate results in the client.
To do that, you'd need to INSERT into a temporary table within the dynamic SQL. That table,...
October 31, 2012 at 11:37 pm
T_Dot_Geek (10/31/2012)
Please follow below article helps you how to provide more clarity for your posthttp://www.sqlservercentral.com/articles/Best+Practices/61537/
We're asking the OP to make it easier for us so let's make it easy for...
October 31, 2012 at 10:57 pm
No need to be embarrassed and you're welcome.
You'd be surprised how often the simplest issue is uncovered quickly by a second set of eyes. In this case, I happened...
October 31, 2012 at 7:45 pm
Try this:
DECLARE @tApplXML XML
,@SQL NVARCHAR(max)
,@ParmDefinition NVARCHAR(1024)
,@applnbr int
set @applnbr = 24
SET @sql = N'SELECT @ptApplXML = (SELECT * FROM [database].[dbo].
WHERE [ApplNbr] = @pApplNbr
FOR XML PATH(''database.table''))'
SET @ParmDefinition...
October 31, 2012 at 7:25 pm
Somewhere I heard that COUNT(*) is optimized for this specific case (not Craig's conditional count).
If you'd like a faster way that doesn't need to do a table scan, this technique...
October 31, 2012 at 7:17 pm
Viewing 15 posts - 2,521 through 2,535 (of 3,957 total)