Search Results

Search found 4908 results on 197 pages for 'ssas 2005'.

Page 86/197 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • More efficient left join of big table

    - by Zeus
    Hello, I have the following (simplified) query select P.peopleID, P.peopleName, ED.DataNumber from peopleTable P left outer join ( select PE.peopleID, PE.DataNumber from formElements FE inner join peopleExtra PE on PE.ElementID = FE.FormElementID where FE.FormComponentID = 42 ) ED on ED.peopleID = P.peopleID Without the sub-query this procedure takes ~7 seconds, but with it, it takes about 3minutes. Given that table peopleExtra is rather large, is there a more efficient way to do that join (short of restructuring the DB) ?

    Read the article

  • Passing delimited string to stored procedure to search database

    - by rs
    How can i pass a string delimited by space or comma to stored procedure and filter result? I'm trying to do something like - Parameter Value -------------------------- @keywords key1 key2 key3 Then is stored procedure i want to first find all records with first or last name like key1 filter step 1 with first or last name like key2 filter step 2 with first or last name like key 3

    Read the article

  • Stored procedure does not return result when using Temp table

    - by Muhammad Akhtar
    I have used temp table in my stored procedure and unable to get the result when executing. It return result fine when running the same as query. my query structure is something like... ALTER PROCEDURE [dbo].[test] as begin SET NOCOUNT ON; SELECT * INTO #Dates FROM Dates -- Used temp table SET @Query = ' SELECT [Name], [HotelName], '+@Dates+' FROM ( SELECT , HD.[Name], HD.[HotelName], HD.Price FROM #Dates D LEFT JOIN #HotelData HD ON D.DateVal = HD.OccDate) T PIVOT ( SUM(Price) FOR [Date] IN ('+@Dates+') ) AS PT' execute(@Query) end Exec test -- Exectuting, I am getting message command completed successfully

    Read the article

  • ROW_NUMBER Alt in SQL Server 2000

    - by harekam_taj
    Hey Guys, Can anyone please help me with an alt. to ROW_NUMBER in SQL Server 2000. RIGHT now my procedure looks like this in SQL Server 2008 WITH cars as(SELECT carid,mileage,retailprice,imageurl,model,year, Zips.Distance AS Miles, Manufacturers.mfgName as Make,dealers.companyname as companyname, CASE @sortby WHEN 'D' THEN ROW_NUMBER() OVER (ORDER BY Manufacturers.mfgName) WHEN 'P' THEN ROW_NUMBER() OVER (ORDER BY retailprice) WHEN 'M' THEN ROW_NUMBER() OVER (ORDER BY mileage) END as 'rownum' FROM usedcars INNER JOIN #TempZips Zips ON Zips.ZipCode =usedcars.loczip left join Manufacturers on Manufacturers.mfgid=usedcars.mfgid left join dealers on dealers.dealerid = usedcars.dealerid where usedcars.active=1 and usedcars.dealerid=@dealerid) select @totalrecords as totalrec,* from cars where rownum between @skip and @take

    Read the article

  • Filtering coluns in SQL Server replication - how?

    - by truthseeker
    Hi, I need to replicate some data from two tables in one database to another databases. I used snapshot replication. The issue is that I would like to replicate only some selected columns and the others should stay with untouched data. I don't want to loose their data. The sours of those columns is other system. So I need to replicate only data from my columns. Do anybody know how to achieve this?

    Read the article

  • How would I design this table in SQL?

    - by RSharma
    I have a parent master table that is generic enough to hold the common information of the children. Since the children were substantially different, we created separate tables for them. So I have something like this: tblMaster -------- MasterID int Name varchar(50) --Common to all children and there are a bunch of fields like this ChildType int -- Type of Child either ChildOne or ChildTwo ChildID int -- need to store ChildOneID or ChildTwoID depending on type of Child, so that i can refer to children tblChild1 -------- ChildOneID int IDENTITY tblChild2 --------- ChildTwoID int IDENTITY Should I have a ChildID in the master that is either ChildOneID or ChildTwoID based on the ChildType column? I have a number of children and I have simplified it for this question. The other way is to add ChildOneID and ChildTwoID as columns in the master, but since i have a number of columns, I will have a lot of null columns EDIT: Any help is appreciated

    Read the article

  • Committing Transaction

    - by Costa
    Hi http://msdn.microsoft.com/en-us/library/ms189797.aspx In this link they are committing a transaction within catch clause IF (XACT_STATE()) = 1, I don't get it, if there is an error why they are committing it? even if the problem in select statement and there is no big deal committing it, why don't just roll it back. Thanks

    Read the article

  • show two detail section's data in crystal report

    - by Parkash
    How can display two detail section's data after completion of first detail section in crystal report of vb2005 like detail of first detailsection #one row.........................." #second row........................." #three row.........................." detail of second detailsection #"one row.............." #"second row..............." #"data of third row.............."

    Read the article

  • How to track auto-generated id's in select-insert statement

    - by k rey
    I have two tables detail and head. The detail table will be written first. Later, the head table will be written. The head is a summary of the detail table. I would like to keep a reference from the detail to the head table. I have a solution but it is not elegant and requires duplicating the joins and filters that were used during summation. I am looking for a better solution. The below is an example of what I currently have. In this example, I have simplified the table structure. In the real world, the summation is very complex. -- Preparation create table #detail ( detail_id int identity(1,1) , code char(4) , amount money , head_id int null ); create table #head ( head_id int identity(1,1) , code char(4) , subtotal money ); insert into #detail ( code, amount ) values ( 'A', 5 ); insert into #detail ( code, amount ) values ( 'A', 5 ); insert into #detail ( code, amount ) values ( 'B', 2 ); insert into #detail ( code, amount ) values ( 'B', 2 ); -- I would like to somehow simplify the following two queries insert into #head ( code, subtotal ) select code, sum(amount) from #detail group by code update #detail set head_id = h.head_id from #detail d inner join #head h on d.code = h.code -- This is the desired end result select * from #detail Desired end result of detail table: detail_id code amount head_id 1 A 5.00 1 2 A 5.00 1 3 B 2.00 2 4 B 2.00 2

    Read the article

  • Does Msbuild recognise any build configurations other than DEBUG|RELEASE

    - by Dean
    I created a configuration named Test via Visual Studio which currently just takes all of DEBUG settings, however I employ compiler conditions to determine some specific actions if the build happens to be TEST|DEBUG|RELEASE. However how can I get my MSBUILD script to detect the TEST configuration?? Currently I build <MSBuild Projects="@(SolutionsToBuild)" Properties="Configuration=$(Configuration);OutDir=$(BuildDir)\Builds\" /> Where @(SolutionsToBuild) is a my solution. In the Common MsBuild Project Properties it states that $(Configuration) is a common property but it always appears blank? Does this mean that it never gets set but is simply reserved for my use or that it can ONLY detect DEBUG|RELEASE. If so what is the point in allowing the creation of different build configurations?

    Read the article

  • SQL Temp Tables & Replication

    - by Refracted Paladin
    I have had an issue with our replication process and would like to salvage some data. I have a process in place where I will connect to each subscriber before flagging them for reinitialization and I will run the below to pull any data they may have entered in during the "dark time". I am pretty sure this will work in a vanilla palace. What I am unsure of is whether the Global Temporary Table will persist through DB Replication. To be clear, I am not trying to Replicate the TempTable, I just want to make sure it will still exist at the local DB after the Replication so I may run the INSERT from it. Thoughts? USE MemberCenteredPlan -- Select Data from tblPLan SELECT * INTO ##MyPlan FROM tblPlan WHERE PlanID = 407869 --------------------------- -- Run Replication Process --------------------------- -- Insert Plan back into DB INSERT INTO tblPlan SELECT * FROM ##MyPlan WHERE PlanID = 407869 -- Drop Global Temp Table DROP TABLE ##MyPlan --------------------------- -- Run Replication Process ---------------------------

    Read the article

  • if else within CTE ?

    - by stackoverflowuser
    I want to execute select statement within CTE based on a codition. something like below ;with CTE_AorB ( if(condition) select * from table_A else select * from table_B ), CTE_C as ( select * from CTE_AorB // processing is removed ) But i get error on this. Is it possible to have if else within CTEs? If not is there a work around Or a better approach. Thanks.

    Read the article

  • "select * into table" Will it work for inserting data into existing table

    - by Shantanu Gupta
    I am trying to insert data from one of my existing table into another existing table. Is it possible to insert data into any existing table using select * into query. I think it can be done using union but in that case i need to record all data of my existing table into temporary table, then drop that table and finally than apply union to insert all records into same table eg. select * into #tblExisting from tblExisting drop table tblExisting select * into tblExisting from #tblExisting union tblActualData Here tblExisting is the table where I actually want to store all data tblActualData is the table from where data is to be appended to tblExisting. Is it right method. Do we have some other alternative ?

    Read the article

  • compilation error in vc++ vs2005

    - by vijay.j
    I am getting an error while compiling in vc++ vs2005. error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl MsgBox(char const *,char const *,...)" (?MsgBox@@YAXPBD0ZZ)

    Read the article

  • Database maintenance, big binary table optimization

    - by jgemedina
    Hi i have a huge database, around 1 TB in size, most of the space is consumed by a table which stores images, the tables has right now almost 800k rows. server response time has increased, i would like to know which techniques should i use or you recomend, partitioning? o how to reorganize the table every row is accessed by the image id column, and it has its clustered index by that column, and every two days i reorganize the index and every 7 days i rebuild it, but it seems not to be working any suggestions?

    Read the article

  • How to position columns in select list based on a variable.

    - by Rohit
    I am creating a dynamic grid which is created by selecting the format defined in the below XML.My select list includes all columns in this XML,I want to position these columns columns on the basic of position attribute in XML. <gridFormat> <column property="CustomerID" dbName="CustName" HeaderText="Customer" IsVisible="0" Position="1" /> <column property="CustomerName" dbName="FacilityName" HeaderText="Facility" IsVisible="1" Position="3" /> <column property="FacilityInternalID" dbName="Pname" HeaderText="Patient" IsVisible="1" Position="2" /> </gridFormat> I cannot select them in the order specified by the position attribute. I can do it in C# by looping around the returned datatable and specifically position columns using datatable.columns.setordinal() method. Is there any better way in SQL or C# to accomplish this.

    Read the article

  • Consecutive build of VS2005 and VS2008 C++ projects causes LNK1104 error

    - by TestAccount
    I have VS2005 and VS2008 installed on the same machine. I also have a common codebase that I build using both '05 and '08. For this purpose, I have 2 VC projects.. A '08 project called XYZ_2008.vcproj and a '05 project called XYZ_2005.vcproj, and the corresponding 2 slns as well. Both projects output dlls, libs and pdbs to the same output directory (all with appropriate _2005 and _2008 suffixes). Assuming that I am starting from a clean state, I first open XYZ_2005.sln (containing XYZ_2005.vcproj) in VS2005 and build it successfully. Then I close VS2005. Next, I open XYZ_2008.sln (containing XYZ_2008.vcproj) and build (not rebuild) it. At this point, I get an error saying: LINK : fatal error LNK1104: cannot open file 'mfc80u.lib' If now I rebuild the '08 solution, the error goes away and the build succeeds. The build also succeeds if I directly do a rebuild instead of a build for the '08 sln. In spite of everything being separate, the VS08 build seems to be picking up a MFC8 file (from VS05) instead of a MFC9 file. Can somebody please help out with this issue? Thanks in advance!

    Read the article

  • How do you manage your sqlserver database projects for new builds and migrations?

    - by Rory
    How do you manage your sql server database build/deploy/migrate for visual studio projects? We have a product that includes a reasonable database part (~100 tables, ~500 procs/functions/views), so we need to be able to deploy new databases of the current version as well as upgrade older databases up to the current version. Currently we maintain separate scripts for creation of new databases and migration between versions. Clearly not ideal, but how is anyone else dealing with this? This is complicated for us by having many customers who each have their own db instance, rather than say just having dev/test/live instances on our own web servers, but the processes around managing dev/test/live for others must be similar.

    Read the article

  • building list of child objects inside main object

    - by Asdfg
    I have two tables like this: Category: Id Name ------------------ 1 Cat1 2 Cat2 Feature: Id Name CategoryId -------------------------------- 1 F1 1 2 F2 1 3 F3 2 4 F4 2 5 F5 2 In my .Net classes, i have two POCO classes like this: public class Category { public int Id {get;set;} public int Name {get;set;} public IList<Feature> Features {get;set;} } public class Feature { public int Id {get;set;} public int CategoryId {get;set;} public int Name {get;set;} } I am using a stored proc that returns me a result set by joining these 2 tables. This is how my Stored Proc returns the result set. SELECT c.CategoryId, c.Name Category, f.FeatureId, f.Name Feature FROM Category c INNER JOIN Feature f ON c.CategoryId = f.CategoryId ORDER BY c.Name --Resultset produced by the above query CategoryId CategoryName FeatureId FeatureName --------------------------------------------------- 1 Cat1 1 F1 1 Cat1 2 F2 2 Cat2 3 F3 2 Cat2 4 F4 2 Cat2 5 F5 Now if i want to build the list of categories in my .Net code, i have to loop thru the result set and add features unless the category changes. This is how my .Net code looks like that builds Categories and Features. List<Category> categories = new List<Category>(); Int32 lastCategoryId = 0; Category c = new Category(); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { //Check if the categoryid is same as previous one. //If Not, add new category. //If Yes, dont add the category. if (lastCategoryId != Convert.ToInt32(reader["CategoryId"])) { c = new Category { Id = Convert.ToInt32(reader["CategoryId"]), Name = reader["CategoryName"].ToString() }; c.Features = new List<Feature>(); categories.Add(c); } lastCategoryId = Convert.ToInt32(reader["CategoryId"]); //Add Feature c.Features.Add(new Feature { Name = reader["FeatureName"].ToString(), Id = Convert.ToInt32(reader["FeatureId"]) }); } return categories; } I was wondering if there is a better way to do build the list of Categories?

    Read the article

  • VS2005 Compilation Problem with Settings

    - by vijay.j
    I am trying to integrate PJNSMTPCONNECTION CLASSES in my project; they say that those classes do not use MFC. My project is with the setting like MT, and using standard library linking. When I try to compile, I am getting CSTRING not defined and fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h> If I include afx.h and remove windows.h, I am getting iDLLMain already defined errors. How do I resolve these problems, please?

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >