Viewing 15 posts - 1 through 15 (of 15 total)
I think some of it comes down to: Is SQL code readability covered by the general text readability type study?
Personally, I think not, and that it's going to be...
October 6, 2010 at 7:44 am
I see... I missed the "totaling" of the time in the initial example... 😛
Back to the drawing board!
October 6, 2010 at 7:28 am
Here is what I did, and thank you for making the testing easy!
Select BookID, StudentID, LoanDate, ReturnDate
From @BookLoans
Group By BookID, StudentID, LoanDate, ReturnDate
Order by BookID ASC, LoanDate ASC, ReturnDate ASC
And...
October 6, 2010 at 7:21 am
What are the table names that are showing up that you cannot find?
October 5, 2010 at 8:22 am
You could also use SSIS to export the data by query to an Excel file. Just right-click on the database and select "Tasks" then "Export Data...". That will...
October 5, 2010 at 8:16 am
Is it possible the tables are not in the table list, because they are system tables?
October 5, 2010 at 8:09 am
laddu4700 (10/1/2010)
Thanks to all.Can I any body provide the solution/script to update the statusID in User table.
The initial script you wrote will work if you change the foreign key to...
October 1, 2010 at 1:10 pm
laddu4700 (9/30/2010)
TableName: User
UserID(PK) StatusID(FK) StatusReasonID(FK)
46 ...
October 1, 2010 at 9:51 am
I saw that, and the only other question I think I have right now, is that you have to do the query referencing the CTE immediately after the declaration, correct?
September 30, 2010 at 3:18 pm
One question I have....
From what I was reading, you define the CTE, then you can query against, it, update, etc.
But it is a one time query, right? Something like...
September 30, 2010 at 2:57 pm
Thanks Nevyn, I'll keep researching until I understand them better.
September 30, 2010 at 12:34 pm
You are going to need to find out what the constraint is that the Update is falling afoul of. I would imagine that the problem is with the StatusID.......
September 30, 2010 at 12:08 pm
Very very interesting! Thank you! I now have some research to do to understand that code! 😛
I honestly have never seen or used those commands before...
September 29, 2010 at 12:24 pm
Lynn Pettis (9/28/2010)
DECLARE @test-2 TABLE
(ID INT,
NAM VARCHAR(50));
INSERT INTO @test-2
SELECT 1,'RAM'
UNION ALL
SELECT 1,'PRASAD'
UNION ALL
SELECT 2,'SQL'
UNION ALL
SELECT 2,'SERVER'
UNION ALL
SELECT 2,'CENTRAL'
UNION ALL...
September 29, 2010 at 11:24 am
Viewing 15 posts - 1 through 15 (of 15 total)