Showing posts with label selected. Show all posts
Showing posts with label selected. Show all posts

Tuesday, March 20, 2012

Patch SP4 hanging

SP4 installation hangs. I used windows login to do the patch, a message
saying that it is not a valid user. I selected "retry" then used "sa". It
started hanging when "...MDAC" message disappeared.
I checked c:\winnt\sqlsp.log file. It is different from the files on the
other normal patched servers.
The last 2 lines in the file are:
End: Installpkgs(ID_INSTALLMDAC)
**** Starting open OP in write mode ****
What is the cause? How to fix it?
Hi Julia
You may want to try using the MDAC component checker to see if you have a
consistent installation of MDAC and possibly loading MDAC MDAC 2.8 SP1 if on
Windows 2000 or MDAC 2.8 SP2 if on XP/Windows 2003 before installing the
service pack.
http://www.microsoft.com/downloads/r...splayLang= en
John
"Julia" <Julia@.discussions.microsoft.com> wrote in message
news:686DFD79-5223-4A80-BF1B-99469046BF5D@.microsoft.com...
> SP4 installation hangs. I used windows login to do the patch, a message
> saying that it is not a valid user. I selected "retry" then used "sa".
> It
> started hanging when "...MDAC" message disappeared.
> I checked c:\winnt\sqlsp.log file. It is different from the files on the
> other normal patched servers.
> The last 2 lines in the file are:
> End: Installpkgs(ID_INSTALLMDAC)
> **** Starting open OP in write mode ****
> What is the cause? How to fix it?

Patch SP4 hanging

SP4 installation hangs. I used windows login to do the patch, a message
saying that it is not a valid user. I selected "retry" then used "sa". It
started hanging when "...MDAC" message disappeared.
I checked c:\winnt\sqlsp.log file. It is different from the files on the
other normal patched servers.
The last 2 lines in the file are:
End: Installpkgs(ID_INSTALLMDAC)
**** Starting open OP in write mode ****
What is the cause? How to fix it?Hi Julia
You may want to try using the MDAC component checker to see if you have a
consistent installation of MDAC and possibly loading MDAC MDAC 2.8 SP1 if on
Windows 2000 or MDAC 2.8 SP2 if on XP/Windows 2003 before installing the
service pack.
http://www.microsoft.com/downloads/results.aspx?productID=&freetext=mdac&DisplayLang=en
John
"Julia" <Julia@.discussions.microsoft.com> wrote in message
news:686DFD79-5223-4A80-BF1B-99469046BF5D@.microsoft.com...
> SP4 installation hangs. I used windows login to do the patch, a message
> saying that it is not a valid user. I selected "retry" then used "sa".
> It
> started hanging when "...MDAC" message disappeared.
> I checked c:\winnt\sqlsp.log file. It is different from the files on the
> other normal patched servers.
> The last 2 lines in the file are:
> End: Installpkgs(ID_INSTALLMDAC)
> **** Starting open OP in write mode ****
> What is the cause? How to fix it?

Monday, March 12, 2012

Patch SP4 hanging

SP4 installation hangs. I used windows login to do the patch, a message
saying that it is not a valid user. I selected "retry" then used "sa". It
started hanging when "...MDAC" message disappeared.
I checked c:\winnt\sqlsp.log file. It is different from the files on the
other normal patched servers.
The last 2 lines in the file are:
End: Installpkgs(ID_INSTALLMDAC)
**** Starting open OP in write mode ****
What is the cause? How to fix it?Hi Julia
You may want to try using the MDAC component checker to see if you have a
consistent installation of MDAC and possibly loading MDAC MDAC 2.8 SP1 if on
Windows 2000 or MDAC 2.8 SP2 if on XP/Windows 2003 before installing the
service pack.
http://www.microsoft.com/downloads/...La
ng=en
John
"Julia" <Julia@.discussions.microsoft.com> wrote in message
news:686DFD79-5223-4A80-BF1B-99469046BF5D@.microsoft.com...
> SP4 installation hangs. I used windows login to do the patch, a message
> saying that it is not a valid user. I selected "retry" then used "sa".
> It
> started hanging when "...MDAC" message disappeared.
> I checked c:\winnt\sqlsp.log file. It is different from the files on the
> other normal patched servers.
> The last 2 lines in the file are:
> End: Installpkgs(ID_INSTALLMDAC)
> **** Starting open OP in write mode ****
> What is the cause? How to fix it?

Monday, February 20, 2012

Passing SqlDataSource object an array as a parameter

Hi,

I am trying to get the selected options from a listbox and either pass a SqlDataSource object the array or loop through it and pass each element of the array. I then need to modify the returned databtable to graphing function, but first drop the last column. I was wondering if anyone can help me with the following:

1. Pass an array into SqlDataSource Select OR
2. Pass a single argument into the Select statement and populate a datatable without it writing over the current row each time it iterates through the foreach statement. I am looking for the dataview to append to dt each time it loops. Is there a property for dataview that behaves like the "ClearBeforeFill" for table adapters?
3. Update a parameter programmatically

Below code works, but I think it can be more efficient. Any suggestions would be greatly appreciated.

Thanks in advance!!

DataTable dt = new DataTable();
DataTable dt2 = new DataTable();
DataView dv = new DataView();

foreach(ListItem liOptions in ListBox1.Items)
{
if(liOptions.Selected)
{
SqlDataSource1.SelectParameters.Add("Parameter1", liOptions);
dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
dt2 = dv.Table;
dt.Merge(dt2);
dt2.Dispose();
SqlDataSource1.SelectParameters.Clear();
}
}


if (dt.Rows.Count > 0)
{
Graph(dt); //Pass original datatable (dt) to Graph();
dt.Columns.RemoveAt(2); //Reformat datatable (dt) and remove last column before binding to Gridview1

GridView1.DataSource = dt;
GridView1.DataBind();
} else {

errorMessage.Text = "No data was returned!";
}

Dear sillyrabbit,

XML. It's a new feature in SQL Server 2005. If you don't have SS2005, then I don't think this will work for you.

The best way to pass an array to is to use XML.

XmlDocument xmlDocument =new XmlDocument();XmlElement rootNode = xmlDocument.CreateElement("RootName");xmlDocument.AppendChild(rootNode);XmlElement xNode;XmlText xText;for (int intList = 0; intArray.Length > intList; ++intList){if (intArray[intList] != 0){xNode = xmlDoc.CreateElement("IdName");xText = xmlDoc.CreateTextNode(intArray[intList].ToString());rootNode.AppendChild(xNode);xNode.AppendChild(xText);}}return xmlDocument.InnerXml;

http://grahamsibley.typepad.com/thoughtfactory/2006/09/stored_procedur.html

hope this helps,

fathrDave

|||

Also,

Your SqlDbType needs to be XML.

In the Stored Procedure I used "CROSS APPLY @.xmlName.nodes('//IdName') as R(nref)" to join to my DB tables (after the FROM). I did a "dbField = nref.value('.', 'int')" to connect it to DB table (after the WHERE).

I did have some trouble with ArithAbort and had to Set it to ON before I ran the proc, and then OFF afterwards. Also, the time (timeout) is a factor and I am trying to solve that currently.

hope this helps too.

fathrDave

|||Thanks very much for the suggestion. I'll give it a try.

Passing SELECTed rows to a calling SP

Hi!
I'm a new T-SQL developer and just hit a roadblock.
I have a scenario that goes like this: I have 2 stored procedures,
spInner and spOuter. spInner has a SELECT statement which would
normally be used by a class using MS Enterprise Library and that output
goes into a DataSet. However, I need to get the output of the SELECT
statement to go into spOuter and that's what I can't seem to figure
out.
I know I may be asked to use functions that return tables in replies to
this post, but I can't do that as some parts of my application have an
EXEC(string) for dynamic SQL, instead of spInner.
Any help appreciated.
Cheers,
N.I.T.I.N.For the results of spInner to be available to spOuter, there are a few
options. I have used temporary tables or persisted the data into a real
table to avoid recompiles and also have a record of the data. If you use the
latter option, you can use a guid column and each row with a guid obtained
from spOuter. This way you can easily pick up the rows you need.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||NiTiN (emailme.nitin@.gmail.com) writes:
> I'm a new T-SQL developer and just hit a roadblock.
> I have a scenario that goes like this: I have 2 stored procedures,
> spInner and spOuter. spInner has a SELECT statement which would
> normally be used by a class using MS Enterprise Library and that output
> goes into a DataSet. However, I need to get the output of the SELECT
> statement to go into spOuter and that's what I can't seem to figure
> out.
> I know I may be asked to use functions that return tables in replies to
> this post, but I can't do that as some parts of my application have an
> EXEC(string) for dynamic SQL, instead of spInner.
I have an article on my web site that discusses possible options. See
http://www.sommarskog.se/share_data.html.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Passing SELECTed rows to a calling SP

Hi!
I'm a new T-SQL developer and just hit a roadblock.
I have a scenario that goes like this: I have 2 stored procedures,
spInner and spOuter. spInner has a SELECT statement which would
normally be used by a class using MS Enterprise Library and that output
goes into a DataSet. However, I need to get the output of the SELECT
statement to go into spOuter and that's what I can't seem to figure
out.
I know I may be asked to use functions that return tables in replies to
this post, but I can't do that as some parts of my application have an
EXEC(string) for dynamic SQL, instead of spInner.
Any help appreciated.
Cheers,
N.I.T.I.N.For the results of spInner to be available to spOuter, there are a few
options. I have used temporary tables or persisted the data into a real
table to avoid recompiles and also have a record of the data. If you use the
latter option, you can use a guid column and each row with a guid obtained
from spOuter. This way you can easily pick up the rows you need.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||NiTiN (emailme.nitin@.gmail.com) writes:
> I'm a new T-SQL developer and just hit a roadblock.
> I have a scenario that goes like this: I have 2 stored procedures,
> spInner and spOuter. spInner has a SELECT statement which would
> normally be used by a class using MS Enterprise Library and that output
> goes into a DataSet. However, I need to get the output of the SELECT
> statement to go into spOuter and that's what I can't seem to figure
> out.
> I know I may be asked to use functions that return tables in replies to
> this post, but I can't do that as some parts of my application have an
> EXEC(string) for dynamic SQL, instead of spInner.
I have an article on my web site that discusses possible options. See
http://www.sommarskog.se/share_data.html.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Passing SELECTed rows to a calling SP

Hi!

I'm a new T-SQL developer and just hit a roadblock.

I have a scenario that goes like this: I have 2 stored procedures,
spInner and spOuter. spInner has a SELECT statement which would
normally be used by a class using MS Enterprise Library and that output
goes into a DataSet. However, I need to get the output of the SELECT
statement to go into spOuter and that's what I can't seem to figure
out.

I know I may be asked to use functions that return tables in replies to
this post, but I can't do that as some parts of my application have an
EXEC(string) for dynamic SQL, instead of spInner.

Any help appreciated.

Cheers,
N.I.T.I.N.For the results of spInner to be available to spOuter, there are a few
options. I have used temporary tables or persisted the data into a real
table to avoid recompiles and also have a record of the data. If you use the
latter option, you can use a guid column and each row with a guid obtained
from spOuter. This way you can easily pick up the rows you need.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||NiTiN (emailme.nitin@.gmail.com) writes:

Quote:

Originally Posted by

I'm a new T-SQL developer and just hit a roadblock.
>
I have a scenario that goes like this: I have 2 stored procedures,
spInner and spOuter. spInner has a SELECT statement which would
normally be used by a class using MS Enterprise Library and that output
goes into a DataSet. However, I need to get the output of the SELECT
statement to go into spOuter and that's what I can't seem to figure
out.
>
I know I may be asked to use functions that return tables in replies to
this post, but I can't do that as some parts of my application have an
EXEC(string) for dynamic SQL, instead of spInner.


I have an article on my web site that discusses possible options. See
http://www.sommarskog.se/share_data.html.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx