I have 3 different companies that share the same ticket_types(CRMS System). I need to display the Ticket Types and the 3 company's Ticket Count:
Ticket Type | Company A Count | Company B Count | Company C Count
I can get the information individually for each company, but if a company doesn't have a ticket in one of the ticket_types, then it isn't displayed in a row. So, I tried to write the following, which isn't pulling back any data.
DECLARE @startdate date = '20150306' DECLARE @enddate date = '20151031' DECLARE @AcctGrp varchar(20) = '111' ;WITH TType AS ( SELECT ctp.description as TicketType
[Code] .....
If I run each SELECT individually from above (excluding the last SELECT), it works and I get the following:
TicketType AR Request Credit Availability/Rush Cancel Order Credit Card Payment Expedite Order Freight Quote
[Code] ...
How to get the query results? Am I even close to getting it right?
I have an issue where i am mandated to enforce RI on an applications database (a good thing). but I have several common lookup tables where many of the "codes" reside for many different code types. I also have the mandate that i cannot change the underlying DDL to make composite keys to match the codes table PK. I am currently looking at creating indexed views on top of the Codes table to seperate the logical tables it contains. This is several hundred views.
I do know that I do not want to write several hundred triggers to enforce RI. Table schema below, the CdValue column is the column that is used throughout the hundreds of tables that use this codes table, and their corresponding column is not named the same.
CREATE TABLE dbo.CodesTable ( PartyGrpId INT NOT NULL , CdTyp VARCHAR ( 8 ) NOT NULL , CompId INT NOT NULL , CdValue VARCHAR ( 8 ) NOT NULL , CdValueDesc VARCHAR ( 255 ) NULL , AltValueDesc VARCHAR ( 100 ) NULL
[Code] ....
I did though run into one forum where a person brought up a great idea. Filtered Foreign Keys, what a novel concept, if it could work it would make so much less code to fix an issue like this.
ALTER TABLE dbo.BusinessStatus WITH NOCHECK ADD CONSTRAINT FK_dbo_BusinessStatus_CodesTable FOREIGN KEY (LoanStsDtCd) REFERENCES dbo.CodesTable (CdValue) WHERE CdTyp = 'Status'
Got a query taking too much time because of lack of cross columns MAX/MIN functions. Consider a similar example where a View is required to reflect distribution of Water among different towns each having four different levels of distribution reservoir tanks of different sizes:In this case the basic table has columns like:
Now suppose I need a query to distribute QuantityPurchased in the Four additional Columns computed on the basis depending on the sizes declared in the last four fields,in the same order of preference.For example: I have to use IIFs to check: whether the quantity purchased is less than Tank_A if yes then Qty Purchased otherwise Tank_A_Size itself for Tank_A_Filled
then again IIF but this time to check:
Whether the quantity purchased less Tank_A_Filled (Which again needs to be calculated as above) is less than Tank_B if yes then Tank_A_Filled (Which again needs to be calculated as above) otherwise Tank_B_Size itself for Tank_B_Filled
Are there any features in 6.5 that have been discontinued in 7.0? I read in Technet that "future versions of SQL Server might not support some statements where the same functionality can be achieved using other means." Technet gave the following examples:
- Device Mirroring - Outer Join Syntax - SELECT FOR BROWSE - Handling of NULLs
I`m curious how our applications will be effected. Will we be making a lot of code changes when we migrate to 7.0?
Morning! Folks, i want some links where i could find healthy stuff regarding New Features and Compliance levels, performance comparisons, TPC tests etc about SQL 2000 and Yukon specially. I've to submit a document regarding Top database features that shall be used for a Medical-Billing Software in plan.
Can any one give me the details of the Security level or measure which are supported my MS Sql Server. How much it is security while we are accessing any database over the internet and what are the Security measure we have to take and level did Software provides. It is URGENT
Since I am new to DTSs therefore currently I am making my DTSs in a manner where there probably is a room for improvement e.g. When I have to Import data from one server to another I use the Import feature and then I go through all the steps of the wizard (at the end of which I get the option to save my DTS)....
In the DTS "design window" there are many options under the TASK menu option and is there a url from where I can learn how to use these options (under TASK i.e. File Transfer Protocaol task, ActiveX Script Task, Transform Data Task, etc. etc.).
Maybe if I know how to use these options, I might be able to write my DTS in better and flexible manner...
Since I am new to DTSs therefore currently I am making my DTSs in a manner where there probably is a room for improvement e.g. When I have to Import data from one server to another I use the Import feature and then I go through all the steps of the wizard (at the end of which I get the option to save my DTS)....
In the DTS "design window" there are many options under the TASK menu option and is there a url from where I can learn how to use these options (under TASK i.e. File Transfer Protocaol task, ActiveX Script Task, Transform Data Task, etc. etc.).
Maybe if I know how to use these options, I might be able to write my DTS in better and flexible manner...
What are the major differences between SQL SERver 7 and 2000 ? Looking for a job and found a position where the client prefers the database developer specifically expericenced in SQL 2000. What is really so hot and important to know?
I have simple package and trying to use the security feature of ssis. I set the protection level as "EncryptSensitiveWithPassword" and also specify the password. But it doesn't prompts me for the password. Can anybody help me in that?
I've been having trouble getting my RS2005 reports with interactive features (drilldowns) to work in an Iframe and rendered with SOAP.
The main problem now is that the toggle buttons (+ / -) point to the reporting services server and do a URL Access call. I've tried the <ReplacementRoot> element in the DeviceInfo parameter but it doesn't appear to do anything.
I keep on reading about how everything is possible through the web services but it looks as if these interactive features are only available using the URL Access. Is this true?
Hi All, Just curious about the features that are not available in the Express version. Can you import data from other sources? Can you perform DTS packages?
I was given what at first seemed a simple task (and maybe it is, but with everything else on my plate, I can't seem to get my head wrapped around this)...create a grid or table something similar to below: Plan A Plan B PlanC PlanD Item1 yes yes no no Item2 yes yes no no Item3 yes no yes no etc.....
The "plans" are stored in one db table, the "items" in another. What I can't seem to get straight in my mind is how to relate the yess and nos and then generate a tabular layout similar to the above. I don't need anyone to do it for me, but a push in the right direction would sure be nice (using SQL 2005) Thanks!
Hi folks,My fellow team mates had some extra time on their hands so we decided tospice up DB2 with a grab-bag of compatibility features.We wouldn't mind help validating the semantics match....So for those of you blessed or cursed with a competitive DBMS here is alist of what we've added:1. ** DUALAlways works without prefixing a schema2. ** ROWNUM3. ** (+) outer join syntax4. LEAST/GREATEST/NVL/DECODE5. TO_DATE/TO_CHAR improvementDB2 supports most common patterns except those requiring languageawareness6. ** CONNECT BYThis is a function drop, performance drop will follow7. A slew of syntactic sugar like:Seq.NEXTVAL and seq.CURRVAL notationUNIQUE instead of DISTINCTMINUS instead of EXCEPTUnnamed nested subqueries (aka inline views)"SELECT * FROM (SELECT * FROM T)"CROSSJOIN8. BITAND/BITOR/.....The features marked with ** require a registry setting:db2set DB2_COMPATIBILITY_VECTOR=3Fshould switch everything on.There are other features those porting apps will value:GLOBAL VARIABLESA new ARRAY data typeA new RID() function can be used to map ROWIDDocs: https://publib.boulder.ibm.com/info.../v9r5/index.jspEnjoySerge--Serge RielauDB2 Solutions DevelopmentIBM Toronto Lab
If I have an instance of SQL Server 2005 Workgroup, am I able to run simple ETL packages against it? By simple I mean:
1. Extract data from a comma separated flat file.
2. Load the flat file data to an Access (2002/2003) database.
3. Load the flat file data to a SQL 2005 table.
4. Execution of .dtsx package.
5. Ways to execute a package (i.e. can schedule a package to be run with the SQL Server Agent)?
6. Notification (i.e. SMTP email) on events from package (i.e. on error).
I have been using the Developer Edition, which I know has all/most of the features of Enterprise. How do the SSIS features change between Developer and Workgroup editions?
I am looking to find more information regarding advanced filtering/report parameters available in SQL Server 2005 Reporting Services. From what I can see, the user can set values for each report parameter and the query defaults to "where x = (param 1) and y = (param 2)" etc. Is there a way that a user can pick parameters that structure a more complex where clause? For example, say I want to filter by all clients enrolled in all of these 3 service programs and have a dog or clients not enrolled in one of the following 3 care programs or clients who live in one of the following cities? So it would be like this:
where (((sp = 1 and sp = 2 and sp = 3) and animal = dog) or ((cp not in (1, 2, 3)) or city in (a, b, c, d)))
In addition, I am looking for more information regarding programmatic capabilities in Reporting Services. Can anyone point me to a good place for this information? I would like to know whether we could structure part of a query in VB.NET code and then pass this query to Reporting Services to join with the basic report query. Also, I would like to know Reporting Services' capability to interact with stored procedures.
In addition, is Reporting Services more for internal business reporting, or do companies add it onto their existing software package to sell to external customers? Does Reporting Services allow one report to be created, and then users (our customers) on different servers who use different databases to run the report by giving Reporting Services their credentials (database, SQL Server login, etc)?
Basically, I have just been following the tutorials on Microsoft's site, but they are all pretty basic so I haven't gotten a good feel for whether this product is good for advanced reporting needs.
Hello, I've installed SQLServer2k5 Sept CTP with the following config: W2K SP4 Pro, SQL2K5 Std Sept CTP complete clean install. Everything works except SAC for features. I get the error below when trying to start it. SAC for Services & Connections connects without problem and has local & remote connections via both TCP/IP and Named Pipes enabled for the server, and local & remote connections enabled for analysis services. All SQL2K5 components & services are started in the Services control panel. I've looked at port useage, wondering if some other process is using the port that SAC for features is pinging, but since SAC for Services & Connections works fine that doesn't seem to be culprit. I also get an error when running the Tuning Advisor, saying it can't connect, but demoted that to just a warning by closing some extraneous connections to the servere (had >10 open). Still get a warning, but it doesn't prevent the Tuning Advisor from completing. I've tried turning on and off various services, from Remote Registry Service to IIS, but no luck. Anyone know what else I chould check to troubleshoot this? Thanks! Failed to connect to server localhost
The BIDSHelper team are please to announce that we have just release v1.2 which includes a number of new SSIS features. BIDSHelper is a free add-in for the BI Development Studio that adds a number of useful features.
www.codeplex.com/bidshelper
For any current users of BIDS Helper, you can see a list of the new features on the download page for this release http://www.codeplex.com/bidshelper/Release/ProjectReleases.aspx
Hi Experts ! I want to use maximum feature of SQL Server 2005 and ASP.Net 2.0 in making Data Access LayerSuggestions will be welcomed .Thank you RegardsKAMRAN
We have 2005 Standard Edition in our production environment and 2005 Developer Edition in dev. Recently we started using a feature in dev only to realize it was an Enterprise specific feature when we wanted to move it to prod. Is there any way to turn off the enterprise features in developer edition so it behaves just like standard edition?