How To Sort Data Using SQL Query

Dec 18, 2007

Dear All,

i need your help,

i had created a table student, studentid column with alpha numeric primary key with varchar datatype

now my problem: i want to sort the student id accroding to studentid like

STU1
STU2
STU3
STU4
STU5
.
.
.
STU9
STU10
STU11

but i’m getting the sorted result like this, how to overcome this problem,guide me PLEASE

STU1
STU10
STU11
STU12
.
.
.

STU100
.
.
.

STU1000
STU10000
STU2
STU20
STU200
STU2000
STU20000
STU20001


Thank's In Advances

View 9 Replies


ADVERTISEMENT

Am Using Sql Server 2005, Column Data Type Is Varchar, How To Write A Query To Sort

Aug 2, 2006

this data. need help
Sort following numbers by asc and desc order

Before query sort
-1.1
-8.8
-15.5
0.0
+0.5
+0.2

Sort asc
+0.5
+0.2
0.0
-1.1
-8.8

Sort Desc
-8.8
-1.1
0.0
+0.2
+0.5












View 5 Replies View Related

Sort MDX Query

Feb 28, 2005

Trying to get data from result of MDX query in dec order:

iLoopFrom = cst.Axes(1).Positions.Count - 1
iLoopTo = 0
iLoopStep = -1

im using these lines to read the data from bottom to top but what exactly does Position.Count do? and is the -1 there because the result has headers??

Thanks

View 1 Replies View Related

SQL Server Query Sort

Jan 2, 2007

I'm trying to find a way to sort my query like the following:
 SELECT * FROM tbl_Post WHERE ID = 3 OR ID = 1 OR ID = 4 OR ID = 2 ORDER BY (3,1,4,2)
 Now if ID is my primary key, the sort by default would be 1, 2, 3, 4.
 I would like to specify order so that I could return the order as 3, 1, 4, 2 if I wanted to.
 Is there any way to do this?
Thanks,Russ

View 2 Replies View Related

Sort Result According The Query

Feb 27, 2005

I have a query:
SELECT *
FROM Mobile_Subscriber
WHERE (sub_ID IN (17, 2, 19))

The result return:
sub_ID sub_name
2 John
17 Alice
19 Eddy

But what I want is:
sub_ID sub_name
17Alice
2John
19Eddy

Is it possible to return the result order by the query with: sub_ID IN (17,2,19)?

View 3 Replies View Related

SELECT, SORT, And SUM Query

Oct 14, 2005

Hello everyone,

I Have a table with columns:
- CustomerID
- DateTransactionCompleted
- AmountPaid

Illustration data as follow

GO
INSERT INTO Cus_Tab_Dev_2 VALUES(30,'12-12-2004','18000.00')
INSERT INTO Cus_Tab_Dev_2 VALUES(30,'12-15-2004','2000.00')
INSERT INTO CUS_Tab_Dev_2 VALUES(30,'1-16-2005','15000.00')
INSERT INTO CUS_TAB_DEV_2 VALUES(42,'2-2-2005','12000.00')
GO

What I want is a report that tells me the Total Sales per month Per Customer in the following manner:

Customer ID Month/Year Total Per Month
----------- ----------- ----------------
30 12-2004 20000.00
30 1-2005 15000.00
42 2-2005 12000.00

This is a homework, and I have been trying to get it to work since this morning. Any help is appreciated.

PS: If you do not feel you want/should help. Please don't call me names! I don't ask people to help me with my homework usually. But, I am running out of time on the assignment.

View 4 Replies View Related

Some Sort Of Cross Tab Query In Sql

Jul 23, 2005

I have three tables:tblBook has the fields bookID, bookRangeID, bookSubjectID, bookCodetblBookRange has the fields bookRangeID, bookRangeDescriptiontblBookSubject has the fields bookSubjectID, bookSubjectDescriptionso some typical data in tblBook might be:1, 1, 1, B1HBSCI2, 1, 2, B2HBFRE13, 1, 3, B3HBGER4, 2, 1, B4PBSCI5, 2, 2, B5PBFRE6, 2, 3, B6PBGER7, 3, 1, B7CDSCI8, 3, 2, B8CDFRE9, 3, 3, B9CDGER110, 3, 3, B10CDGER211, 1, 2, B11HBFRE2tblBookRange would be:1, HardBack2, PaperBack3, CD RomtblBookSubject would be:1, Science2, French3, GermanI'd like to create a query which will return me the subjects along thetop, the book range down the side, and the bookcodes in the cells, abit like this:BookRange , Science, French, GermanHardBack , B1HBSCI, B2HBFRE1 B11HBFRE2, B3HBGERPaperBack , B4PBSCI, B5PBFRE, B6PBGERCD Rom , B7CDSCI, B8CDFRE, B9CDGER1 B10CDGER2Does that make any sense? So basically I'd like to get some kind ofdynamic SQL working which will do this kind of thing. I don't want tohard code the subjects in or the book ranges. I get the feeling thatdynamic SQL is the way forward with this and possibly using a cursor ortwo too, but it got quite nasty and convoluted when I tried variousattempts to get it working. (one of the ways I tried included workingout each result in a dynamic script, but it ran out of characters asthere were too many "subjects".)If anyone has any nice but quite dynamic solutions, I'd be delighted tohear.(and I know some of you have already told me you don't like tablesbeginnig with tbl, but I'm not hear for a lecture on namingconventions, I'm hear to learn and share ideas :o) )

View 2 Replies View Related

Query Sort Question

Jul 20, 2005

I have a field called "type" in my "school" table that can have threepossibilities:ElementaryMiddleHighIn my result set, I always want Elementary to come first, Middle tocome second, and High to come third. An alpha sort gets me this:ElementaryHighMiddleSure, I could create a look-up that assigns an integer to the "type"field to get the right sort order (i.e. elementary = 0, middle = 1,high = 2) ... but is there a better way to do this with SQL syntax?Thanks,Ralph NobleJoin Bytes!

View 1 Replies View Related

Sort On Field Constructed In Query

Aug 3, 2007

I want to sort on a field that I construct during a query....how can I solve this?Basically what i am doing is selecting mediafiles with comments in descending order. (so mediafile with most comments on top)Here's my (not working) query, because it throws the error that the mediaComments column is unknown....SELECT *FROM(select ROW_NUMBER() OVER (ORDER BY mediaComments DESC) as RowNum,m.title,m.usercode,mediaComments=(select count(*) from MediaComments where mediaid=m.mediaid)FROM Media m WHERE m.usercode>0group by  m.title,m.usercode) as InfoWHERE RowNum between @startRowIndex AND (@startRowIndex + @maximumRows-1)

View 4 Replies View Related

Dynamic Sort Column And Sort Order Not Working

Aug 7, 2007

I am trying to set sorting up on a DataGrid in ASP.NET 2.0.  I have it working so that when you click on the column header, it sorts by that column, what I would like to do is set it up so that when you click the column header again it sorts on that field again, but in the opposite direction. I have it working using the following code in the stored procedure:   CASE WHEN @SortColumn = 'Field1' AND @SortOrder = 'DESC' THEN Convert(sql_variant, FileName) end DESC,
case when @SortColumn = 'Field1' AND @SortOrder = 'ASC' then Convert(sql_variant, FileName) end ASC,
case WHEN @SortColumn = 'Field2' and @SortOrder = 'DESC' THEN CONVERT(sql_variant, Convert(varchar(8000), FileDesc)) end DESC,
case when @SortColumn = 'Field2' and @SortOrder = 'ASC' then convert(sql_variant, convert(varchar(8000), FileDesc)) end ASC,
case when @SortColumn = 'VersionNotes' and @SortOrder = 'DESC' then convert(sql_variant, convert(varchar(8000), VersionNotes)) end DESC,
case when @SortColumn = 'VersionNotes' and @SortOrder = 'ASC' then convert(sql_variant, convert(varchar(8000), VersionNotes)) end ASC,
case WHEN @SortColumn = 'FileDataID' and @SortOrder = 'DESC' THEN CONVERT(sql_variant, FileDataID) end DESC,
case WHEN @SortColumn = 'FileDataID' and @SortOrder = 'ASC' THEN CONVERT(sql_variant, FileDataID) end ASC  And I gotta tell you, that is ugly code, in my opinion.  What I am trying to do is something like this:  case when @SortColumn = 'Field1' then FileName end,
case when @SortColumn = 'FileDataID' then FileDataID end,
case when @SortColumn = 'Field2' then FileDesc
when @SortColumn = 'VersionNotes' then VersionNotes
end

case when @SortOrder = 'DESC' then DESC
when @SortOrder = 'ASC' then ASC
end  and it's not working at all, i get an error saying:  Incorrect syntax near the keyword 'case' when i put a comma after the end on line  5 i get: Incorrect syntax near the keyword 'DESC' What am I missing here? Thanks in advance for any help -Madrak 

View 1 Replies View Related

SQL Query Help - Using DropDownLists To Sort (multiple Variants)

Mar 15, 2007

Hi Everyone,I am creating a portal and want the user to be able to select four variants from four separate drop down boxes... Such as chapter, story, etc... The user will then be able to click Find and shorten up the gridview list. The below query is what I am using for my current gridview (with custom paging). What I want to do is something like this: Pass a variable such as @Story. If no Story is chosen, then the variable would be *. If a variable is chosen, the the @Story would the StoryID. However, I don't believe SQL recognizes the * in this case. I was thinking it should, but I don't believe it does. I was hoping it would just take it and I could write, SELECT * from Stories where StoryId=@Story, or something like that... and if * was @Story, then it would just select all... or if it was 1, then just stories with a StoryId of 1.Am I totally off base here? Thanks!  CREATE PROCEDURE SortAllStories@startRowIndex int,@maximumRows int,@totalRows int OUTPUTASDECLARE @first_id int, @startRow intSET @startRowIndex = (@startRowIndex - 1) * @maximumRowsIF @startRowIndex = 0SET @startRowIndex = 1SET ROWCOUNT @startRowIndexSELECT @first_id = StoriesID FROM Storie ORDER BY StoriesIdPRINT @first_idSET ROWCOUNT @maximumRowsSELECT Stories.StoryId, Chapters.ChapterName, Chapters.EnglishName, Translations.Translation,Stories.Verse, Stories.StoryFROM Chapters, Stories, TranslationsWHERE Chapters.ChapterId=Stories.ChapterId AND Translations.TranslationId = Stories.TranslationId  AND Stories.StoryId >= @first_idORDER BY Stories.StoryIdSET ROWCOUNT 0SELECT @totalRows = COUNT(StoryId) FROM Stories

View 3 Replies View Related

How To Write A SQL Query To Sort A Table With The Priority Column As Well?

Jan 16, 2005

Hi,

Anyone can help me for the Sql query?

I want to sort a table with a priority column, e.g. in the following...

Table A
======
value
======
9
3
1
7
4
======

After sorting:

Table A
========
no value
========
1 1
2 3
3 4
4 7
5 9
========


Anyone can help me?
Thanks.

Daniel.

View 1 Replies View Related

Cant Submit Any Sort Of Variable Data

Feb 27, 2008

Hi there, i have written a page and for a long time it worked (or so i thought) now all of a sudden it dosnt. I have gone right back to basics and tried to only insert one variable, tried using a text box, a string pre populated, or a string populated by the text box - nothing seems to work. However if i hard code in the thing that i want, even into the SQL or into my param it works, whats going on! i think my programming skills are letting me down here!
here is what i am trying to use (as you can see i have commented out all that i was using to get back to basics)
Are there any pointers?SqlConnection objConnAddStock = new SqlConnection(sAddStock);
//This is the sql statement.
 int intUpdateQSStockID = Convert.ToInt32(Request.QueryString["qsStockID"]);
string strCondition;strCondition = "Brand New 12";using (objConnAddStock)
{
objConnAddStock.Open();string sqlAddStock = "UPDATE tbl_stock SET condition = @condition WHERE stock_id = " + intUpdateQSStockID;
 
 
 
 
 /*cat_id = @cat_id, sub_cat_id = @sub_cat_id, n_or_sh = @n_or_sh, " +
"description = @description, size = @size, colour = @colour, cost_price = @cost_price, " +
"selling_price = @selling_price, condition = @condition, notes = @notes, " +
"buying_in_recipt = @buying_in_recipt, visible = @visible, picture1 = @picture1, " +
"picture2 = @picture2, [picture3] = @picture3, picture4 = @picture4, " +
"picture1_thumb = @picture1_thumb, picture2_thumb = @picture2_thumb, " +
"picture3_thumb =@picture3_thumb, picture4_thumb = @picture4_thumb, title = @title, " +
"display_price = @display_price WHERE Stock_id = " + intUpdateQSStockID;*/
 SqlCommand objCmdAddStock = new SqlCommand(sqlAddStock, objConnAddStock);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);/* objCmdAddStock.Parameters.AddWithValue("@cat_id", DropDownList2.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@sub_cat_id", DropDownList1.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@n_or_sh", n_or_shTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@description", txtDescription.Text);
objCmdAddStock.Parameters.AddWithValue("@size", sizeTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@colour", colourTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@cost_price", cost_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@selling_price", selling_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@notes", notesTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@buying_in_recipt", TextBox3.Text);
objCmdAddStock.Parameters.AddWithValue("@visible", DropDownList4.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@picture1", txtPicture1.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2", txtPicture2.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3", txtPicture3.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4", txtPicture4.Text);
objCmdAddStock.Parameters.AddWithValue("@picture1_thumb", txtPicture1_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2_thumb", txtPicture2_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3_thumb", txtPicture3_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4_thumb", txtPicture4_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@title", txtTitle.Text);
objCmdAddStock.Parameters.AddWithValue("@display_price", txtDisplay.Text);*/
 
try
{
objCmdAddStock.ExecuteNonQuery();
}catch (Exception ex)
{Label17.Text = Convert.ToString(ex);
}finally
{
objConnAddStock.Close();
}Label17.Text = Convert.ToString(intUpdateQSStockID);
 
}

View 3 Replies View Related

Contents Sort 3 Levels Of Data

Dec 21, 2007

I Have a table of Data (WikiData)

WikiIDint
ParentIDint
sTitlevarchar(50)
sDescriptionvarchar(MAX)

There will be three levels of data imposed at the Application Layer

Level 1: ParentID = 0
An Item Like Geography
Level 2: ParentID = a Level 1 WikiID
A sub Topic like Volcanoes
Level 3: ParentID = Level 2 WikiID
A bottom Topic like Pyroclastic Flows

I Need a SQL statement that Will Produce the Output where The output will be produced like this:
Level 1
Level 2
Level 2
Level 2
Level 1
Level 2
Level 2

I Built this but its wrong and has no order by Group by Statements
Select * from WikiData where ParentID = 0 or ParentID IN (Select * from WikiData where ParentID = 0)

View 12 Replies View Related

T-SQL (SS2K8) :: Sort Data By Using ORDER BY

Mar 7, 2013

When We sort the data by using ORDER BY , which sorting algorithm method will be used by SQL optimizer?

1) Bubble Sort
2) Quick Sort
3) Merge Sort
4) Heap Sort
5) Insertion Sort

View 9 Replies View Related

How To Sort Data On Based Of Column's Value?

Oct 24, 2007

Hi everybody!

My users need to sort data on base of columns that they select ,the same as sorting in grid but i need it with reporting services.

Thankas in advance.

View 3 Replies View Related

SQL 2012 :: How To Find Query Which Have Sort Warning Alert In Profiler

Jan 30, 2015

which have a lot of impact to database performace since it do not fit onto memory and spill over to disks.

The question is when i ran a profiler and tried to catch a sort warning i cannot find the query which cause the alert.

View 1 Replies View Related

Transact SQL :: Query To Return Greater Than Zero Values To Sort Up And Zeros Go Down

Sep 17, 2015

I am using a table to store different size numbers for example:

Look at the picture below:

But I want this type of output look at the picture below:

How to sort the query to return greater than zero values to sort up and zeros go down. 

I am using sql server 2008.

View 14 Replies View Related

SqlDataSource Control Error When Trying To Sort The Data

Feb 5, 2007

Hello:I forgot what to do in a case like this. I have a SqlDataSource control within a label and I want to allow auto sorting, but when I click on the sort link the page comes back with:The SqlDataSource control 'sqlViewIncompleteForms' does not have a naming container.  Ensure that the control is added to the page before calling DataBind.[HttpException (0x80004005): The SqlDataSource control 'sqlViewIncompleteForms' does not have a naming container.  Ensure that the control is added to the page before calling DataBind.]   System.Web.UI.WebControls.DataBoundControlHelper.FindControl(Control control, String controlID) +1590679   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +76   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +46   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +103   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +40   System.EventHandler.Invoke(Object sender, EventArgs e) +0   System.Web.UI.Page.OnLoadComplete(EventArgs e) +2010392   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1209How do I over come this? Do I have to use the find control method on page_load? Here is the code portion .vb<%  'Label which contains the default.aspx home content %><asp:Label ID="recip_home_display" runat="server" Visible="false">    <div align="center" class="HeaderSmall">Incomplete Recip Submissions</div>    <asp:GridView ID="RecipStatusGridView" runat="server" AutoGenerateColumns="False" BorderWidth="0px" DataKeyNames="queue_id"        DataSourceID="sqlViewIncompleteForms" AllowPaging="True" AllowSorting="True" CellPadding="2" CellSpacing="2" CssClass="TextSmall" HorizontalAlign="Center" Width="500px" Visible="False">        <Columns>            <asp:BoundField DataField="queue_id" HeaderText="Incomplete Listings" HtmlEncode="False"                InsertVisible="False" ReadOnly="True" SortExpression="queue_id">                <ControlStyle CssClass="LinkNormal" />                <ItemStyle HorizontalAlign="Center" />                <HeaderStyle HorizontalAlign="Center" />            </asp:BoundField>            <asp:BoundField DataField="form_type" HeaderText="Listing Type" SortExpression="form_type">                <ItemStyle HorizontalAlign="Center" />                <HeaderStyle HorizontalAlign="Center" />            </asp:BoundField>            <asp:BoundField DataField="listing_address" HeaderText="Listing Address" ReadOnly="True"                SortExpression="listing_address">                <ItemStyle HorizontalAlign="Center" />                <HeaderStyle HorizontalAlign="Center" />            </asp:BoundField>            <asp:BoundField DataField="last_modified_date" DataFormatString="{0:d}" HeaderText="Last Modified"                HtmlEncode="False" SortExpression="last_modified_date">                <ItemStyle HorizontalAlign="Center" />                <HeaderStyle HorizontalAlign="Center" />            </asp:BoundField>        </Columns>        <HeaderStyle BackColor="#5C6F8D" />        <AlternatingRowStyle BackColor="#e9eaf0" />    </asp:GridView>    <asp:SqlDataSource ID="sqlViewIncompleteForms" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ Appsettings:connectionstring %>" SelectCommandType="StoredProcedure" SelectCommand="spGetIncompleteForms">    <SelectParameters>        <asp:ControlParameter ControlID="active_member_id" Name="AgentId" />    </SelectParameters></asp:SqlDataSource></asp:Label>

View 1 Replies View Related

Sort Data Table Smallest To Largest

Dec 30, 2014

i have table in sql and every month i am appending new data in this table, but i want to sort data Culumn Name "account_no' from smallest to largest, and whenever i append new data to this table it auto sort every time,

View 1 Replies View Related

Cant Sort Data In Exported Excel File From Sql Ser

Feb 7, 2008

Hello,
I am new to this sql server reporting server technology. I have a requirement like the table header should repeat in all pages of the exported excel's print preview. So I have created the header columns with fixed lenths as same as table's header in the page header of the report. Then only the Header will repeat in all pages of the print preview.

But the problem is when doing like this, many of the columns have been merged together. The report layout is ok. But cant sort the data. It says a message "This operation requires the merged cells to be identically sized."

In some forms i have found the header control's edges need to be sized identically with the tables' columns edges. I did it. But still the columns are merged when exporting.

Please help me out from this.

Thanks in advance.

Arputharaj.D

View 4 Replies View Related

Reporting Services :: How To Sort Data In SSRS

Sep 30, 2015

I have below report with following data

Team_Name                    Count
Team10                           100
Team4                             30
Team1                             55
Team19                           44
Team5                             10

What is the best approach to sort this data based on the Team name in 2 reports - One is in Tablix and other in a column bar chart report?

View 4 Replies View Related

Default Sort Order Of The Data When Inserting From One Table To Another

May 19, 2008



I have a data load process that reads data from flat file into a Stage table in sql server. The order of the records in the stage table is exactly same as the order in the flat file. The identity column on the Stage table (which is also the clustered index) represents the exact line/row number of the data in the filat file. I perform some transformations on the data in the stage table and then insert it into a cumulative table which has a clustered index on an identity column again. When I do this, does the order of the data in the cumulative table be in the same order as the data in the stage table? Anyone, please let me know if I can rely on SQL server to maintain the same order or I will be forcing a sort order on the Identity column (clustered index) of the stage table when I insert the data into a cumulative table.


Thanks in advance!!

View 3 Replies View Related

Can Sqldatasource Automatically Sort Retrieved Data From Stored Procedure ?

Jan 6, 2006

Hi,
This is my problem :
     I have  listBox1, listBox2 controls bound to sqldatasource1 and sqldatasource2.
I wrote one stored procedure to retrieve data from my sql database like :
    select Id, Name,Address,Amount from KalakaDB
 
Now I want my listBox1 to display Name By name and my listBox2 to display Amount by decrease order
how can i connect my sqldatacontrol to the stored procedure ?
 
Thanks

View 1 Replies View Related

Reporting Services :: How To Sort Data In SSRS Based On Month And Year

Sep 30, 2015

I have below report with following data

Date                      Count
April-2015             100
January-2002        30
November-2010     55
July-2000               10

What is the best approach to sort this data based on date in a tablix and also sort the date in Column bar chart?

View 4 Replies View Related

Which Sort Of Data (from Application Architecture) Point Of View It's Worth To Put In XML Datatype (MS SQL 2005)?

Mar 20, 2008

Which sort of data (from application architecture) point of view it's worth to put in XML datatype (MS SQL 2005)?

View 2 Replies View Related

Query By Year Group By Total Students Sort By Total For Each County

Jul 20, 2005

I haven't a clue how to accomplish this.All the data is in one table. The data is stored by registration dateand includes county and number of students brokne out by grade.Any help appreciated!Rob

View 4 Replies View Related

Cant Sort Data In Exported Excel File From Sql Server Reporting Server

Feb 7, 2008



Hello,
I am new to this sql server reporting server technology. I have a requirement like the table header should repeat in all pages of the exported excel's print preview. So I have created the header columns with fixed lenths as same as table's header in the page header of the report. Then only the Header will repeat in all pages of the print preview.

But the problem is when doing like this, many of the columns have been merged together. The report layout is ok. But cant sort the data. It says a message "This operation requires the merged cells to be identically sized."

In some forms i have found the header control's edges need to be sized identically with the tables' columns edges. I did it. But still the columns are merged when exporting.


Please help me out from this.


Thanks in advance.

View 5 Replies View Related

Sort Buttons Grayed Out In &"Data In Table&"

Aug 17, 2006

Hi -

This is a newbie question. For some reason when I view the contents of tables I have created on my SQL Server (version 7) database, the sort buttons in the "Data in Table" window are grayed out.

Do I need more permissions? How do I fix this?

Thanks.

View 1 Replies View Related

Opening Up Odbc Data Source In The Query Query Inside Of The Server Manager

Jun 15, 2007

I'm trying to find the command to open up an odbc conection inside sql2005 express. I only have ues of an odbc connector, we're conection to remedy. We will eventually be using stored procedures to extract the data we need from remedy and doing additional data crunching. I'm a foxpro programmer so once I get the correct syntax for making the odbc connector I shold be ok. Also I need a really good advanced book on sql2005. The type of book that would have my odbc answer. I've spent all morning trying to find this information and was unable to.



Thanks in advance



Daniel Buchanan.



If this was the wrong forum to post this on, please move this question to the correct one. I need this answer soon.

View 1 Replies View Related

Master Data Services :: Error - Query Processor Could Not Produce A Query Plan

Jul 19, 2015

We have a issue with a MDS server that have been over us for a couple of days, the original error msg from SQL Server Engine is the one "The query processor could not produce a query plan" but the ones we get on the Excel-Addin are "Sequece contains no elements" or "The value cannot be null" T

• Using Microsoft SQL Server 2012 (SP1) - 11.0.3393.0 (X64) for 6months on this server without issues

• Two weeks ago we started to have 2 errors: "Sequence Contains No Elements" | "The Value Cannot Be Null"

• We are using the last version of Excel Add-in

• We try to reinstall the MDS feature

• If I backup/restore MDS database to other server it works

• We updated to SQL 2012 SP2 + CU4 but the error persisted ...

Looking at the MDSTraceLog we are routed to the this msg

SQL Error Debug Info: Number: 8624, Message: Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services., Server: bbdvsql03inst01, Proc: udpMetadataEntityGetDetailsXML, Line: 28

At line 28 udpMetadataEntityGetDetailsXML is calling udfMetadataEntityGetDetailsXML … and here is where we stopped

** Error found when try to get data from a entity using Excel add-in **
===================================
Sequence contains no elements
------------------------------
Program Location:
   at Microsoft.MasterDataServices.AsyncEssentials.AsyncResultBase.EndInvoke()
   at Microsoft.MasterDataServices.ExcelAddInCore.AsyncProviderBase`1.EndOperation(IAsyncResult ar)

[code]....

View 3 Replies View Related

How To Query An Oracle Data From SQL Server Query Analyser

Sep 3, 2007



Hi ,

I am having 2 data store .
1. Oracle 10g
2 SQL server 2000

My requirement is that , i need to insert some data from sql server database table to oracle database using sql server query analyser or interface.


If there is any way ,plz let me know it


Thanks
Abraham

View 3 Replies View Related

Update Query Containg Static Data And Data From Another Table.

Sep 28, 2006

Hi,First post so apologies if this sounds a bit confusing!!I'm trying to run the following update. On a weekly basis i want toinsert all the active users ids from a users table into a timesheetstable along with the last day of the week and a submitted flag set to0. I plan then on creating a schduled job so the script runs weekly.The 3 queries i plan to use are below.Insert statement:INSERT INTO TBL_TIMESHEETS (TBL_TIMESHEETS.USER_ID,TBL_TIMESHEETS.WEEK_ENDING, TBL_TIMESHEETS.IS_SUBMITTED)VALUES ('user ids', 'week end date', '0')Get User Ids:SELECT TBL_USERS.USER_ID from TBL_USERS where TBL_USERS.IS_ACTIVE = '1'Get last date of the weekSELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 6)I'm having trouble combing them as i'm pretty new to this. Is the bestapproach to use a cursor?If you need anymore info let me know. Thanks in advance.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved