|
It's quite hard to say the exact solution with such small amount of data, but could you simply add the conditions to the inline view and use case to differentiate good, expired and damaged amounts. If I understood the idea correctly you would use double condition in case. Something like:
WHEN RECON_TYPE = 'CR' THEN ...
...
WHEN RECON_TYPE = 'DR' AND RECON_CODE NOT IN (8000, 9000) THEN ...
...
WHEN RECON_TYPE = 'DR' AND RECON_CODE = 8000 THEN ...
...
WHEN RECON_TYPE = 'DR' AND RECON_CODE = 9000 THEN ...
...
Also if you have the possibility to re-check the E/R-model, I think there would be easier ways to handle the data than how it's currently done.
|
|
|
|
|
Hello Friends,
I've a table in which there are two columns Name and Salary as described below.
Name Salary
A 100
B 200
C 300
D null
I want to increment the salary by 100 of all employees. For it i'm using the command given below
Update Rough Set Salary=Salary+100 Where Salary in (Select Salary From Rough)
But this query is just updating the Salary of A,B,C not of D because of null So can anybody let me know how to update the value of null as well
|
|
|
|
|
You could use COALESCE function. Something like:
Update Rough
Set Salary=COALESCE(Salary, 0) + 100
|
|
|
|
|
Well, firstly that where clause is bonkers. If you want to update all records you want to do away with that.
try this:
update Rough set Salary = isnull(Salary, 0) + 100
It's a good idea to avoid nullable columns where they're not appropriate or you end up having to do stuff like this all over the place.
Regards,
Rob Philpott.
|
|
|
|
|
Hi all,
Is Sql reporting Services will be faster compare to Crystal reports ?
can any one suggest me which tool is best for loading nearly lakhs of datas ??
which tool is best ?
can any one suggest me
|
|
|
|
|
|
Thank u for ur reply..Iam not asking u the differences between them
i know to google and find the difference..
Which tool is more faster i asked..Coz this is forum to get ideas from well versed people and fix soon
|
|
|
|
|
cbenan wrote: Which tool is more faster i asked..
I believe that this is a matter of design, usage scenario, datasources etc. Since both of those tools behave very differently it's quite impossible to predefine which one is faster. If you have an open situation meaning that you can build the reporting as you like, I would say that Reporting Services has more possibilities to do things since it's more like just a layout-engine. Crystal offers more built-in capabilities but on the other hand it's perhaps restricting you more than SSRS.
Also you should note that Crystal is an older product so it's more mature (in a way) and SSRS is still developing to it's full size. I guess this means that the situation is currently something, but after few years it may be a whole lot different. This affects if you're making a long term decision.
Just added performance keyword to the query and seems that there a some comparison on this aspect also: http://www.google.com/search?hl=en&q=compare+performance+crystal+sql+server+reporting+services[^]
|
|
|
|
|
Hi
I want to know how to write storedprocedure when search creiteria is Present.
Here the query to give the list of
"select ID, Salesmennummer , Salesname Commision, Areacode from sales_master
Areacode Salesmennummer Salesname Commision
1 1000 Rams 200
2 2000 Johny 1000
I Want to search above list by areacode or Salesmennummer or Salesname.
so PlZ help me how to write storedprocedure for this.
Thanq.
|
|
|
|
|
|
Hi,
I have install SQL server 2008 on my computer ,i have already SQL server 2005,now problem is that i am not able to connect it through enterprice manager.
N!dh!
|
|
|
|
|
Most likely the SQL Server 2008 is named instance so you should provide the server name as: machinename\instancename. You can check the instance name for example from Windows Services.
|
|
|
|
|
My server name is Nidhi\sqlexpress
N!dh!
|
|
|
|
|
so if you specify that to server name, what happens? Do you get an error and if you do, what kind of error.
|
|
|
|
|
Error is:
This version of MSSMSE can only be used to connect to sql server 2000 & 2005
N!dh!
|
|
|
|
|
|
I just started a new project and I need to work on the thing at home.
I have permission to take what I need but I'm not sure what I'm looking for?
I asked (and received) the Schema for the tables but whenever I try and run the SQL queries in the SQLServer query window I get all sorts of errors about missing LDF/MDF files:
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "D:\_SQL_LOG\AXXX_CLQ_Log.LDF" failed with the operating system error 2(The system cannot find the file specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 15010, Level 16, State 1, Procedure sp_dboption, Line 64
The database 'AXXX_CLQ' does not exist. Supply a valid database name. To see available databases, use sys.databases.
I'm wondering if it wouldn't be easier to just copy the actual files and move them into position? Unfortunately it looks as though the LOG files and data files are stored on different partitions and at home I only have one.
How can I be sure to get a full copy of everything so it's easy to setup at home and get working on this in the evening?
Cheers,
Alex
|
|
|
|
|
Hi,
there are a couple of possibilities:
1. change your fixed paths to something that exists on every relevant system, so if one doesn't have a D: then
don't use D: anywhere
2. make the paths configurable somehow, so you can run the app with different paths on different machines;
3. add a D: partition to the machine that lacks one (Vista does not need a tool to do this, i.e. Computer Management
can solve this;XP and earlier get changed most easily using Partition Magic or something similar)
4. on the machine(s) lacking D: use "Map network drive" to map D: to some existing folder on C: (see Explorer,
Tools menu).
In the short term I recommend 4; in the long term I would go for 2.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: change your fixed paths to something that exists on every relevant system, so if one doesn't have a D: then
don't use D: anywhere
Thing is all I have is the schema SQL file not the files which the schema seems to refer. Can I create empty files and assume that would work?
|
|
|
|
|
hat do you actually mean by schema? Do you refer to the MDF-file? If yes, then how have you taken it. Is it detached, just copied etc.
|
|
|
|
|
Hi all. Is there a way to automatically grant execute permissions on CLR stored procedures upon deployment from a Visual Studio SqlServer project?
I have a solution with a project for all my Sql Server stored procs, and a second project for a web site that tests them. When I rebuild/run the web site, the stored procedure assembly is rebuilt and re-deployed also (which is good) but because the stored procedures are recreated, the GRANT permissions previously on them are lost (which is not so good). I'd like to have the GRANT EXECUTE permissions added as an automatic part of the deployment process, if that is possible.
Help?
|
|
|
|
|
Instead of rebuilding (dropping and creating) the procedures, could you use ALTER PROCEDURE syntax? If that's not an option, perhaps you could include a plain script to the deployment (depending how you do the deployment).
|
|
|
|
|
Mika Wendelius wrote: Instead of rebuilding (dropping and creating) the procedures, could you use ALTER PROCEDURE syntax? If that's not an option, perhaps you could include a plain script to the deployment (depending how you do the deployment).
If I were writing the deployment script, then sure, but I was hoping to stay within Visual Studio - it's just a lot more convenient to click the "run" button, have it go through the build and deployment, and run the web app. I was hoping that I've missed an option along the way that supports the execution of custom SQL scripts upon deployment... or some other means of addressing the stored procedure permissions. I haven't found anything like that in VS.
You know, something like "Deployment Events..." similar to "Build Events..." would be exactly the thing.
|
|
|
|
|
Have you tried post build events? I'm not sure, but I think it's run as the last operation in building sequence.
I did a little test and it seems that the post build command line (or actually I used a script) was run after the full build was done, but I think I may have a different situation since the target directory was actually the web folder.
|
|
|
|
|
Mika Wendelius wrote: Have you tried post build events? I'm not sure, but I think it's run as the last operation in building sequence.
I did a little test and it seems that the post build command line (or actually I used a script) was run after the full build was done, but I think I may have a different situation since the target directory was actually the web folder.
Hi Mika. Thanks for the replies. I guess that might work - a post-build event on the web project that issues the GRANT EXECUTE statements to the server... I can try that.
It just seems like there should be a way to do this when compiling and deploying the stored procedures themselves, but the above might be a workaround.
Thanks again.
|
|
|
|