Tyring To Figure Out What's In The Buffer Pool

Apr 16, 2007

Hi, I'm trying to chase down some bottlenecks, and am currently tyring to figure out what's actually in our data buffer pool.

We've recently upgraded to SQL Server 2005 (sp2a); there's 4GB memory on the box (an active/passive cluster) with the /3GB switch set. I'm working on the learning curve for

sys.dm_os_buffer_descriptors and sys.allocation_units [and boy I sure wish SSMS's query windows wouldn't "copy" in HTML]. Based on BOL and some poking around, I've come up with the following query to list pages used within a given database:



SELECT

count(*) cached_pages_count

,isnull(obj.name, '<unidentified object>') TableName

,obj.index_id

,ind.name

from sys.dm_os_buffer_descriptors bd

left outer join (select

object_name(object_id) name

,object_id

,index_id

,allocation_unit_id

from sys.allocation_units au

inner join sys.partitions p

on au.container_id = p.partition_id -- 2005 compatible, but maybe not in future versions

) obj

on bd.allocation_unit_id = obj.allocation_unit_id

left outer join sys.indexes ind

on ind.object_id = obj.object_id

and ind.index_id = obj.index_id

where bd.database_id = db_id()

group by obj.name, obj.object_id, obj.index_id, ind.name

order by cached_pages_count desc



This would appear to list how many pages are sitting in our buffer pool for which objects for the currently selected database. The thing is, for our "main" database, the vast majority of pages fall in that "unidentified" bucket -- their allocation_unit_ids are not in sys.allocation_units (or tempdb, I checked there just in case).

My question is: what are these pages? Where is this data coming from? Might these somehow be related with our execution/query cache, which appears to be larger than our data cache?

As may be obvious, this is all new to me, and any help would be greatly appreciated!





t

View 1 Replies


ADVERTISEMENT

SQL 2012 :: Backups And Buffer Pool

Jan 23, 2015

I am sure I have seen in the past in a monitoring tool that PLE drops off to 0 whenever we do a backup. I was doing some reading around this however and found something that said backups use a different portion of memory external to the buffer pool (minmax settings).

Is this correct and how can I tell how much memory will be required for a backup?

View 2 Replies View Related

Will Buffer Pool Extensions Have Benefit If Already On SSDs?

Sep 24, 2015

I am reading about Buffer Pool Extensions, and how it stores data pages on media like an SSD, to speed up retrieval in future. Would this be useless if my mdf files are already on SSD media? At most, I envisage it meaning that instead of grabbing the data from the mdf, it would grab the data from the buffer pool extension drive, but if they are both on SSD's, I'm not sure of how much return I would see.

Has any user decided to use BPE when their data is already on SSD's, and have they noticed any improvement in these cases?

View 1 Replies View Related

DB Engine :: Buffer Pool Extensions On Shared SSD

Oct 9, 2015

Extending the buffer pool onto an SSD drive that is shared ? For instance, if we had a mirrored system drive(The C logical partition) on SSD's, can we use the remaining space on that mirrored partition to extend my SQL 2014 buffer pool ? I understand that in this scenario, there is some competition for the I/O throughput between SQL Server's extended buffer pool and the OS. We intend to have the pagefile on a different disk, other than this specific SSD. 

View 11 Replies View Related

SQL Server Admin 2014 :: Buffer Pool Extensions On Shared SSD?

Oct 8, 2015

extending the buffer pool onto an SSD drive that is shared ? For instance, if we had a mirrored system drive(The C logical partition) on SSD's, can we use the remaining space on that mirrored partition to extend my SQL 2014 buffer pool ? I understand that in this scenario, there is some competition for the I/O throughput between SQL Server's extended buffer pool and the OS. We intend to have the pagefile on a different disk, other than this specific SSD.

View 1 Replies View Related

Synchronization Error:The Buffer Pool Is Too Small Or There Are Too Many Open Cursors.

Mar 15, 2006

Hello:

I tried to synchronize the SQL 2000 database with the SQL mobile server on PDA with SQL server management studio from SQL 2005. I got the error as €œThe buffer pool is too small or there are too many open cursors. HRESULT 0x80004005 (25101) €?. The SQL database file size is 120MB.

I create the .sdf file on PDA with the following C# code:

string connString = "Data Source='Test.sdf'; max database size = 400; max buffer size = 10000;";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();

I think the 400MB max database size and 10000KB max buffer size are big enough to hold that SQL database data and I have already successfully synchronized my PDA with another smaller SQL server database file. I have been kept trying and searching this for couple of days and still can not figure it out.

Moreover, the synchronization always stops at the same table.

Please help and a lot of thanks in advance.

View 1 Replies View Related

SQL Server 2008 :: Identify Size Of Data Cache Allocated From Buffer Pool

Oct 20, 2011

How do i check the size of the datacache allocated from the buffer pool by sql server?

DMV or anything to show me the pool allocation sizes for the various pools in sql server i think i may be able to work from there.

View 9 Replies View Related

SQL 2005 Mobile Edition Error: The Buffer Pool Is Too Small Or There Are Too Many Open Cursors.

Feb 2, 2006

I am working with merge replication. The db server is running Windows 2003 Server Std x64 with SQL 2005 Std x64. The IIS server is running Windows 2003 Server Stx x86. The clients are Windows Mobile 5.0 running SQL 2005 Mobile.

I have previously been able to get the test client to initialize a subscription to the publication. I made some changes recently and added about 7 tables, bringing the total articles to 104. Some of the articles have unpublished columns, which means they are using vertical filtering as well. This publication is also using parameterized filters. During publication creation, there are several warnings that "Warning: column 'rowguid' already exists in the vertical partition".

The snapshot agent runs without any errors. When the client attempts to initialize, I get the error "The buffer pool is too small or there are too many open cursors."

My question is 2 part. First, what is causing this error, and second, how can it be resolved?

View 1 Replies View Related

Cannot Allocate More Connection.connect Pool Is At Maximum Increase Max Pool Size

Feb 21, 2007

hi i'm having this error on my application"cannot allocate more connection.connect pool is at maximum increase max pool size" the proble is when i do testing this error does not apply it only Appears when the application is been used by many people
How can I resolve this?
Thanks

View 1 Replies View Related

Real Figure Instead Of Exponential Figure Needed

May 29, 2008

Hello,

I use OPENROWSET to read values from Excel and store them in a SQL Server table. In the Excel file I have a row having format 'Number' with two decimal places.

Example: 1225000.00

When I select this value using SSMS I get the correct value:

1225000

Strange enough, I cannot see the decimals anymore. However, when I now store this value into my table and then select it from there I get: (the datatype in the table is VARCHAR(max))

1.225e+006

I would not care if I could convert this back to a numeric datatype but this seems not to work: CAST('1.225e+006' as INT) throws an exception. Obviously OPENROWSET sends the data strictly as a character string. Storing this into varchar(max) works for small figures but it starts to use exp values for big figures.

Does anybody has an idea how to bring huge Excel based figures safely into a MS SQL Table ?

Thanks: Peter

View 5 Replies View Related

Including MTD And YTD Figure With A Daily Figure

Feb 4, 2008

Hello,
I have a query that returns a daily revenue figure. The query is as follows:

SELECT top 1000
ds.AcctCode,
ds.TxnDate,
SUM(isnull(ds.FuelFee,0)) + SUM(isnull(ds.CashFee,0)) + SUM(isnull(ds.ScFee,0)) AS TotalDailyRevenue,
--"MTD" = ?,
--"YDT" = ?,
ps.TC,
CASE
WHEN ps.Proj = 100 THEN 'New Account'
WHEN ps.Proj = 200 THEN 'Current Account'
END AS ProjStatus,
ps.FSR,
ps.SubmitRep1

FROM
TxnRptg.dbo.tbl_DailySummary ds
INNER JOIN SalesData.dbo.tbl_CYProcessedSales ps
ON ds.AcctCode = ps.Acct

WHERE
MONTH(ds.TxnDate) = 1
AND
Proj IN (100,200)
AND TC = 'HV'

GROUP BY
ds.AcctCode, ds.TxnDate, ps.TC, ps.Proj, ps.FSR, ps.SubmitRep1

ORDER BY
ds.AcctCode, ds.TxnDate

--*********************************

TxnDate represents a single day of the month. How can I include MTD so that the dates for the revenue total are from DATEADD(mm, DATEDIFF(mm,0,getdate()), 0) (beginning of current month) to TxnDate, and YTD so that the revenue totals are from DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) (beginning of the current year) to TxnDate?


Thank you for your help!


cdun2

View 5 Replies View Related

Timeout Expired. The Timeout Period Elapsed Prior To Obtaining A Connection From The Pool. This May Have Occurred Because All Pooled Connections Were In Use And Max Pool Size Was Reached.

Feb 11, 2004

What does this error message imply?

View 3 Replies View Related

SSDT Error - Size Necessary To Buffer XML Content Exceeded Buffer Quota

Apr 18, 2012

I encountered the following error while attempting to preview an RDL report I was developing in VS2010 using SSDT:"The size necessary to buffer the XML content exceeded the buffer quota"

View 3 Replies View Related

Reporting Services :: Size Necessary To Buffer XML Content Exceeded Buffer Quota

Oct 7, 2015

We have a set of reports with same header section in all the reports. So while developing a new report i used to copy that header section to the new report with same dataset names (without any change) , but while rendering the report it is throwing error " The size necessary to buffer the XML content exceeded the buffer quota".

View 2 Replies View Related

Error: The Buffer Manager Failed To Create A New Buffer Type

Apr 28, 2006

Hi

I have a master package that executes a series of sub packages run from a SQL Agent job. One of those sub packages has been stable for a week, running at least once per day, but it just failed despite having been run once already today with the same set of input data.

There were a series of errors showing in the event log for the Execute Package Task starting with "Buffer Type 15 had a size of 0 bytes.", then "The buffer manager failed to create a new buffer type.", then "The Data Flow task cannot register a buffer type. The type had 32 columns and was for execution tree 3.", then "The layout failed validation." and finally "Error 0xC0012050 while loading package file "C:[Package].dtsx". Package failed validation from the ExecutePackage task. The package cannot run.".

SQLIS.com reports the constant for the error code as DTS_E_REMOTEPACKAGEVALIDATION ( http://wiki.sqlis.com/default.aspx/SQLISWiki/0xC0012050.html ).

I then ran the package on my dev machine in BIDS and it worked fine, so I re-ran the job on the server and this time that package executed ok, but another one fell over but did not put anything in the event log.

Does any one have any idea what happened?

TIA . . . Ed

View 2 Replies View Related

Warning - Kept Reference To Buffer - What Can Be Done About These Buffer Warnings?

Mar 6, 2008

Good day everyone,

I'm experiencing a completely random warning from any given row count component within any given data flow task. It occurs sporadically. Whilst distracting, I don't see any adverse effects to the data after the packages complete. Can someone weigh in on this warning and let me know if it is indeed benign or what I maybe able to do to fix it?

Here's the warning:

"A call to the ProcessInput method for input 75997 on component "CNT Rows sent for STG table" (75995) unexpectedly kept a reference to the buffer it was passed. The refcount on that buffer was 4 before the call, and 5 after the call returned."

Thanks,

Langston

View 4 Replies View Related

How Do I Write Multiple Pipeline Buffer To Multiple Targets Based On A Calculated Value In The Pipeline Buffer

Apr 6, 2007

The scenario is as follows: I have a source with many rows. Each row has a column called max_qty_value. I need to perform a calculation using another column called qty. This calculation is something similar to dividing qty/(ceiling) max_qty_value. Once I have that number I need to write an additional duplicate row for each value from the prior calculation performed. For example, 15/4 = 4. I need to write 4 rows to the same target table as in line information for a purchase order.



The multicast transform appears to only support fixed and/or predetermined outputs. How do I design this logic in SSIS to write out dynamic number of rows to a target table.



Any ideas would be greatly appreciated.



thanks

John

View 18 Replies View Related

HELP! Can't Figure This One Out!

Jan 19, 2004

I'm in desperate need of help. I'm setting up an intranet portal using DNN. I added an event calendar module, but whenever I try to add events to it, the system rejects it with a nasty Sql exception saying the conversion from char to datetime produced an out of bounds result.

The string the table uses to convert to datetime is (I have not modified it, the module is exactly as it came when i downloaded)

(convert(varchar,getdate(),101))

The whole stack trace for the error is:

Stack Trace:


[SqlException: La conversión del tipo de datos char a datetime produjo un valor datetime fuera de intervalo.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +642
System.Data.SqlClient.SqlCommand.ExecuteReader() +11
DotNetNuke.AVCalendarDB.Save() +1067
DotNetNuke.AVCalendarEdit.updateButton_Click(Objec t sender, EventArgs e) +3367
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1263

At first I thought it could be a language issue (DNN and the module are in english and my system runs XP Pro in Spanish) but I discarded it since it didn't work when I installed XP Pro in english

Any ideas?? I would really appreciate your help
Best regards from Chile
Javier L.

View 5 Replies View Related

Please Help Me Figure This One Out.

May 1, 2008



Hi, I am somewhat new to t-sql and what I do know is from trial & error and help from this forum. What I need to do is add a column of counts for id numbers that are not unique.

This is my code:

ALTER procedure [dbo].[rptMgmtRpt]


@RptMonthBegin datetime,

@RptMonthEnd datetime


as




SELECT Summons.ID, Convert(varchar, Venire.VenireDateTime,101)as VenireDateTime, Venire.VenireStatusID, Summons.SummonsStatusID, Summons.ExcusalCodeID,

Venire.ID AS VenireID, { fn WEEK(Venire.VenireDateTime) } AS wkNum, { fn DAYOFWEEK(Venire.VenireDateTime) } AS wkDay, Venire.JuryTypeID,

Venire.VenireLocationID, summons.compensationTypeID

,{fn IFNULL(AccountingTransactionRequest.PaymentAmount,0)} AS payAmt

,Convert(varchar,AccountingTransactionRequest.ServiceDate,101) as AcctServDate

,{fn count(summons.id)}

FROM Venire INNER JOIN

Summons ON Venire.ID = Summons.VenireID

LEFT outer JOIN

AccountingTransactionRequest ON Summons.ID = AccountingTransactionRequest.SummonsID

Where Venire.VenireLocationID <> 16 and (VenireDateTime BETWEEN @RptMonthBegin AND @RptMonthEnd)

ORDER BY wknum, wkday , Summons.ID

This is a sample of what I get for results:

640404 11/5/2007 128 144 2866 45 2 8 0 11/5/2007
640888 11/5/2007 128 32 2866 45 2 8 0 11/5/2007
640979 11/5/2007 32 2 2866 45 2 112 15 11/5/2007
640979 11/5/2007 32 2 2866 45 2 112 15 11/6/2007
640979 11/5/2007 32 2 2866 45 2 112 15 11/7/2007
641533 11/5/2007 128 32 2866 45 2 8 0 11/5/2007
641762 11/5/2007 128 144 2866 45 2 8 0 11/5/2007
641851 11/5/2007 1024 2 2866 45 2 8 0 11/5/2007




What I need are results that look like this:

640404 11/5/2007 128 144 2866 45 2 8 0 11/5/2007 1
640888 11/5/2007 128 32 2866 45 2 8 0 11/5/2007 1
640979 11/5/2007 32 2 2866 45 2 112 15 11/5/2007 1
640979 11/5/2007 32 2 2866 45 2 112 15 11/6/2007 2
640979 11/5/2007 32 2 2866 45 2 112 15 11/7/2007 3
641533 11/5/2007 128 32 2866 45 2 8 0 11/5/2007 1
641762 11/5/2007 128 144 2866 45 2 8 0 11/5/2007 1
641851 11/5/2007 1024 2 2866 45 2 8 0 11/5/2007 1


In the first column, 640979 appears three times.
How do I get that count in the last column of my results ?

Thanks so much for your help!!!

View 4 Replies View Related

Cannot Figure Query Out

May 2, 2008

I have a small database in which Employee's are linked to "Tags".   These tags can be red or yellow.  So,  I have 3 tables.
Tag_Colors :    tag_color_ID   ,    tag_colors
Employee_Table:  employeeID    ,      employee_name  
Tag_Table:      tagID,    tag_color_ID,   employeeID,   tag_notes
 
I need to be able to perform a query, where I can list employee's by the number of tags they have.
I don't even know how to get started on this  --     could anybody point me in the right direction?
After I can et a query working,  I think I can take it from there  -- and get it to display on a web page.
 
Thanks in advance. 
 
 
 
 
 
 
 
 

View 4 Replies View Related

Who's Smart Enough To Figure This Out?

Mar 9, 2004

Hello All,

I've been trying to get a range of values out of my SQL Server 2000 db without sucess. The field in question has the data type of char(8) and looks like this:

House_numbr_pub (leading spaces in front of each value)
140A
140
141
142
143
144
145
146
147
148
149
150
151
.
.
.
14500
.
.
.

Does anyone know how write a sql statement that will return 140-150, but excluding the ' 14500' and 100-1000. I tried the following where clause to return a range between 100-1000.

WHERE (cook.STREET_PUB LIKE 'lincoln%') AND (LEN(LTRIM(cook.HOUSE_NUMBR_PUB)) BETWEEN 3 AND 4) AND (
(LTRIM(cook.HOUSE_NUMBR_PUB) >= '100') and (LTRIM(cook.HOUSE_NUMBR_PUB) <= '1000') )

This where clause only return two records (100 and 1000). I want it to return 100-1000.

I also tried the following where clause:

WHERE LTrim(cook.HOUSE_NUMBR_PUB) like '1[45][0-9]'
OR
LTrim(cook.HOUSE_NUMBR_PUB) like '1[45][0-9]'

However, building this on the fly with .net will take some effort if someone is trying to search range 1-10000000.


Please Help,

James

View 3 Replies View Related

Can't Figure Out This Query

Feb 21, 2007

I have a table with multiple records.

Some have the same value in the 'subkey' field.
I want to select all the records from the table that have their highest MAINKEY.

So say there were 4 records in the table that has 3 fields (id, subkey and mainkey)

Each record has a unique id field but the subkeys are the same for the first two and the sub keys are the same for the last two while the Mainkey can be different.

So the tables looks sort of lLike this:

ID SK MK
1 10 2
2 10 3
3 25 2
4 25 3

I want to query and select one record for each subkey, but I want it to be record that has the highest mainkey. In this case, it would be records with ID 2 and 4.

I can not figure this out. :eek:

Any help would be GREATLY appreciated.

View 3 Replies View Related

Figure Is Rounding Up

Mar 13, 2007

I have the following sp which is appending records into my table. However the values appended are being round up eg

SC_PrimaryPupilPrice is 1.5

but when it is inserted into the sql table it is 2

The field in the sql table is numeric.

CREATE PROCEDURE spSM_AddWeeksandMealPrices

@dteWeekEnding datetime

as

INSERT INTO tblSM_Meals
(ML_Id,
ML_WeekEnding,
ML_SchoolNumber,
ML_PupilMealPrice,
ML_AdultMealPrice,
ML_SpillagesMealPrice,
ML_AdultRechargeMealPrice,
ML_ReservedMealPrice)

select convert(varchar,@dteWeekEnding ,103) + '*' + cast(SC_SchoolNumber as varchar(10)) , convert(datetime,@dteWeekEnding ,106),
SC_SchoolNumber,
SC_PrimaryPupilPrice,
SC_PrimaryAdultPrice,
SC_PrimaryPupilPrice,
SC_PrimaryAdultPrice,
SC_PrimaryAdultPrice
from tblSM_Schools
GO

View 4 Replies View Related

Can't Figure Out This Error!

Jun 8, 2007

Here is my code below. When I attempt to run the data flow task that calls this script, I get this error:



"Index was outside the bounds of the array."



I honestly do not know what the problem is here. There are definitely 6 columns in the file. In fact, even if comment out everything except the first line (myCol1), I still get the "Index was outside the bounds of the array." error.



Any ideas??? Need help.



Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim rowValues As String()

rowValues = Row.Line.Split(columnDelimiter) 'parse row by comma

If Row.Line Like "*OPENING BALANCE*" Then

Row.AccountNumber = Nothing 'set to null for conditional split

Row.OpeningBalance = CDec(rowValues(3)) 'get the 4th value



ElseIf Row.Line Like "*CLOSING BALANCE*" Then

Row.AccountNumber = Nothing 'set to null for conditional split

Row.ClosingBalance = CDec(rowValues(2)) 'get the 3rd value



Else

Row.myCol1 = CStr(rowValues(0)).Replace("""", String.Empty)

Row.myCol2 = CStr(rowValues(1)).Replace("""", String.Empty)

Row.myCol3 = CStr(rowValues(2)).Replace("""", String.Empty)

Row.myCol4 = CStr(rowValues(3)).Replace("""", String.Empty)

Row.myCol5 = CStr(rowValues(4)).Replace("""", String.Empty)

Row.myCol6 = CDec(rowValues(5))



End If

End Sub

View 10 Replies View Related

The Use Of Pool Or Pooling?

Jul 13, 2006

1) What is the use of pooling actually?
I have an online application using SQL server, where I can check the connection pool from, SQL Server Enterprise Manager->Microsoft SQL Server->SQL Server Group->LOCAL->Management->Current Activity->Process Info.
2) In the connection pool, when I log into my system, a connection is made as I run query using stored procedure thus making the process available in the connection pool. Now when I am done and log out of the system, does the process suppose to stay there or not (the connection closed) and making it disappear from the pool?
I read from some forum that pooling is a good thing as it make accesing data faster.

View 2 Replies View Related

SQL Pool Connections

Aug 22, 2006

HiI have written the following function public System.Data.SqlClient.SqlDataReader ExcuteReader(string strQuery, string strConnection)    {        System.Data.SqlClient.SqlCommand myCommand;        System.Data.SqlClient.SqlDataReader myReader;        myCommand = new System.Data.SqlClient.SqlCommand(strQuery, new System.Data.SqlClient.SqlConnection(strConnection));        myCommand.Connection.Open();        myReader = myCommand.ExecuteReader();        return myReader;    }to return a datareader for me but right now I am facing the problem that it seems this function isn't closing the connection by itself which is resulting in an error saying "Timeout expired.  The timeout period elapsed prior to
obtaining a connection from the pool.  This may have occurred because
all pooled connections were in use and max pool size was reached" and if I close it manually I will lose the data in the readerso are there any suggestions of what I should do?thank you

View 4 Replies View Related

Connection From The Pool

Mar 14, 2007

 
I build an asp.net 2.0 (VS 2005) web application and put it on the server. The installed SQL server is SQL server 2003. I get this error message when i keep the application running for 10 or 15 mins. "Timeout expired. The timeout period elapsed prior obtaining a connection from the pool. This may have occure because all pooled connections were in use and max pool size was reached."
I made the server timeout unlimited but the error keeps coming up after some time of openning the application. The application session time out redirects the user to the login page and doesn't throw an error like the one i mentioned above.
 Any idea. Thanks in advance.

View 4 Replies View Related

Max Pool Connection

Jun 28, 2007

hello to all
my problem is
when in database it reaches nearly 100 active connections (i check it from detach database) , my application does not allow me to open new browser page and show me error like:
time out expire. the max connection pool is reached.
 
please help.

View 2 Replies View Related

Min Pool Size

Jul 20, 2005

Hello Experts,I make a connection with .Net Sqlclient Data Provider tomy server and I adjust the min pool size = 0, but when Icheck the sysprocesses I see that 2 connections have beenmade. Why is that? am I missing something here?Conn. string"server=MYSERVER;user id=sa;database=MYDB;min poolsize=0;max pool size=10;packet size=3072;ApplicationName=MYAPP"Thanks in advanceMichas KonstantinosSQL Sewrver Developer, DBA*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 1 Replies View Related

New On Asp.net 2.0 Trying To Figure Out How To Connect To A Database

Mar 22, 2007

Right now I'm just looking at websites how to create a database and putting it in the App_Data folder which is no problem.  What I want to do is Programmatically do it.  in the example code that I see it says:
Dim ConnString as string = ConfigurationManager.ConnectionStrings(connStringName).ConnectionString
or
Dim MyConnString as new sqlconnection = New SqlConnection(ConfigurationManager.ConnectionStrings(connStringName).ConnectionString)
now every time I put the connStringName in the parenthasis it tells me that its an error: Name connstringName is not declared.
I figure the connstringName is the name in the connectionStrings in the web.config.
 So I am doing something wrong here, I would appreciate any help.

View 1 Replies View Related

Can't Figure Out Error Message In SQL

Oct 16, 2007

Can someone please look at my stored procedure? I am trying to create the following stored procedure, but get the following errormessages:
Msg 102, Level 15, State 1, Procedure InsertWork, Line 3Incorrect syntax near '7'.Msg 102, Level 15, State 1, Procedure InsertWork, Line 25Incorrect syntax near '@7am8am'.
USE [Work]GO
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE [dbo].[InsertWork](  7am8am       nvarchar(500),  8am9am       nvarchar(500),  9am10am       nvarchar(500),  10am11am      nvarchar(500),                  11am12noon    nvarchar(500),                12Noon1pm     nvarchar(500),  1pm2pm       nvarchar(500),  2pm3pm       nvarchar(500),  3pm4pm        nvarchar(500),  4pm5pm       nvarchar(500),                  5pm6pm       nvarchar(500),  6pm7pm       nvarchar(500),  7pm8pm       nvarchar(500),  8pm9pm        nvarchar(500),  9pm10pm       nvarchar(500),                  10pm11pm      nvarchar(500),  Notes         nvarchar(500),         Date           nvarchar(15))AS BEGIN INSERT INTO WorkDay VALUES                 @7am8am,                 @8am9am,  @9am10am,   @10am11am,   @11am12Noon,  @12Noon1pm,  @1pm2pm,  @2pm3pm,  @3pm4pm,  @4pm5pm,  @5pm6pm,  @6pm7pm,  @7pm8pm,   @8pm9pm,  @9pm10pm,  @10pm11pm,  @Notes,  @DateEND
 

View 3 Replies View Related

Trying To Figure Out A Suitable Sql Structure

Oct 17, 2007

I'm new to sql and have come up with a problem and can't seem to find the answer. Most would probably find it simple but I cant get my head around it! :p
I have the following table structure
User_Table-----------User_ID (Key)FirstNameLastName
Contacts_Table--------------User_ID (F key)Contact_User_ID
User_Table stores all users details and assigns them a User_ID. Users can add other users to their contacts, and this will be stored in Contacts_Table on a one-to-many basis.
*deep breath*... So User_ID in Contacts_Table, will store the User_ID from User_Table, and the Contact_User_ID in Contacts_Table will store the User_ID from User_Table. Does this seem ok? Sorry if I confused everyone!
So my question is, how do I select a user and show all his contacts (names etc)? I thought I could use innerjoin but I dont think it would work here.
Any ideas?
Thanks!

View 3 Replies View Related

I Need A Very Good SQL Genious To Help Me Figure Out How To Do This....

Sep 15, 2005

I have a simple table right now that has some rows listed like this:Table Name = TicketStatusTicketNumber      TicketType        Status         Time1                             Normal               In                 09/15/2005 10:50:213                             Normal               In                 09/11/2005 19:25:101                             Normal               Out              09/15/2005 11:45:103                             Normal               Out              09/11/2005 20:27:092                             Normal               In                 09/14/2005 17:25:101                             Normal               Pay              09/15/2005 11:15:152                             Normal               Out              09/14/2005 21:45:30What I want to do is select only 1 row per ticket number, and this row needs to be the row that has the LATEST time for that particular ticket number.  Then I want to sort the results by ticket number decending.  So for instance, the select I am looking for would bring me back ONLY the following rows in the following order: TicketNumber      TicketType        Status         Time3                             Normal               Out              09/11/2005 20:27:092                             Normal               Out              09/14/2005 21:45:301                             Normal               Out              09/15/2005 11:45:10My issue is I do not know how to go about selecting ONLY 1 row per ticket number, and the row I select has to be the row with the latest date for that particular ticket number.Can any SQL gurus provide me with some code in order to do this?  Thanks so much for the help guys!

View 1 Replies View Related







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