Discrepancy On Number Of Rows

Sep 18, 2006

Hi There,

Good Day :-)

How could I correct the erroneous value on the property window of an SQL Table.

My problem is that, if I am going to display the property window of Table1, the 'Rows' information displays 115. However, if I am going to execute - Select Count(*) from Table1 then it returns 117. How could I fix this glitch?

Please Help :-)

View 2 Replies


ADVERTISEMENT

How To Enter More Number Of Rows In A Table Having More Number Of Columns At A Time

Sep 24, 2007

Hi

I want to enter rows into a table having more number of columns

For example : I have one employee table having columns (name ,address,salary etc )
then, how can i enter 100 employees data at a time ?

Suppose i am having my data in .txt file (or ) in .xls

( SQL Server 2005)

View 1 Replies View Related

Discrepancy In Whether SP2 Is Installed

Apr 11, 2007

I couldn't remember which computers I had already installed sp2 on so checked but one computer (running Windows Server 2003 and SQL 2005 Enterprise Edition) seems to have a discrepancy. SELECT @@VERSION returns (Build 3790: Service Pack 1) but the status bar shows "9.0 SP2". Thanks for any insight into this.



-Dave

View 5 Replies View Related

Sign (+ / -) Discrepancy W/ODBC - HELP!

Jan 10, 2002

I have a SQL 7 db that I use a DTS package to import Oracle data into. The package works fine and imports all the appropriate data. However, if I use an Access 2000 database to attach to the data via ODBC (using the MS SQL Server driver), the negative sign is dropped when displaying data in a table, query, or report.

Same problem in SQL Server - if I query the SQL 7 data via the Query Analyzer, the negative signs are dropped. However, if I query the SQL data using the Enterprise Manager (i.e., Open Table...Return All Rows via right click on the table), the data shows up properly with the negative signs there. Bottom line - the data is correct, but doesn't get displayed correctly in QA or via ODBC.

What gives?! Can anyone explain to me the "connections" that occur between EM and QA? Looks like QA uses a "temporary" ODBC connection to talk to the data, while the EM connects "directly" to the data. Also, what gives with the MS SQL Server ODBC driver - why wouldn't it display the negative signs? Is there a better SQL Server ODBC driver that I should/could use? I've tried configuring the ODBC connection differently, but to no avail.

Any help is greatly appreciated, as the data in question is being used in court and absolutely HAS to be accurately displayed.
Thanks!
Jeff Jones
Atlanta, GA

View 4 Replies View Related

Allocation Discrepancy Error

Oct 25, 1999

During daily scheduled maintenance the following error occurs, which causes the maintenance job to fail. How can we fix?
Thanks!


Allocation Discrepancy: Page is allocated but not linked; check the following pages and ids: allocation pg#=1085440 extent id=1085464 logical pg#=1085464 object id on extent=8 (object name = syslogs) indid on extent=0

View 2 Replies View Related

Allocation Discrepancy Error

Sep 28, 1999

I am getting the following error on a version 6.5 database
when I run the weekly database backup.

"Allocation Discrepancy: Page is allocated but not linked; check the following pages and ids: allocation pg#=491520 extent id=491720 logical pg#=491720 object id on extent=8 (object name = syslogs) indid on extent=0"

The backup script I run is as follows..
SQLMAINT.EXE -D ECAP -CkDB -CkAl -UpdSts -BkUpDB F:MSSQLBACKUP -BkUpMedia DISK -DelBkUps 8 -Rpt F:MSSQLLOGECAP_DbBkUp.rpt

This database is a 7 x 24 database. What is the least intrusive and/or best way to correct this problem?

Jim

View 1 Replies View Related

Union Query Discrepancy

Jan 26, 2005

When I run the following query with a UNION:

SELECT dbo.TBLCCINFORMATIONOCTOBER04.NAME, dbo.TBLCCINFORMATIONOCTOBER04.TITLE, LOWFARE, ITPSG.TBLCCONLINETOOL.AMOUNT as PRICE, 15 AS Lostsavings, LEFT(dbo.TBLCCINFORMATIONOCTOBER04.CostCtr, 4) AS COMPANYCODE, ITPSG.TBLCCONLINETOOL.InYear, ITPSG.TBLCCONLINETOOL.InMonth, 'TRADITIONAL BOOKING' AS Reason FROM ITPSG.TBLCCONLINETOOL INNER JOIN dbo.TBLCCINFORMATIONOCTOBER04 ON ITPSG.TBLCCONLINETOOL.AWID = dbo.TBLCCINFORMATIONOCTOBER04.AWID AND ITPSG.TBLCCONLINETOOL.InMonth = dbo.TBLCCINFORMATIONOCTOBER04.COLMONTH INNER JOIN dbo.TBLMONTHVALUE ON dbo.TBLCCINFORMATIONOCTOBER04.COLMONTH = dbo.TBLMONTHVALUE.monthname WHERE LEFT(dbo.TBLCCINFORMATIONOCTOBER04.CostCtr, 4) = '1038' AND INYEAR = '2004'AND InMonth = 'OCTOBER' AND (ITPSG.TBLCCONLINETOOL.DESTINATION = 'DOMESTIC') AND (ITPSG.TBLCCONLINETOOL.TYPE = 'TRADITIONAL') UNION SELECT dbo.TBLCCINFORMATIONOCTOBER04.NAME, dbo.TBLCCINFORMATIONOCTOBER04.TITLE, LOWFARE, ITPSG.TBLCCEXCEPTIONS.PRICE as PRICE, ITPSG.TBLCCEXCEPTIONS.Lostsavings AS Lostsavings, LEFT(dbo.TBLCCINFORMATIONOCTOBER04.CostCtr, 4) AS COMPANYCODE, ITPSG.TBLCCEXCEPTIONS.InYear, ITPSG.TBLCCEXCEPTIONS.InMonth, ITPSG.TBLCCEXCEPTIONS.Reason FROM ITPSG.TBLCCEXCEPTIONS INNER JOIN dbo.TBLCCINFORMATIONOCTOBER04 ON ITPSG.TBLCCEXCEPTIONS.AWID = dbo.TBLCCINFORMATIONOCTOBER04.AWID AND ITPSG.TBLCCEXCEPTIONS.InMonth = dbo.TBLCCINFORMATIONOCTOBER04.COLMONTH INNER JOIN dbo.TBLMONTHVALUE ON dbo.TBLCCINFORMATIONOCTOBER04.COLMONTH = dbo.TBLMONTHVALUE.monthname WHERE (LEFT(dbo.TBLCCINFORMATIONOCTOBER04.CostCtr, 4) = '1038') AND (ITPSG.TBLCCEXCEPTIONS.InYear = '2004') AND (ITPSG.TBLCCEXCEPTIONS.InMonth = 'OCTOBER') ORDER BY Reason

It returns these 16 records, 10 from the 1st table and 6 from the second. If I just remove the UNION operator and run them seperatly I get 11 from the 1st table and 6 from the second.

The record I am losing is the second of these two, but with the fields I am selecting they appear identical:
R,JosephField Operations Director INULL267.00001510382004octoberTRADITIONAL BOOKING
R,JosephField Operations Director INULL267.00001510382004octoberTRADITIONAL BOOKING

Is there any reason why the UNION statement is making that second record vanish? Is there a way I can alter the statement so I can run the query with the UNION and not lose records?

Thanks,

View 2 Replies View Related

SQL Server/Excel Date Discrepancy

Dec 8, 2005

Guys
Here's a strange one - anyone else come across this :

In SQL2K
select cast(cast ('08-dec-2005' as datetime ) as int) returns 38692

In Excel2002 SP3
Put the same date in a cell and format it as a number and you get 38694

Presumably the products have a different start date

View 1 Replies View Related

DB Design :: Discrepancy In Table Structure After DB Restoration

Jun 23, 2015

After performing copy_only backup of the Database using the below query, I restored the Database and now I checked and found out that there is a discrepancy in the table structure of the restored Database.Its a scheduled backup job.one of the column of the table varchar(300) has been changed to varchar(200)

BACKUP DATABASE DBname TO  DISK = N'D:BACKUPdbname.bak' WITH  COPY_ONLY, NOFORMAT, NOINIT,  NAME = N'Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

View 7 Replies View Related

COLID Discrepancy In Syscolumns / Information_Schema.Columns - SQL Server 2000

Jul 20, 2005

I ran the following query in Query Analyzer for a 7 column table.SELECT c.name,c.colid FROM syscolumns c WHERE c.id=925962375 ORDER BYc.colidThe results were:I_CSD 1X_STE_XML2I_USR_LCK4T_CRT_RCD5I_USR_CRT_RCD6T_UDT_RCD7I_USR_UDT_RCD8If I use the information_schema view (SELECT column_name,ordinal_position FROM information_schema.columns WHERE table_name ='CSD_XML') I get the same results.The problem is that the colids go from 2 to 4 and the colids gothrough 8 when there are only 7 columns.At one time there was another column in the table, but it has sincebeen dropped and isn't there anymore. It seems that the colids insyscolumns did not update when the column was dropped.Is this because of the way I dropped the column? Is there anything Ican do now that it has happened?

View 3 Replies View Related

Getting Number Of Rows

Sep 16, 2006

Is there a simple way to get the number of rows of a table besides going through and counting all of the rows programmatically?

View 13 Replies View Related

Number Rows

Mar 14, 2007

I have wrote a query that returns product details for all orders that are at stage 6. Is there a way to number the product lines in each order no?!

Eg.
Order 1
Product 1 - 1
Product 2 - 2
Product 3 - 3

--counter restarts
Order 2
Product 1 - 1
Product 2 -2

thanks?

View 2 Replies View Related

Number Of Rows.

Jun 20, 2008

Hi,
I have the following issue:

Here is my query:
The result is below:
(SELECT 'Succesful' AS metric_value,
SUM(CASE WHEN Product_Cat_Tier_3__2_ IN ('S Infr', 'S Entitl', 'S Provi') THEN 1 ELSE 0 end) AS S,
SUM(CASE WHEN Product_Cat_Tier_3__2_ IN ('Ading', 'Bending Floor', 'Net Ops' ) THEN 1 ELSE 0 end) AS N,
SUM(CASE WHEN Product_Cat_Tier_3__2_ IN ('Management NET', 'erprise') THEN 1 ELSE 0 end) AS ENTERP,
SUM(CASE WHEN Product_Cat_Tier_3__2_ LIKE '%Sector%' THEN 1 ELSE 0 end) AS TS,
SUM(CASE WHEN Product_Cat_Tier_3__2_ LIKE '%NMS%' THEN 1 ELSE 0 end) AS MS,
SUM(CASE WHEN Product_Cat_Tier_3__2_ = 'Fading' ) AR TS,
month(DATEADD(second, Actual_End_Date, '1969-12-31 8:00:00 PM')) as month
FROM Change

WHERE YEAR(DATEADD(second, Actual_End_Date, '1969-12-31 8:00:00 PM')) = YEAR(GETDATE()) AND

Product_Cat_Tier_1_2_ = 'Network' AND
Product_Cat_Tier_2__2_ = 'RFC' AND (Change_Request_Status = 11 and Status_Reason = 6000) AND
Product_Cat_Tier_3__2_ NOT IN ('Installation', 'Voice AND Video')
GROUP BY YEAR(DATEADD(second, Actual_End_Date, '1969-12-31 8:00:00 PM')), month(DATEADD(second, Actual_End_Date, '1969-12-31 8:00:00 PM'))
)

=====================
Result
================
metric_value S N ENTERP TS MS AR month
------------ -- -- ------ -- -- -- ----
Succesful 0 1 0 0 0 0 5
Succesful 0 1 1 0 0 0 6

And I want the following output, because now is June so month is equal to 6.
metric_value S N ENTERP TS MS AR month
------------ -- -- ------ -- -- -- ----
Succesful N N N N N N 1
Succesful N N N N N N 2
Succesful N N N N N N 3
Succesful N N N N N N 4
Succesful 0 1 1 0 0 0 5
Succesful 0 1 1 0 0 0 6

WHERE , N = NULL
THANK YOU

View 1 Replies View Related

Number Of Rows

Dec 27, 2006

Hello!

I try to figure out how to change the number of rows at each page, but I'm stuck.

I have no page break , but I get a number of pages when I view my report. Is there any way to set the number of rows shown at each page?

//Cissi

View 4 Replies View Related

Sql Help With Number Of Rows Return Value

May 14, 2008

hi,i have a stored procedure like this in SQL server ,it returns proper value if data is there for a given id.But if there is no data,it returns row/rows of NULL value and that is counted towards "number of row returned"..Shouldn't it be like,if there are null values in a row,that row should not be counted towards rows returned value .?Rightnow if no value returned from either of the select,it still returns as 2 rows instead of 0 rows.How do handle this situation in SQL? thanks for your help
SELECT     SUM(col1) AS SUM_COL1, SUM(col2) AS SUM_COL2, SUM(col3) AS SUM_COL3, SUM(col4) AS SUM_COL4FROM         TABLE1WHERE     (ID = nn)     UNION all
 SELECT      SUM(col22) AS SUM_COL22 ,cast(null as int) as c1,cast(null as int)as c2,cast(null as int) as c3FROM         table2WHERE     TABLE2 = nn)

View 1 Replies View Related

Set Number Of Returned Rows !!! Please Help Me.

Jun 3, 2004

I want to select data from a table with 5.000.000 rows. It's very slowly. Do you now, how I can select only a XY number of rows? I can't use TOP in select query. User see only 20-30 rows on his page, but he can use page_up, page_down. Is possible to something as lazy load?

View 2 Replies View Related

Number Of Rows Returned By Sp

Jul 9, 2004

Is it possible to get the number of Rows returned by a stored procedure in a profiler ?
if yes, what parameters shud I be looking for?

THanks

Harshal

View 7 Replies View Related

Count Number Of Rows In Asp.net

Nov 11, 2005

hey, how would i count the number of rows, with out using a loop??

thanks, Justin

View 2 Replies View Related

Get Number Of Rows Deleted

Feb 1, 2006

How do we get the number of rows deleted from a table?

@@rowcount is returning 0

View 2 Replies View Related

Return Certain Number Of Rows

Apr 17, 2008

I have a Dataset that I am populating from a SQL Query. I am then using the dataset to populate a report in Reporting Services. What I want to do is return a standard number of rows in my dataset. (Let's say 10.) Even if my query does not have any rows in it, I want 10 empty rows returned to the dataset. If my query has 7 rows in it then I want to add on 3 empty rows and return it. I will not have more than the standard number of rows.
I cannot get the table in the report to show up if the dataset is empty, but still want the table to display with 10 empty rows. I have searched how to do this online but am getting nowhere. (I know how to add one empty row but not a set number.

View 6 Replies View Related

Selecting Top 'x' Number Of Rows Through A Sp

Jun 24, 2008

Hello all.

Im trying to write a stored procedure which i can stipulate the top number of rows it returns. I know i use the following syntax:

SELECT TOP 5

And i know i need to pass the number of rows i want as a variable to the stored proceudre like:


@Top as Integer

But when i try and do the following. SQL Server complains about the syntax:

SELECT TOP @Top

Can anyone advise me how i should be doing this?

View 3 Replies View Related

Selecting A Specified Number Of Rows

Jul 30, 2007

I know I can use "First" to specify a number of rows to return from a query but is it possible for the number of rows returned to be based on a parameter, something like this:

SELECT FIRST @someNumber name, age
FROM friends
WHERE age > @ageInput

View 3 Replies View Related

Number Of Rows In A Table

Nov 18, 2007

HI!
1.select count(*) from sales
2.select rows from sysindexes where id=object_id('sales') and indid<2

both queries return number of rows.
can anyone tell me which one is better?

View 2 Replies View Related

Very Large Number Of Rows

Jul 23, 2005

We are busy designing a generic analytical system at work that willhold multiple analytic types over time. This system is being developedin SQL 2000.Example of tableIDENTITY intItemId int [PK]AnalyticType int [PK]AnalyticDate DateTime [PK]Value numeric(28,15)ItemId - the item for which the analytic is being storedAnalyticType - an arbitrary typeThe [PK] tag indicates the composite primary key.Our scenario is the following:* For this time series data, we expect around 250 days per year(working days) and the dataset could extend to over 20 years* Up to 50 analytic types* Up to 20,000 itemsLooking at the combined calculation - this comes to roughly somethinglike25 * 20,000 * 50 * 250 or around 5 billion rows.We will be inserting around 50*20,000 or around 1 million rows each day(the inserts will take place in the middle of the night (outside themain query time) - this could be done through something like BCP orBULK INSERT.Our real problem is we have not previously worked with such largetables before and are nervous that our system is going to grind to ahalt. Our biggest tables are around 20 million rows at the moment.Scanning through google and microsoft's own site we have found aparititioning method that is available.http://www.microsoft.com/resources/...art5/c1861.mspxHaving experimented with the above system it seems rather quirky andlooking at the available literature it seems that this is not moreeffective than a clustered index as far as queries go.It needs to be optimized for queries like:Given the ItemID and the AnalyticType search for a specific date or aspecific range of dates.If anyone has any experience or helpful suggestions I would reallyappreciate it.ThanksA

View 4 Replies View Related

How To Count Number Of Rows

Jul 20, 2005

Hello, DeanTry this:select distinct c1, c2 into #tmp_1 from t1select count(*) as cnt from #tmp_1drop table #tmp_1With best regards.

View 1 Replies View Related

Large Number Of Rows.

Apr 3, 2007

Hi all,



A select query returns around 1 million rows. The column in the WHERE condition is indexed. This query takes nearly 1 minute for returning the all the records. Is this normal ?



Does the number of records returned affect the performance inspite of the indexing ?



Thanks,



DBLearner

View 3 Replies View Related

Get Number Of Rows Returned

Oct 18, 2007

I have a report that calls a stored procedure. I want to display the number of records that the stored procedure returned. I can't seem to find an expression that will do this. Is there an expression that will display the record count for a dataset?

Thanks,
Rob

View 1 Replies View Related

How To Get The Value Of Number Of Rows In Groupfooter

Jan 9, 2007

I want to show how many records populated in the groupby clause, i want to show the number of rows value in the group footer.

Thank you very much.

View 1 Replies View Related

What Is The Easiest Way To Get The Number Of Rows In A Table?

Jul 24, 2007

With classic asp I would do something like this:
set conn = server.createobject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename "set rs = conn.execute("select count(*) from myTable")response.write rs(0)How can I do this with asp.net in the fewest number of lines?  

View 3 Replies View Related

ExecuteNonQuery To Count Number Of Rows??

Sep 5, 2007

My understanding from a previous thread was that ExecuteNonQuery() could be used to display the number of rows returned.
Does this also work when calling stored procedures and passing parameters?
I have code (shown) that perfectly calls and returns Distinct models downloaded by Country. Yet the rowCount variable displays a -1.
What should I do?Dim myCommand As New SqlClient.SqlCommand
myCommand.CommandText = "ap_Select_ModelRequests_RequestDateTime"
myCommand.CommandType = CommandType.StoredProcedure
myCommand.Parameters.AddWithValue("@selectDate", dateEntered)
myCommand.Parameters.AddWithValue("@selectCountry", CInt(selectCountry))
myCommand.Connection = con
con.Open()
Dim rowCount As Integer = myCommand.ExecuteNonQuery()
numberParts.Text = rowCount.ToString
con.Close() Thank you.

View 6 Replies View Related

Count The Number Of Rows Returned - How??

Oct 13, 2007

hello,
i have a stored procedure SELECT CommentID, UserName, CommentingDate
FROM Comm
WHERE PictureID = @PictureID
ORDER BY CommentingDate DESC
 witch shows me the users who commented a Picture with PictureID = x
I need to add two rows at that stored procedure, one to show the number of total comments at that picutre (like counting the number of rows returned) and the second to show count the DISTINCT users who commented that picture
I tryied with COUNT but i have to use GROUP BY and i don't think this is good...
I hope you understand... please help me,
thanks

View 5 Replies View Related

Return Number Of Rows From A Table

Dec 9, 2007

Im am trying to return the number of rows in a table and i only can get a response of true thanks for any help 

View 3 Replies View Related

How Do You Delete (x) Number Of Rows From Database

Jan 10, 2008

I am setting up a database which schedules production and tracks inventory of items on a daily basis.  The scheduler may put in 100 identical entries (apart from the identity column) of an item with its corresponding quantity.  My problem is, if there is a shipment of product (a subtraction of quantity from the database), how can I delete a specified number of rows where the inventory listing is 100,000 pcs?  I think the DELETE TOP(r) command will work but I don't know how make the command into an actual variable.  Maybe there is another way too...
My current not-working try;  I look at the product desired to delete, figure out how many rows to delete, and since it is not always an integer, figure out a quantity to add back in.  The addition part works fine but delete command needs work.  Any help is appreciated.
    int InvRows = 0;    decimal RealInvRows = 0;    decimal AddQty = 0;    int preAddAmount = 0; protected void DelInv_Click(object sender, EventArgs e)    {        Label TotProdSum = (Label)DetailsView2.FindControl("TotProdSum");        Label RowQty = (Label)DetailsView3.FindControl("RowQty");        int SubQty = Convert.ToInt32(ShipQty.Text);        InvRows = SubQty / Convert.ToInt32(RowQty.Text) + 1;        RealInvRows = SubQty / Convert.ToDecimal(RowQty.Text);        AddQty = (InvRows - RealInvRows) * Convert.ToInt32(RowQty.Text);        IntLbl.Text = Convert.ToString(InvRows);        RealLbl.Text = Convert.ToString(RealInvRows);        preAddAmount = Convert.ToInt32(AddQty);        AddAmount.Text = Convert.ToString(preAddAmount);                for (int r = 0; r <= InvRows; r++)        {            forWhile.DeleteCommand = "DELETE TOP (r) FROM Inventory WHERE (Inventory = @Inventory)";            forWhile.DeleteParameters.Add("Inventory", RowQty.Text);            forWhile.Delete();            forWhile.DeleteParameters.Clear();        }        forWhile.InsertCommand = "INSERT INTO Inventory(Dte, Product, Inventory) VALUES (@Dte, @Product, @Inventory)";        forWhile.InsertParameters.Add("Inventory", AddAmount.Text);        forWhile.InsertParameters.Add("Product", InvProdDDL.Text);        forWhile.InsertParameters.Add("Dte", Date.Text);        forWhile.Insert();        forWhile.InsertParameters.Clear();    } 

View 1 Replies View Related







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