|
PIEBALDconsult wrote: It's the DataAdapter and CommandBuilder
Sure but they are in the UI and in C#/VB rather than the database.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
They have nothing to do with the UI; there are no visible parts, they do the same thing when I write a library with a text editor.
|
|
|
|
|
I am trying to run the following query on a MS SQL Server 2005 Express.
SELECT * FROM
(
SELECT * FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
) AS TicketData PIVOT (
SUM(ProductWeight) FOR ProductCode IN (
[Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],[FMeal],
[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],[Skin],[Slurry],
[Tail],[Tallow],[TBottom],[Thigh],[TMeal],[Wash]
)
)
SQL Managment Studio tells me there is an error near ')'
I know the error is after the PIVOT statement, but what the actual problem is, I don't know.
I would be very grateful if someone could point my mistake out to me.
Thanks
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
SELECT *
FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
AS TicketData PIVOT
(
SUM(ProductWeight) FOR ProductCode IN ([Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],FMeal],[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],[Skin],[Slurry],[Tail],[Tallow],TBottom],[Thigh],[TMeal],[Wash])
)
try that
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
Thanks for the reply, but your suggestion did not work.
I have now resolved the problem, and my final SELECT query now looks like this :-
SELECT * FROM
(
SELECT * FROM vuWeighTicketReport
WHERE [TicketDate] >= '2010-09-10'
) AS Tickets PIVOT
(
SUM(ProductWeight) FOR ProductCode IN
(
[Blood],[Bonecake],[Carcass],[CFat],[Desiel],[DMeal],[Feather],
[FMeal],[Greaves],[Head],[Misc],[Offal],[PBlend],[PFB],[PMeal],
[Skin],[Slurry],[Tail],[Tallow],[TBottom],[Thigh],[TMeal],[Wash]
)
) AS TicketProductWeights
The only difference to the original is that I have added AS TicketProductWeights to the end.
Typically, the problem was stiring me in the face, and I couldn't see it.
Thanks again.
Steve Jowett
-------------------------
Real Programmers don't need comments -- the code is obvious.
|
|
|
|
|
I need to develop a query that identifies all of the records from one table that are not contained within another table. Inner Joins will not work. I know that there is an approach that will do this but I do not remember it.
|
|
|
|
|
try
SELECT * FROM table1 WHERE field1 NOT IN (SELECT field2 FROM table2 WHERE ...)
|
|
|
|
|
|
select * from table1 a left outer join table2 b
on a.id=b.id
where b.id is null
This will give you all records in table1 that aren't in table2, assuming id is the common key.
|
|
|
|
|
There was a thread on here a few weeks ago about the merits of exists versus in versus outer join. I can't remember what the conclusion was and I can't find the thread now.
|
|
|
|
|
|
Yes, I took part. I prefer outer join -- because of portability and such.
|
|
|
|
|
Hi,
look im going to configure sql express 2008 for accepting remote connection, BUT, automically ... I mean the enduser will not set anything, after installing sql express it whould be configured for network connections and etc.
actually i need sql scripts for this...
|
|
|
|
|
As in a local Sql Express database that you just installed? Enabling is explained here[^], but a word of warning though; it allows Sql Express to receive commands that originate from another computr - and that might be someone with malicious intent.
If someone could get into the server without permission, chances are that they could execute scripts. That could include scripts that modify the filesystem and/or the registry!
Next point to consider; even if you install Sql Express with the option to allow remote connections to be made, there might still be a firewall disallowing it.
I are Troll
|
|
|
|
|
|
|
Hi guys, I have an old SSIS file which needs editing now. The problem is that the person who developed it has left and unfortunetly he used "User Key encryption".
Does anyone have any idea on how (if possible) can I get it back? I would really appreciate any type of help.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi,
I am creating one table and it has field like DetailInfo. Since the user can insert short or long details, I am wondering which particular datatype with maximum size to be used ? Well nvarchar has max 5000 but is there anyway i can use more than that size ? So shall I use nText or nvarchar in this case ?
thanks in advance
suchita
|
|
|
|
|
Which database?
If Sql Server, look into nvarchar(max).
|
|
|
|
|
|
Note that nText is going away in future SQL server releases. The nvarchar(max) should do what you want.
|
|
|
|
|
thanks. I used nvarchar(max). just trying to know which one holds large data like 2-3 pages. i haven't worked with large data before.
suchita
|
|
|
|
|
isit possible to encrypt a database in PostgreSQL or make it password protected so even admin of the server won't be able to open it without my permission..
I am planning to deploy a commercial software and I don't want people to go and view my database structure and rows?
|
|
|
|
|
Hi,
I am developing a hospital management system and I want to know what's best to choose as database? PostgreSQL or MySQL? and why?
|
|
|
|
|
It basically depends on the size of the hospital and the language in which you are gone write the application.
Check out this article: here.
Paul.
|
|
|
|
|