|
Pete O`Hanlon wrote: Sorry - I've done this from memory so it might not be 100%.
Looks great! I was fussing with the Microsoft example and fumbled with the inner join where (had the child and parent ID comparison backwards with relation to the "from" and "inner join" tables).
Thanks so much for showing me about CTE. Very cool!
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
You can write recursive stored procedures. Will that help, or do you need it to be a single query?
Jon Sagara
I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So i had to leave the place as soon as possible.
--Mr.Prakash
Blog | Site | Articles
|
|
|
|
|
I have a Microsoft SQL Server database that was moved. When I looked at the tables in the Server Explorer there are 2 sets of the same tables 1 set having the text '(dbo)' tacked on to the end of the table names. Why is this? Am asking because the website that connects to the database updates the tables with '(dbo)' while the admin page querys the tables without '(dbo)'. Can I delete one of the sets?
|
|
|
|
|
dbo means data base owner, in short its the user who owns the tables.if you created the tables with user name "x" the resulting table will be referenced by x.tablename
You can change the owner of an object by using stored procedure sp_changeobjectowner
dptalt wrote: Can I delete one of the sets?
Well as long as you have the right permission in your web site to access thes tables you can...
|
|
|
|
|
I did the following steps:
1. Created a report using SQL Reporting Services. (OK)
2. Deployed the project (ABC) into the ServerX. (OK)
3. Opened the SQL Reporting Services using the Report Manager on localhost of the ServerX. (OK)
4. Opened the ABC folder. Files deployed. (OK)
5. Created two subscriptions. One (Service1) for printing to the Printer. One (Service2) for saving into a file. (OK)
6. Opened the Service1. In the View Tab, after entering the Report Parameters, clicked on "View Report". (OK)
7. I expected view to show what I viewed in the Project (ABC). (NOK - It printed a wrong format. Alignment was completely different)
8. Tried to export to a TIFF file expecting to see the same view as I saw in the Project (ABC). (NOK - It printed a wrong format. Alignment was completely different)
9. Tried to export to a PDF file expecting to see the same view as I saw in the Project (ABC). (NOK - It printed a wrong format. Alignment was completely different)
10. In the subscriptions, I ran the Service1 to print the report from the SQL Reporting Services directly onto the Printer. (NOK - It printed a wrong format. Alignment was completely different)
Is this an expected issue with SQL Reporting Services which incase doesnt make any sense to use it. Or it is an issue with my code. All I assumed that I should expect from SQL Reporting Services is: if I create a Report and I preview the Report, I should get a WYSIWYG formats.
Half the way through our project, we are completely stuck up. SOS!!!
|
|
|
|
|
Hi
There are two date fields in the table and i want to select Maximum date field from two fields i m trying to query like this.
Table Fileds:
UserID Int
LastDDTxn Datetime
LastCardTxn Datetime
SELECT LAST_TRAN_DATE=
(CASE WHEN LastCardTxn>LastDDTxn THEN LastCardTxn
ELSE WHEN LastDDTxn>LastCardTxn THEN LastDDTxn
ELSE NULL
END) AS Last_Tran_Date
FROM USERHISTORY
The Error is showing that
Incorrect syntax near the keyword 'WHEN'
SHAHZAD
|
|
|
|
|
Select LAST_TRAN_DATE = Max([Date])
From(
Select [Date] = LastDDTxn
From UserHistory
Union
Select [Date] = LastCardTxn
From UserHistory
) Dates
Wout Louwers
|
|
|
|
|
Thanx! Its working fine.
Shahzad
|
|
|
|
|
SELECT LAST_TRAN_DATE =
(CASE
WHEN LastCardTxn > LastDDTxn THEN LastCardTxn
<s>ELSE</s> WHEN LastDDTxn > LastCardTxn THEN LastDDTxn
ELSE NULL
END) AS Last_Tran_Date
FROM USERHISTORY The first, crossed-out, ELSE is incorrect - ELSE is only used for the 'default' case i.e. when no WHEN clauses match. Therefore, when the query parser encounters ELSE , it's expecting an expression, and reports that WHEN is an error.
|
|
|
|
|
hi all
please tell me the query
actually i have a table named history from which i want to get first and last record of a particualr person based on a date given in the query parameter
thanks
hello
hello
|
|
|
|
|
Not only cross posting, but reposting. Do you really think we are so stupid as to not notice this?
OK - some guidelines. Tell us what the table structure is and the query criteria you have to work with. Then, give us some idea as to what you have tried so we can see that you aren't just trying to get us to do your homework for you. Finally, pick a meaningful subject. "Re: need query" is not going to get your question answered.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi all
please tell me the query
actually i have a table named history from which i want to get first and last record of a particualr person based on a date given in the query parameter
thanks
hello
|
|
|
|
|
Please don't cross post.
---
Year happy = new Year(2007);
|
|
|
|
|
hello
can anyone plz tell me the query to rename an existing field in a table????
Saira
|
|
|
|
|
EXEC sp_rename 'customers.[contact title]', 'title', 'COLUMN'
|
|
|
|
|
SQL Server:
exec sp_rename @objname='TableName.ColumnName', @newname='NewColumnName'
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
:-Dwrite querry to compare row in table A and in table B.
for example
if in table A contains row values as a 12
b 14
c 15
if in table B contains row values as a 13
b 21
c 43
compare table A's row c with table B's row c.
pradeep kulkarni
|
|
|
|
|
The questions you're asking are very easy, and you're obviously typing in your homework. Please try yourself, if you can't work this out, you should quit your course.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
write querry to display all books whose name start with 's'
please help me
pradeep kulkarni
|
|
|
|
|
SELECT * FROM <tablename>
WHERE COLUMNNAME LIKE 'S%'
|
|
|
|
|
Please don't do people's homework, it's not helping them
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hi ,
this is santhosh in my project i want to store 3 images in one column in sqlserver and when the time of displaying(in front end c#) it should display seperately , plz tell me how to do this
thank you
santhosh
|
|
|
|
|
Why do you want to store three images in one column? Seems like a bit of a normalisation issue here.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi ,
in my project documentation is prepared like that that's why i am trying to store 3 images in one column plz help me
.......santhosh
|
|
|
|
|
write a querry to delete table.
pradeep kulkarni
|
|
|
|