 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 5.00/5 (9 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 3.80/5 (55 votes) |
|
|
|
 |
|
 |
Hi!
I have recently published a website to a Windows 2008 x64 Server with SQL 2005 Express Edition. I am able to logon to the website but when I navigate to view employees for instance then I get the error 26 message.
I enabled the TCP/IP and Named Pipes Protocols, added SQL browser.exe to the firewall including port 1433 and 1434. I also checked to make sure SQL Browser is running.
Does anyone have any suggestions?
Illegal Operation
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Friends, i am trying to refresh a data base where i need to authenticate the user first with something similar window as we see in SQL client. can somebody help me here..
Thank you very much!
vikas da
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
So you are after a logon screen, try searching CP or Google, there are hundreds of examples. You should probably be asking this in the forum of your language choice (C#, VB, C++ etc).
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Drop database: The DROP DATABASE statement is used to delete a database. Everything is deleted ... tables, views, indexes, stored procedures, etc
Drop Table: The DROP TABLE statement is used to delete a table.
Truncate Table: Delete the data inside the table, and not the table itself
Use this as reference: http://www.w3schools.com/SQl/sql_drop.asp[^]
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hello
SSRS - web service interface generated pdf's with slightly different font/color compared to those pdf when access via "Direct URL access" (point browser to http://localhost/reports/SomeReport/SomeReport - then export by pdf).
Any idea why? Perhaps it has to do with DeviceInfo in Render method? What do I need to do so two are same?
Thanks
dev
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i have a crystal report which is bind with oledb database. tommorrow its working but now it show error that "Table could not found". i googled my problem and can't find any satisfactory solution if anyone knows it solution plz share with me. advance thnx 4 help
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Hi i have 2 tables.., one is master another one is child...,
ex:
Master=>Pid is primary key =========== Pid Name 1 m1 2 m2 3 m3 4 m4 5 m5 6 m6
Child=>Cid is primary key ========== Cid Pid Name 1 2 nm1 2 2 nm2 3 1 nm3 4 5 nm4 5 6 nm5
Now i need the lastest records...,
O/p: ====== Pid Cid Name 6 5 nm5 5 4 nm4 4 null m4 3 null m3 2 2 nm2 //in child table have 2 records for pid...,in tht latest is Cid=2 1 3 nm3
Thanks & Regards, Member 3879881, please don't forget to vote on the post
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Try this
declare @tblMaster table(pid int primary key,name varchar(20)) insert into @tblMaster select 1,'m1' union all select 2,'m2' union all select 3,'m3' union all select 4,'m4' union all select 5,'m5' union all select 6,'m6' declare @tblChild table(cid int primary key,pid int,name varchar(20)) insert into @tblChild select 1,2,'nm1' union all select 2,2,'nm2' union all select 3,1,'nm3' union all select 4,5,'nm4' union all select 5,6,'nm5'
select pid,cid,name from ( select m.pid ,c.cid ,case when c.name IS null then m.name else c.name end name ,row_number() over(partition by m.pid order by c.name desc) as rn
from @tblChild c full join @tblMaster m on c.pid = m.pid )x(pid,cid,name,rn) where rn = 1 order by pid desc
Niladri Biswas
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
whts tht row_number function?
Thanks & Regards, Member 3879881, please don't forget to vote on the post
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
This should do it
select m.pid,c.cid,c.name from Master m join Child c on c.pid = m.pid and c.cid = (select max(cid) from Child c1 where c1.pid = m.pid)
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Okay, someone straighten me out. I have two tables: [Budget] is the monthly budget for a bunch of accounts and [Account List] is (duh) the master list of accounts. I need to find the account names, [Twin Pack], that do not have any budget, ie no record exists, for a specified date, [Date].
Here's what I wrote:
SELECT [Account List].[Twin Pack] FROM [Account List] WHERE NOT EXISTS (SELECT Budget.[Twin Pack] FROM Budget WHERE (((Budget.Month)=DateValue([Date]))));
When I run it as is, it returns nothing. To troubleshoot, I put the subquery in a query by itself and got the desired results: the list of accounts that DO have budget in the specified month. Also, when I reversed the EXISTS statement by taking out the "Not", I also got the list of accounts that DO have budget in the specified month.
What am I missing?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You seem to have 2 disassociated queries here, one on Account List and another on Budget with no logic to join them.
[rant] Who in his right mind allows spaces in table/field names and what idiot allows reserved words to be used as field names (Date) [/rant]
SELECT [Account List].[Twin Pack] FROM [Account List] WHERE something NOT EXISTS (SELECT Budget.[Twin Pack] FROM Budget WHERE (((Budget.Month)=DateValue([Date]))));
also make sure your internal select returns the expected records (what is DateValue)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Mycroft Holmes wrote: Who in his right mind allows spaces in table/field names and what idiot allows reserved words to be used as field names (Date)
Yeah, I'm right up there on that soap box with ya. It's a linked table that someone else created. I could write some code to go change the field names, but this was supposed to be a quick and easy DB.
I found out what I was missing. I scrapped the first approach and did a Left Join on the two tables.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Try this
declare @tblAccountList table(TwinPack int) insert into @tblAccountList select 111 union all select 222 union all select 333 union all select 444 union all select 555 union all select 666 union all select 777 union all select 888 union all select 1100 declare @tblBudget table(TwinPack int,Mnth varchar(20)) insert into @tblBudget select 111,'Jan' union all select 222,'Feb' union all select 333,'Mar' union all select 444,'Apr' union all select 555,'May' union all select 666, 'Jun' union all select 777,'Jul' union all select 888 ,'Aug' union all select 999,'Sep' union all select 1000 ,'Oct' union all select 1100,'Nov' union all select 1200 ,'Dec'
SELECT a.TwinPack FROM @tblAccountList a except SELECT b.TwinPack FROM @tblBudget b WHERE b.Mnth = CONVERT(varchar(3),DATENAME(mm,GETDATE()))
Basically I am finding out the TwinPack from @tblAccountList where the budget is not in November. I am using Except here
Note- I have done the schema by myself which I hope is as per ur requirement.Else you please correct and I will again give a shot.
Hope this helps
Niladri Biswas
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Try this
SELECT [Account List].[Twin Pack] FROM [Account List] WHERE NOT EXISTS (SELECT 1 from Budget WHERE Budget.[Twin Pack] = [Account List].[Twin Pack] and Budget.Month=DateValue([Date])
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
So I have a table Invoices with ID type Guid. But the user wants to have a unique, human-friendly code, to go along w/ each row. Any good suggestions on how to implement this?
Should I have the client app check->generate->update, or should I have some sort of scalar function generate this (auto-compute column value). Maybe a trigger? Thoughts appreciated.
(running mssql'08)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Keep you guid as the primary key (I hate guids) and add a CustomerCode field, populate the initial set of data according to the clients needs and let the operator manage the code from then on.
NEVER and I mean not once do you use this field for anything but human UI searches, continue to use the guid as the key constraint for you data.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |