Search Results

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

Page 83/197 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Return unordered list from hierarchical sql data

    - by Milan
    I have table with pageId, parentPageId, title columns. Is there a way to return unordered nested list using asp.net, cte, stored procedure, UDF... anything? Table looks like this: PageID ParentId Title 1 null Home 2 null Products 3 null Services 4 2 Category 1 5 2 Category 2 6 5 Subcategory 1 7 5 SubCategory 2 8 6 Third Level Category 1 ... Result should look like this: Home Products Category 1 SubCategory 1 Third Level Category 1 SubCategory 2 Category 2 Services Ideally, list should contain <a> tags as well, but I hope I can add it myself if I find a way to create <ul> list. EDIT 1: I thought that already there is a solution for this, but it seems that there isn't. I wanted to keep it simple as possible and to escape using ASP.NET menu at any cost, because it uses tables by default. Then I have to use CSS Adapters etc. Even if I decide to go down the "ASP.NET menu" route I was able to find only this approach: http://aspalliance.com/822 which uses DataAdapter and DataSet :( Any more modern or efficient way?

    Read the article

  • How to index a table with a Type 2 slowly changing dimension for optimal performance

    - by The Lazy DBA
    Suppose you have a table with a Type 2 slowly-changing dimension. Let's express this table as follows, with the following columns: * [Key] * [Value1] * ... * [ValueN] * [StartDate] * [ExpiryDate] In this example, let's suppose that [StartDate] is effectively the date in which the values for a given [Key] become known to the system. So our primary key would be composed of both [StartDate] and [Key]. When a new set of values arrives for a given [Key], we assign [ExpiryDate] to some pre-defined high surrogate value such as '12/31/9999'. We then set the existing "most recent" records for that [Key] to have an [ExpiryDate] that is equal to the [StartDate] of the new value. A simple update based on a join. So if we always wanted to get the most recent records for a given [Key], we know we could create a clustered index that is: * [ExpiryDate] ASC * [Key] ASC Although the keyspace may be very wide (say, a million keys), we can minimize the number of pages between reads by initially ordering them by [ExpiryDate]. And since we know the most recent record for a given key will always have an [ExpiryDate] of '12/31/9999', we can use that to our advantage. However... what if we want to get a point-in-time snapshot of all [Key]s at a given time? Theoretically, the entirety of the keyspace isn't all being updated at the same time. Therefore for a given point-in-time, the window between [StartDate] and [ExpiryDate] is variable, so ordering by either [StartDate] or [ExpiryDate] would never yield a result in which all the records you're looking for are contiguous. Granted, you can immediately throw out all records in which the [StartDate] is greater than your defined point-in-time. In essence, in a typical RDBMS, what indexing strategy affords the best way to minimize the number of reads to retrieve the values for all keys for a given point-in-time? I realize I can at least maximize IO by partitioning the table by [Key], however this certainly isn't ideal. Alternatively, is there a different type of slowly-changing-dimension that solves this problem in a more performant manner?

    Read the article

  • Adding values from different tables

    - by damdeok
    Friends, I have these tables: Contestant Table: Winner Peter Group Table: Id Name Score Union 1 Bryan 3 77 2 Mary 1 20 3 Peter 5 77 4 Joseph 2 25 5 John 6 77 I want to give additional score of 5 to Peter on Group Table. So, I came up with this query. UPDATE Group SET Score = Score+5 FROM Contestant, Group WHERE Contestant.Winner = Group.Name Now, I want also to give additional score of 5 to the same Union as Peter which is 77. How can I integrate it as one query to my existing query?

    Read the article

  • How can I programmatically drop a SQL Server database from .NET code

    - by Craig Shearer
    I'm trying to drop a SQL Server database from .NET code. I've tried using the SMO classes but get an exception saying the database is in use. Then I tried executing a query (opening a SqlConnection, executing a SqlCommand), along the lines of: ALTER DATABASE foo SET SINGLE_USER WITH ROLLBACK IMMEDIATE (pause) DROP DATABASE foo But still I get an exception saying the database is in use. How do I do this? (Or, how does SQL Server Management Studio implement the Drop database and close existing connections?)

    Read the article

  • SSRS Report Manager Report names

    - by Adam
    Is it possible to have SSRS's Report Manager display a report name that is not the .RDL file name? I.E. I have a Report .RDL named "MyReportAboutSomeImportantStuff.RDL" but I want the Report Manager to display this user friendly as "My Report About Some Important Stuff."

    Read the article

  • Unique id of a column

    - by Kayes
    Hi. Does each column of a table in SQL Server have a unique id? I've looked into sys.columns and the column_id there is merely the order of the columns which changes if the order of the column is changed. I'd like to know if SQL Server maintains a unique id for each column as it does for each table and other objects. And if it does, how can I get that? Thanks.

    Read the article

  • SSIS - Can I get the column schema for a flat file source from a database?

    - by Steve Clement
    We receive a nightly data export from a vendor in the form of about 10 tab-delimited flat file without column headers. In addition, the vendor provides us with the SQL scripts for the database tables so that we can import the files into our system. Unfortunately, the vendor recently changed the schema for the flat files. Each file has upwards 150 columns, and having to go through the DB schema and adjust column types on a Flat File Data Source in SSIS is extremely time consuming, not to mention a royal pain. Since I know the file data layout in the database schema, is there any way I can dynamically pull that into a Flat File source to set the columns correctly? Or am I just stuck with manually setting everything?

    Read the article

  • how to insert record in database with each date of month on single button click ?

    - by Mr. Goo
    I have two textbox .... textbox1 and textbox2 textbox1 == choose from date textbox2 == choose to date if user select from date in textbox1 as 01-May-2011 and in textbox2 as 30-May-2011 then all the dates from 01-MAy-2011 to 30-May-2011 will be inserted in each row of mssql2005 datatable... example. . : IN database Table1 structure ... ID Date 1 01-MAy-2011 2 02-MAy-2011 3 03-MAy-2011 4 04-MAy-2011 5 05-MAy-2011 and so on till 30-May-2011

    Read the article

  • String or binary data would be truncated -- Heisenberg problem

    - by harpo
    When you get this error, the first thing you ask is, which column? Unfortunately, SQL Server is no help here. So you start doing trial and error. Well, right now I have a statement like: INSERT tbl (A, B, C, D, E, F, G) SELECT A, B * 2, C, D, E, q.F, G FROM tbl ,othertable q WHERE etc etc Note that Some values are modified or linked in from another table, but most values are coming from the original table, so they can't really cause truncation going back to the same field (that I know of). Eliminating fields one at a time eventually makes the error go away, if I do it cumulatively, but — and here's the kicker — it doesn't matter which fields I eliminate. It's as if SQL Server is objecting to the total length of the row, which I doubt, since there are only about 40 fields in all, and nothing large. Anyone ever seen this before? Thanks. UPDATE: I have also done "horizontal" testing, by filtering out the SELECT, with much the same result. In other words, if I say WHERE id BETWEEN 1 AND 100: Error WHERE id BETWEEN 1 AND 50: No error WHERE id BETWEEN 50 AND 100: No error I tried many combinations, and it cannot be limited to a single row.

    Read the article

  • How to get Master and Slave Table data in one row using SQL Server ?

    - by Space Cracker
    I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has a FK from 'Employee'. Each row in 'Employee' can have zero or many rows in 'EmployeeTypes' and I want to make an SQL Query that returns data of all Employees and each employee row should contain its related data in 'EmployeeTypes' (for example column called 'TypeID') as a comma separated list, like this: Meco Beco --- 45 ---- 1,2,3

    Read the article

  • INSERT statement conflicted with the FOREIGN KEY constraint

    - by SmartestVEGA
    I am getting the following error. Could you please help me in ? Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Sup_Item_Sup_Item_Cat". The conflict occurred in database "dev_bo", table "dbo.Sup_Item_Cat". The statement has been terminated. insert into sup_item (supplier_id,sup_item_id,name,sup_item_cat_id,status_code,last_modified_user_id,last_modified_timestamp,client_id) values(10162425,10,'jaiso','123123','a','12','2010-12-12','1062425') the last coulum "client_id" i am getting the conflict. I tried to put the value which already exists in the dbo.Sup_Item_Cat to the column corresponding to the sup_item.. but no joy :-(

    Read the article

  • How can I programmically construct the object reference?

    - by Bryan
    Lets just say that I have three textboxes: TextBox1, TextBox2, TextBox3. Normally if I wanted to change the text for example I would put TextBox1.Text = "Whatever" and so on. For what I'm doing right now I would like to something like (TextBox & "i").Text. That obviously isn't the syntax I need to use I'm just using it as an example for what I need to do. So how can I do something like this? The main reason I'm doing this is to reduce code with a loop. Please keep in mind that I'm not actually changing the text of the textboxes I'm simply using that as an example to get the point across.

    Read the article

  • how to use shared variable using stored procedure in crystal reports

    - by sonia
    i have a parent report and it contains a two sub report. * subreport: item which get all fields from store procedure named spGetReportItem. like ItemName ItemQuantity TotalItemCost ab 4 45 dd 6 98 *subreport: Labour which get all fields from store procedure named spGetReportLabour. like labourName labourQuantity TotalLabourCost ab 44 455 dd 63 986 i want to find the total of totalitemcost and total of totallabourcost and then want grandtotal of totalitemcost and totallabourcost. i have seen many examples on internet in which shared variable is used in the formula bt the problem is that they have used the table but i m fetching data from stored procedure. so how can i access the stored procedure fields for calculation. like i have seen that many have used: shared numbervar total:=sum({tablename.ColumnName}); but i have used stored procedure instead of table so how could i find total of field that resultset returns from stored procedure.. plz give me answer as soon as possible.. i need it urgently. thanks..

    Read the article

  • SQL Query with conditional JOIN

    - by mariki
    The scenario: Table1 CatId|Name|Description Table2 ItId|Title|Date|CatId (foreign key) I want to return all rows from Table1 and Title,Date from Table2, where The returned from Table 2 must be the Latest one by the date column. (in second table there many items with same CatId and I need just the latest) I have 2 queries but can't merge them together: Query 1: SELECT Table1.Name, Table1.Description, Table2.Title, Table2.Date FROM Table1 LEFT JOIN Table2 ON Table1.CatId=Table2.CatId Query2: SELECT TOP 1 Table2.Title, Table2.Date FROM Table2 WHERE Table2.CatId = @inputParam ORDER BY Table2.Date DESC

    Read the article

  • How to list all duplicated rows which may include NULL columns?

    - by Yousui
    Hi guys, I have a problem of listing duplicated rows that include NULL columns. Lemme show my problem first. USE [tempdb]; GO IF OBJECT_ID(N'dbo.t') IS NOT NULL BEGIN DROP TABLE dbo.t END GO CREATE TABLE dbo.t ( a NVARCHAR(8), b NVARCHAR(8) ); GO INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a', 'b'); INSERT t VALUES ('a', 'b'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('c', 'd'); INSERT t VALUES ('e', NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); INSERT t VALUES (NULL, NULL); GO Now I want to show all rows that have other rows duplicated with them, I use the following query. SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 which will give us the result: a b -------- -------- NULL NULL a b c d Now if I want to list all rows that make contribution to duplication, I use this query: WITH duplicate (a, b) AS ( SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 ) SELECT dbo.t.a, dbo.t.b FROM dbo.t INNER JOIN duplicate ON (dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b) Which will give me the result: a b -------- -------- a b a b a b c d c d c d c d As you can see, all rows include NULLs are filtered. The reason I thought is that I use equal sign to test the condition(dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b), and NULLs cannot be compared use equal sign. So, in order to include rows that include NULLs in it in the last result, I have change the aforementioned query to WITH duplicate (a, b) AS ( SELECT a, b FROM dbo.t GROUP BY a, b HAVING count(*) > 1 ) SELECT dbo.t.a, dbo.t.b FROM dbo.t INNER JOIN duplicate ON (dbo.t.a = duplicate.a AND dbo.t.b = duplicate.b) OR (dbo.t.a IS NULL AND duplicate.a IS NULL AND dbo.t.b = duplicate.b) OR (dbo.t.b IS NULL AND duplicate.b IS NULL AND dbo.t.a = duplicate.a) OR (dbo.t.a IS NULL AND duplicate.a IS NULL AND dbo.t.b IS NULL AND duplicate.b IS NULL) And this query will give me the answer as I wanted: a b -------- -------- NULL NULL NULL NULL NULL NULL NULL NULL a b a b a b c d c d c d c d Now my question is, as you can see, this query just include two columns, in order to include NULLs in the last result, you have to use many condition testing statements in the query. As the column number increasing, the condition testing statements you need in your query is increasing astonishingly. How can I solve this problem? Great thanks.

    Read the article

  • Simulating an identity column within an insert trigger

    - by William Jens
    I have a table for logging that needs a log ID but I can't use an identity column because the log ID is part of a combo key. create table StuffLogs { StuffID int LogID int Note varchar(255) } There is a combo key for StuffID & LogID. I want to build an insert trigger that computes the next LogID when inserting log records. I can do it for one record at a time (see below to see how LogID is computed), but that's not really effective, and I'm hoping there's a way to do this without cursors. select @NextLogID = isnull(max(LogID),0)+1 from StuffLogs where StuffID = (select StuffID from inserted) The net result should allow me to insert any number of records into StuffLogs with the LogID column auto computed. StuffID LogID Note 123 1 foo 123 2 bar 456 1 boo 789 1 hoo Inserting another record using StuffID: 123, Note: bop will result in the following record: StuffID LogID Note 123 3 bop

    Read the article

  • Split table and insert with identity link

    - by The King
    Hi.. I have 3 tables similar to the sctructure below CREATE TABLE [dbo].[EmpBasic]( [EmpID] [int] IDENTITY(1,1) NOT NULL Primary Key, [Name] [varchar](50), [Address] [varchar](50) ) CREATE TABLE [dbo].[EmpProject]( [EmpID] [int] NOT NULL primary key, // referencing column with EmpBasic [EmpProject] [varchar](50) ) CREATE TABLE [dbo].[EmpFull_Temp]( [ObjectID] [int] IDENTITY(1,1) NOT NULL Primary Key, [T1Name] [varchar](50) , [T1Address] [varchar](50) , [T1EmpProject] [varchar](50) ) The EmpFull_Temp table has the records with a dummy object ID column... I want to populate the first 2 tables with the records in this table... But with EmpID as a reference between the first 2 tables. I tried this in a stored procedure... Create Table #IDSS (EmpID bigint, objID bigint) Insert into EmpBasic output Inserted.EmpID, EmpFull_Temp.ObjectID into #IDSS Select T1Name, T1Address from EmpFull_Temp Where ObjectID < 106 Insert into EmpProject Select A.EmpID, B.T1EmpProject from #IDSS as A, EmpFull_Temp as B Where A.ObjID = B.ObjectID But it says.. The multi-part identifier "EmpFull_Temp.ObjectID" could not be bound. Could you please help me in achieving this...

    Read the article

  • Displaying same record twice- SQL Reporting Services

    - by RyanW
    Ok, here's the situation: I need to display the same record in two different sections. stupid i know, but here's why. The Report I am building is grouped by one Field, called Day. Each record has date/times, an expected arrival date time, and an expected departure date/time. so, at this point we have something like this: Day..............Arrival Time..................Departure Time 18/5.............18/5 9.00am.........19/5 11.00am The boss only wants to show times that relate to the current day in the arrive/depart coloumns (easy enough with expressions), which ends up like this: Day..............Arrival Time..................Departure Time 18/5..............9.00am.........................- the next thing he wants is to display the departing time in the correct day 'group', but as you can imagine as soon as you move to the next row, well you move to the next row of the table. So the question is: is there anyway to display the same record on multiple coloumns? Have i missed something or have i got an unsolvable problem? NOTE: this is not the only data in my table either. there is (for example) a name coloumn which also needs to be displayed on both days.

    Read the article

  • List iterator not dereferencable?

    - by Roderick
    Hi All I get the error "list iterator not dereferencable" when using the following code: bool done = false; while (!_list_of_messages.empty() && !done) { // request the next message to create a frame // DEBUG ERROR WHEN NEXT LINE IS EXECUTED: Counted_message_reader reader = *(_list_of_messages.begin()); if (reader.has_more_data()) { _list_of_frames.push_back(new Dlp_data_frame(reader, _send_compressed_frames)); done = true; } else { _list_of_messages.pop_front(); } } (The line beginning with "Counted_message_reader..." is the one giving the problem) Note that the error doesn't always occur but seemingly at random times (usually when there's lots of buffered data). _list_of_messages is declared as follows: std::list<Counted_message_reader> _list_of_messages; In the surrounding code we could do pop_front, push_front and size, empty or end checks on _list_of_messages but no erase calls. I've studied the STL documentation and can't see any glaring problems. Is there something wrong with the above code or do I have a memory leak somewhere? Thanks! Appreciated!

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >