Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Sunday, March 25, 2012

Cannot display/return SQL Query Output from a Variable in DTS

I have been having a very difficult time trying to get the output of a
sql query that is in a dts global variable to return either into a
msgbox or for populating a portion of the body of a mail task.
I created an Execute SQL task with the query I wish to use. The query
has been tested in Query Analyzer and works fine and returns the results
I am looking for. Four rows are returned. Basically, I wish to put these
results in the body of a mail task or right now I would settle for a
msgbox just to see it work.
I have created the Execute SQL task as described in
http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
I have tried to retrieve the results using the example in
http://msdn.microsoft.com/library/d...y/en-us/howtosq
l/ht_dts_task_6llt.asp but I have been unable to do so.
I also tried the GetString method of the recordset without success.
I also tried the using the Storing the resultset in a flat file
example from dotnetbips.com/displayarticle.aspx?id=228 and I was unable
to write the recordset to a file.
I feel like I am going about this all wrong and the answer is just
staring me in the face and I dont get it.
I welcome suggestions and comments on how to achieve the goal of putting
the query results into the email body.
Thanks.
*** Sent via Developersdex http://www.examnotes.net ***Hi
You may want to use call xp_sendmail directly (see Books online) rather than
the DTS Send Mail task. If not this may help:
http://www.sqldts.com/default.aspx?235
John
"SJM" <nospam@.devdex.com> wrote in message
news:O8fvDgusFHA.596@.TK2MSFTNGP12.phx.gbl...
>I have been having a very difficult time trying to get the output of a
> sql query that is in a dts global variable to return either into a
> msgbox or for populating a portion of the body of a mail task.
> I created an Execute SQL task with the query I wish to use. The query
> has been tested in Query Analyzer and works fine and returns the results
> I am looking for. Four rows are returned. Basically, I wish to put these
> results in the body of a mail task or right now I would settle for a
> msgbox just to see it work.
> I have created the Execute SQL task as described in
> http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
> I have tried to retrieve the results using the example in
> http://msdn.microsoft.com/library/d...y/en-us/howtosq
> l/ht_dts_task_6llt.asp but I have been unable to do so.
> I also tried the GetString method of the recordset without success.
> I also tried the using the "Storing the resultset in a flat file"
> example from dotnetbips.com/displayarticle.aspx?id=228 and I was unable
> to write the recordset to a file.
> I feel like I am going about this all wrong and the answer is just
> staring me in the face and I don't get it.
> I welcome suggestions and comments on how to achieve the goal of putting
> the query results into the email body.
> Thanks.
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Indeed, I am considering sending the mail from within the script, but
right now I am concentrating on getting the data and other info into the
message body. Thanks for the suggestion.
*** Sent via Developersdex http://www.examnotes.net ***sql

Cannot display/return SQL Query Output from a Dispatch Variable


I have been having a very difficult time trying to get the output of a
sql query that is in a DTS global variable to return, presently to a
messagebox.
I created an Execute SQL task with the query I wish to use. The query
has been tested in Query Analyzer and works fine and returns the results
I am looking for. I set a global variable to the result set. Basically,
I wish to display the results as a string or similar in a messagebox.
I have created the Execute SQL task as described in
http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
I have tried to retrieve the results using the example in
http://msdn.microsoft.com/library/d...y/en-us/howtosq
l/ht_dts_task_6llt.asp but I have been unable to do so.
I also tried the GetString method of the recordset without success.
I also tried the using the Storing the resultset in a flat file
example from http://dotnetbips.com/displayarticle.aspx?id=228 and I was
unable to write the recordset to a file.
What is the proper way to display a variable of type dispatch? I feel
like I am going about this the wrong way.
I welcome suggestions and comments on how to achieve the goal of
displaying the query results.
Thanks.
*** Sent via Developersdex http://www.examnotes.net ***Hi
You don't seem to have:
http://msdn.microsoft.com/library/d...>
ask_4gkl.asp
listed.
John
"SJM" <nospam@.devdex.com> wrote in message
news:u6hU08ItFHA.304@.TK2MSFTNGP11.phx.gbl...
>
> I have been having a very difficult time trying to get the output of a
> sql query that is in a DTS global variable to return, presently to a
> messagebox.
> I created an Execute SQL task with the query I wish to use. The query
> has been tested in Query Analyzer and works fine and returns the results
> I am looking for. I set a global variable to the result set. Basically,
> I wish to display the results as a string or similar in a messagebox.
> I have created the Execute SQL task as described in
> http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
> I have tried to retrieve the results using the example in
> http://msdn.microsoft.com/library/d...y/en-us/howtosq
> l/ht_dts_task_6llt.asp but I have been unable to do so.
> I also tried the GetString method of the recordset without success.
> I also tried the using the "Storing the resultset in a flat file"
> example from http://dotnetbips.com/displayarticle.aspx?id=228 and I was
> unable to write the recordset to a file.
> What is the proper way to display a variable of type dispatch? I feel
> like I am going about this the wrong way.
> I welcome suggestions and comments on how to achieve the goal of
> displaying the query results.
> Thanks.
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||
Indeed, that MSDN is what I followed to get the data into the variable,
getting it out is the problem.
The workaround I am using is to execute the SQL statements in the
VBscript and not use the execute SQL DTS task. For example:
Option Explicit
Function Main()
dim cnn
dim rs
dim intLoop
set cnn=createobject("ADODB.Connection")
cnn.Open "Provider=sqloledb;" & _
"Data Source=SERVER;" & _
"Initial Catalog=msdb;" & _
"Integrated Security=SSPI"
set rs=cnn.execute("SQL STATEMENT HERE")
if rs.eof and rs.bof then
msgbox "Error: No records"
else
do until rs.EOF
For intLoop = 0 To rs.Fields.Count - 1
msgbox " " & rs.Fields(intLoop).Name
Next
set rs = rs.Next
loop
end if
Main = DTSTaskExecResult_Success
End Function
*** Sent via Developersdex http://www.examnotes.net ***|||
Everything is fine with the code listed below. I am going to use this
instead of the DTS execute sql task.
Option Explicit
Function Main()
dim cnn
dim rs
dim intLoop
dim strText
set cnn=createobject("ADODB.Connection")
cnn.Open "Provider=sqloledb;" & _
"Data Source=SERVER;" & _
"Initial Catalog=msdb;" & _
"Integrated Security=SSPI"
set rs=cnn.execute("SQL QUERY")
If rs.BOF then
msgbox "No Records Found"
else
do until rs.EOF
For intLoop = 0 To rs.Fields.Count - 1
strText = strText & rs.fields(intLoop).value & " " & vbCrLf
Next
rs.MoveNext
loop
msgbox strText
end if
set rs = nothing
Main = DTSTaskExecResult_Success
End Function
*** Sent via Developersdex http://www.examnotes.net ***|||Hi
It was the wrong link, should have sync'd
http://msdn.microsoft.com/library/d...asp?frame=true
I have just followed
http://msdn.microsoft.com/library/d...>
ask_4gkl.asp
and the above and there have been no problems.
John
"SJM" <nospam@.devdex.com> wrote in message
news:euD9JTUtFHA.2624@.TK2MSFTNGP12.phx.gbl...
>
> Everything is fine with the code listed below. I am going to use this
> instead of the DTS execute sql task.
> Option Explicit
> Function Main()
> dim cnn
> dim rs
> dim intLoop
> dim strText
> set cnn=createobject("ADODB.Connection")
> cnn.Open "Provider=sqloledb;" & _
> "Data Source=SERVER;" & _
> "Initial Catalog=msdb;" & _
> "Integrated Security=SSPI"
> set rs=cnn.execute("SQL QUERY")
> If rs.BOF then
> msgbox "No Records Found"
> else
> do until rs.EOF
> For intLoop = 0 To rs.Fields.Count - 1
> strText = strText & rs.fields(intLoop).value & " " & vbCrLf
> Next
> rs.MoveNext
> loop
> msgbox strText
> end if
> set rs = nothing
> Main = DTSTaskExecResult_Success
> End Function
>
> *** Sent via Developersdex http://www.examnotes.net ***

Cannot display image from Database

Hi,
When i try to display an image from the database,it does not give any error
and does not show the image either. It does not show the box also which has
the cross sign. On seeing the report it seems there is no image eventhough
i have an image from the db on the report.
Please help.
Thanx,
Warm Regards,
Kalpnacan you list down the steps that you performed to display an image?
"kalpna" <kalpna.prakash@.grapecity.com> wrote in message
news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> Hi,
> When i try to display an image from the database,it does not give any
> error
> and does not show the image either. It does not show the box also which
> has
> the cross sign. On seeing the report it seems there is no image
> eventhough
> i have an image from the db on the report.
> Please help.
> Thanx,
> Warm Regards,
> Kalpna
>|||i drag an image object from the toolbox
Then in the image wizard that pops up i select image from Database and set
the datset that has the image item from the database and the corresponding
field and the mime type(tried with all the available mime types) and then
say OK and finish.
When i preview /view the report nothing is shown.It does not even show the
image box with a cross or something like that.
Any help wud be of great use.
Thanx,
Kalpna
"avnrao" <avn@.newsgroups.com> wrote in message
news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> can you list down the steps that you performed to display an image?
> "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > When i try to display an image from the database,it does not give any
> > error
> > and does not show the image either. It does not show the box also which
> > has
> > the cross sign. On seeing the report it seems there is no image
> > eventhough
> > i have an image from the db on the report.
> >
> > Please help.
> >
> > Thanx,
> > Warm Regards,
> > Kalpna
> >
> >
>|||Any solution to this?
I have the same problem :( No images are served from the database allthough
I have verified that they are there...
"kalpna" wrote:
> i drag an image object from the toolbox
> Then in the image wizard that pops up i select image from Database and set
> the datset that has the image item from the database and the corresponding
> field and the mime type(tried with all the available mime types) and then
> say OK and finish.
> When i preview /view the report nothing is shown.It does not even show the
> image box with a cross or something like that.
> Any help wud be of great use.
> Thanx,
> Kalpna
> "avnrao" <avn@.newsgroups.com> wrote in message
> news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> > can you list down the steps that you performed to display an image?
> >
> > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> > > Hi,
> > >
> > > When i try to display an image from the database,it does not give any
> > > error
> > > and does not show the image either. It does not show the box also which
> > > has
> > > the cross sign. On seeing the report it seems there is no image
> > > eventhough
> > > i have an image from the db on the report.
> > >
> > > Please help.
> > >
> > > Thanx,
> > > Warm Regards,
> > > Kalpna
> > >
> > >
> >
> >
>
>|||This sounds like the images are stored as OLE images in the database (e.g.
Access would convert images into OLE images). You can try the following
expression to get rid of the OLE chunk:
=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
cture.Value), 105))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
> Any solution to this?
> I have the same problem :( No images are served from the database
allthough
> I have verified that they are there...
> "kalpna" wrote:
> > i drag an image object from the toolbox
> >
> > Then in the image wizard that pops up i select image from Database and
set
> > the datset that has the image item from the database and the
corresponding
> > field and the mime type(tried with all the available mime types) and
then
> > say OK and finish.
> >
> > When i preview /view the report nothing is shown.It does not even show
the
> > image box with a cross or something like that.
> >
> > Any help wud be of great use.
> >
> > Thanx,
> >
> > Kalpna
> >
> > "avnrao" <avn@.newsgroups.com> wrote in message
> > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> > > can you list down the steps that you performed to display an image?
> > >
> > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> > > > Hi,
> > > >
> > > > When i try to display an image from the database,it does not give
any
> > > > error
> > > > and does not show the image either. It does not show the box also
which
> > > > has
> > > > the cross sign. On seeing the report it seems there is no image
> > > > eventhough
> > > > i have an image from the db on the report.
> > > >
> > > > Please help.
> > > >
> > > > Thanx,
> > > > Warm Regards,
> > > > Kalpna
> > > >
> > > >
> > >
> > >
> >
> >
> >|||I am having the same problem. I tried the expression below but it doesn't
work for me. All of my images are inserted with an Access Data Project to SQL
Image fields. Some are BMP files, JPG files, or even AutoCAD files. Access
displays them correctly, but Reporting Services will not. Is there any other
way to strip away the OLE junk and get the image placeholder to display? Any
help is greatly appreciated.
"Robert Bruckner [MSFT]" wrote:
> This sounds like the images are stored as OLE images in the database (e.g.
> Access would convert images into OLE images). You can try the following
> expression to get rid of the OLE chunk:
> =System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
> cture.Value), 105))
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
> news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
> > Any solution to this?
> >
> > I have the same problem :( No images are served from the database
> allthough
> > I have verified that they are there...
> >
> > "kalpna" wrote:
> >
> > > i drag an image object from the toolbox
> > >
> > > Then in the image wizard that pops up i select image from Database and
> set
> > > the datset that has the image item from the database and the
> corresponding
> > > field and the mime type(tried with all the available mime types) and
> then
> > > say OK and finish.
> > >
> > > When i preview /view the report nothing is shown.It does not even show
> the
> > > image box with a cross or something like that.
> > >
> > > Any help wud be of great use.
> > >
> > > Thanx,
> > >
> > > Kalpna
> > >
> > > "avnrao" <avn@.newsgroups.com> wrote in message
> > > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> > > > can you list down the steps that you performed to display an image?
> > > >
> > > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> > > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > When i try to display an image from the database,it does not give
> any
> > > > > error
> > > > > and does not show the image either. It does not show the box also
> which
> > > > > has
> > > > > the cross sign. On seeing the report it seems there is no image
> > > > > eventhough
> > > > > i have an image from the db on the report.
> > > > >
> > > > > Please help.
> > > > >
> > > > > Thanx,
> > > > > Warm Regards,
> > > > > Kalpna
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
>
>|||That doesn't help. I get exactly the same thing as before -- red x in little
square indicating no source for the image. (I am trying to display a Visio,
AutoCAD, or other OLE object drawing).
What should MIMEType be set to?
-prophead
"Robert Bruckner [MSFT]" wrote:
> This sounds like the images are stored as OLE images in the database (e.g.
> Access would convert images into OLE images). You can try the following
> expression to get rid of the OLE chunk:
> =System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
> cture.Value), 105))
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
> news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
> > Any solution to this?
> >
> > I have the same problem :( No images are served from the database
> allthough
> > I have verified that they are there...
> >
> > "kalpna" wrote:
> >
> > > i drag an image object from the toolbox
> > >
> > > Then in the image wizard that pops up i select image from Database and
> set
> > > the datset that has the image item from the database and the
> corresponding
> > > field and the mime type(tried with all the available mime types) and
> then
> > > say OK and finish.
> > >
> > > When i preview /view the report nothing is shown.It does not even show
> the
> > > image box with a cross or something like that.
> > >
> > > Any help wud be of great use.
> > >
> > > Thanx,
> > >
> > > Kalpna
> > >
> > > "avnrao" <avn@.newsgroups.com> wrote in message
> > > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> > > > can you list down the steps that you performed to display an image?
> > > >
> > > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> > > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > When i try to display an image from the database,it does not give
> any
> > > > > error
> > > > > and does not show the image either. It does not show the box also
> which
> > > > > has
> > > > > the cross sign. On seeing the report it seems there is no image
> > > > > eventhough
> > > > > i have an image from the db on the report.
> > > > >
> > > > > Please help.
> > > > >
> > > > > Thanx,
> > > > > Warm Regards,
> > > > > Kalpna
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
>
>|||The supported image types in RS are listed in the "Remarks" section of this
MSDN page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSRDL/htm/rsp_ref_rdl_elements_fp_5er8.asp
RS does not support any arbitrary OLE object drawing, because we need to be
able to export images correctly to various output formats like PDF etc.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"prophead" <prophead@.discussions.microsoft.com> wrote in message
news:67A353DB-16BD-4910-9B68-CF6E19053FD6@.microsoft.com...
> That doesn't help. I get exactly the same thing as before -- red x in
> little
> square indicating no source for the image. (I am trying to display a
> Visio,
> AutoCAD, or other OLE object drawing).
> What should MIMEType be set to?
> -prophead
> "Robert Bruckner [MSFT]" wrote:
>> This sounds like the images are stored as OLE images in the database
>> (e.g.
>> Access would convert images into OLE images). You can try the following
>> expression to get rid of the OLE chunk:
>> =System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
>> cture.Value), 105))
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
>> news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
>> > Any solution to this?
>> >
>> > I have the same problem :( No images are served from the database
>> allthough
>> > I have verified that they are there...
>> >
>> > "kalpna" wrote:
>> >
>> > > i drag an image object from the toolbox
>> > >
>> > > Then in the image wizard that pops up i select image from Database
>> > > and
>> set
>> > > the datset that has the image item from the database and the
>> corresponding
>> > > field and the mime type(tried with all the available mime types) and
>> then
>> > > say OK and finish.
>> > >
>> > > When i preview /view the report nothing is shown.It does not even
>> > > show
>> the
>> > > image box with a cross or something like that.
>> > >
>> > > Any help wud be of great use.
>> > >
>> > > Thanx,
>> > >
>> > > Kalpna
>> > >
>> > > "avnrao" <avn@.newsgroups.com> wrote in message
>> > > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
>> > > > can you list down the steps that you performed to display an image?
>> > > >
>> > > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
>> > > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
>> > > > > Hi,
>> > > > >
>> > > > > When i try to display an image from the database,it does not give
>> any
>> > > > > error
>> > > > > and does not show the image either. It does not show the box also
>> which
>> > > > > has
>> > > > > the cross sign. On seeing the report it seems there is no image
>> > > > > eventhough
>> > > > > i have an image from the db on the report.
>> > > > >
>> > > > > Please help.
>> > > > >
>> > > > > Thanx,
>> > > > > Warm Regards,
>> > > > > Kalpna
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > >
>> > >
>> > >
>>|||Thanks, Robert.
Is there a way to specify an ActiveX container to be deployed and used for
other types of OLE objects stored in the db, or even as files on the server
(using Source = External) in the RS 2000 report design?
-prophead
"Robert Bruckner [MSFT]" wrote:
> The supported image types in RS are listed in the "Remarks" section of this
> MSDN page:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSRDL/htm/rsp_ref_rdl_elements_fp_5er8.asp
> RS does not support any arbitrary OLE object drawing, because we need to be
> able to export images correctly to various output formats like PDF etc.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "prophead" <prophead@.discussions.microsoft.com> wrote in message
> news:67A353DB-16BD-4910-9B68-CF6E19053FD6@.microsoft.com...
> > That doesn't help. I get exactly the same thing as before -- red x in
> > little
> > square indicating no source for the image. (I am trying to display a
> > Visio,
> > AutoCAD, or other OLE object drawing).
> >
> > What should MIMEType be set to?
> >
> > -prophead
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> This sounds like the images are stored as OLE images in the database
> >> (e.g.
> >> Access would convert images into OLE images). You can try the following
> >> expression to get rid of the OLE chunk:
> >> =System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
> >> cture.Value), 105))
> >>
> >> --
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> "alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
> >> news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
> >> > Any solution to this?
> >> >
> >> > I have the same problem :( No images are served from the database
> >> allthough
> >> > I have verified that they are there...
> >> >
> >> > "kalpna" wrote:
> >> >
> >> > > i drag an image object from the toolbox
> >> > >
> >> > > Then in the image wizard that pops up i select image from Database
> >> > > and
> >> set
> >> > > the datset that has the image item from the database and the
> >> corresponding
> >> > > field and the mime type(tried with all the available mime types) and
> >> then
> >> > > say OK and finish.
> >> > >
> >> > > When i preview /view the report nothing is shown.It does not even
> >> > > show
> >> the
> >> > > image box with a cross or something like that.
> >> > >
> >> > > Any help wud be of great use.
> >> > >
> >> > > Thanx,
> >> > >
> >> > > Kalpna
> >> > >
> >> > > "avnrao" <avn@.newsgroups.com> wrote in message
> >> > > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
> >> > > > can you list down the steps that you performed to display an image?
> >> > > >
> >> > > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
> >> > > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
> >> > > > > Hi,
> >> > > > >
> >> > > > > When i try to display an image from the database,it does not give
> >> any
> >> > > > > error
> >> > > > > and does not show the image either. It does not show the box also
> >> which
> >> > > > > has
> >> > > > > the cross sign. On seeing the report it seems there is no image
> >> > > > > eventhough
> >> > > > > i have an image from the db on the report.
> >> > > > >
> >> > > > > Please help.
> >> > > > >
> >> > > > > Thanx,
> >> > > > > Warm Regards,
> >> > > > > Kalpna
> >> > > > >
> >> > > > >
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> > >
> >>
> >>
> >>
>
>|||You cannot use ActiveX directly - you would need to go through a custom
assembly and convert the data into an image format RS can work with.
For external server files we allow only the given list of MimeTypes - also
for security reasons. Another reason is that when you create a history
snapshot, you would not only expect to get an exact snapshot of your data,
but also an exact snapshot of external images that were available at
snapshot creation time. So, when you render the history snapshot years
later, you still get *exactly* the same data and images across the supported
output formats.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"prophead" <prophead@.discussions.microsoft.com> wrote in message
news:B92199A9-BAA7-4CC4-97BD-11FE05AA2A53@.microsoft.com...
> Thanks, Robert.
> Is there a way to specify an ActiveX container to be deployed and used for
> other types of OLE objects stored in the db, or even as files on the
> server
> (using Source = External) in the RS 2000 report design?
> -prophead
> "Robert Bruckner [MSFT]" wrote:
>> The supported image types in RS are listed in the "Remarks" section of
>> this
>> MSDN page:
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSRDL/htm/rsp_ref_rdl_elements_fp_5er8.asp
>> RS does not support any arbitrary OLE object drawing, because we need to
>> be
>> able to export images correctly to various output formats like PDF etc.
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "prophead" <prophead@.discussions.microsoft.com> wrote in message
>> news:67A353DB-16BD-4910-9B68-CF6E19053FD6@.microsoft.com...
>> > That doesn't help. I get exactly the same thing as before -- red x in
>> > little
>> > square indicating no source for the image. (I am trying to display a
>> > Visio,
>> > AutoCAD, or other OLE object drawing).
>> >
>> > What should MIMEType be set to?
>> >
>> > -prophead
>> >
>> > "Robert Bruckner [MSFT]" wrote:
>> >
>> >> This sounds like the images are stored as OLE images in the database
>> >> (e.g.
>> >> Access would convert images into OLE images). You can try the
>> >> following
>> >> expression to get rid of the OLE chunk:
>> >> =System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Pi
>> >> cture.Value), 105))
>> >>
>> >> --
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >> "alfgaba" <alfgaba@.discussions.microsoft.com> wrote in message
>> >> news:C49DC28A-BEA6-4827-AC27-5025DED46EF2@.microsoft.com...
>> >> > Any solution to this?
>> >> >
>> >> > I have the same problem :( No images are served from the database
>> >> allthough
>> >> > I have verified that they are there...
>> >> >
>> >> > "kalpna" wrote:
>> >> >
>> >> > > i drag an image object from the toolbox
>> >> > >
>> >> > > Then in the image wizard that pops up i select image from Database
>> >> > > and
>> >> set
>> >> > > the datset that has the image item from the database and the
>> >> corresponding
>> >> > > field and the mime type(tried with all the available mime types)
>> >> > > and
>> >> then
>> >> > > say OK and finish.
>> >> > >
>> >> > > When i preview /view the report nothing is shown.It does not even
>> >> > > show
>> >> the
>> >> > > image box with a cross or something like that.
>> >> > >
>> >> > > Any help wud be of great use.
>> >> > >
>> >> > > Thanx,
>> >> > >
>> >> > > Kalpna
>> >> > >
>> >> > > "avnrao" <avn@.newsgroups.com> wrote in message
>> >> > > news:Ofay1n5rEHA.868@.TK2MSFTNGP12.phx.gbl...
>> >> > > > can you list down the steps that you performed to display an
>> >> > > > image?
>> >> > > >
>> >> > > > "kalpna" <kalpna.prakash@.grapecity.com> wrote in message
>> >> > > > news:%23jvG%23G4rEHA.3868@.TK2MSFTNGP15.phx.gbl...
>> >> > > > > Hi,
>> >> > > > >
>> >> > > > > When i try to display an image from the database,it does not
>> >> > > > > give
>> >> any
>> >> > > > > error
>> >> > > > > and does not show the image either. It does not show the box
>> >> > > > > also
>> >> which
>> >> > > > > has
>> >> > > > > the cross sign. On seeing the report it seems there is no
>> >> > > > > image
>> >> > > > > eventhough
>> >> > > > > i have an image from the db on the report.
>> >> > > > >
>> >> > > > > Please help.
>> >> > > > >
>> >> > > > > Thanx,
>> >> > > > > Warm Regards,
>> >> > > > > Kalpna
>> >> > > > >
>> >> > > > >
>> >> > > >
>> >> > > >
>> >> > >
>> >> > >
>> >> > >
>> >>
>> >>
>> >>
>>

Cannot display database properties windows in Sql server management studio.

I use sql server 2005 developer edition with service pack 1.

When i right click on a database and i select properties an error occured with the folowing stack trace

===================================

Cannot show requested dialog.

===================================

Cannot show requested dialog. (SqlMgmt)


Program Location:

at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.AllocateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider, CDataContainer dc)
at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.Microsoft.SqlServer.Management.SqlMgmt.ILaunchFormHostedControlAllocator.CreateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItem.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

===================================

Object reference not set to an instance of an object. (System.Data)


Program Location:

at System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp)
at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.DatabaseLevel.GetData(EnumResult res)
at Microsoft.SqlServer.Management.Smo.Environment.GetData()
at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorDataReader(Request req)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetInitDataReader(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ImplInitialize(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.Initialize(Boolean allProperties)
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype.DatabaseData..ctor(CDataContainer context, String databaseName)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype.LoadDefinition(String newName)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype..ctor(CDataContainer context)
at Microsoft.SqlServer.Management.SqlManagerUI.DBPropSheet..ctor(CDataContainer context)

Accroding to the reflected sources:

public DatabaseData(CDataContainer context, string databaseName)
{
this.mirrorSafetyLevel = MirroringSafetyLevel.Off;
this.witnessServer = string.Empty;
Database database1 = context.Server.Databases[databaseName];


There might be a problem in getting the information from the database collection. So do the following steps:

-Run the profiler to the when the execution of the command stops. (Guess it has to do something with the database name)
-Select the database name from the sysdatabases and post it here

SELECT Name, DATALENGTH(Name),LEN(Name) from sys.databases

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

When i try to create a new view, in any of the databases i saw an error


Object reference not set to an instance of an object. (SQLEditors)


Program Location:

at System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp)
at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.DatabaseLevel.GetData(EnumResult res)
at Microsoft.SqlServer.Management.Smo.Environment.GetData()
at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorDataReader(Request req)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetInitDataReader(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ImplInitialize(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.OnPropertyMissing(String propname)
at Microsoft.SqlServer.Management.Smo.Database.get_DefaultSchema()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.GetDefaultSchema(Server server, String databaseName)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.GenerateNewObjectUrn()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.SetObjectAndParentUrns(Urn originalUrn)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProjectNode..ctor(Urn urn, DocumentOptions options, IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProjectNode.Allocate(Urn origUrn, DocumentType editorType, DocumentOptions options, IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProject.Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.CreateDesignerWindow(IManagedConnection mc, DocumentOptions options)

I think that there is a problem with the server installation. I will try to reinstalle it.

|||If you want to solve the problem, follow the mentioned steps to reproduce the executed script on the server. That might also help others to solve their problems and help to improve the product itself.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Hi,

Please make sure the database exists and is not deleted by clicking refresh on the server node and see if you can still see the database whose properties you were not able to access. I believe the database was dropped by some other means and your SSMS window was not refreshed after that.

Hope this helps.

Thanks,

Sravanthi.

|||Stack trace dump means there might be a probelm with the Windows, a virus or mismatch of hotfix/service pack on operating system. Make sure to check what has been changed since this was working correctly in previous state, if not you might try testing the same on other machine.|||All databases are in place. i can open tables and see their data.|||

thats what i believe too.

The problem appears after an update from microsoft windows update which find that my windows sql server installation need the service pack 1 update. I selected and install it.

after that i download and install service pack 2 for sql server 2005 but of course this doesn't correct anything.

I have in the same computer a sqlserver express edition installed and from microsoft sql server managment studio i can work properly with this instance without a problem (in case i thought that was a problem from microsoft sql server managment studio).

About response from Jens K. Suessmeyer .

Whene i execute the line

SELECT 'AdventureWorks', DATALENGTH('AdventureWorks'),LEN('AdventureWorks') from sys.databases

i get

'An error occurred while executing batch. Error message is: Object reference not set to an instance of an object.'

with any database there are in this installation.


|||

Hi,

From where are you running the queries? Please run the query SELECT Name, DATALENGTH(Name),LEN(Name) from sys.databases (run it as is as Jens K. Suessmeyer has given, dont replace Name in the query, if you want it specific to AdventureWorks just add a where clause). Run this query from new query window in SSMS and let us know the output. From the error that you are getting "Object reference..." looks like you are trying to run the query programmatically. Just run it from a SSMS query window and let us know the output. Make sure the database that is causing all these issues comes up in the query result.

Sravanthi

|||If you believe its SSMS tools problem, try to reinstall them again.|||

All databases causing that issues

The result after executing the above query is

NAME (no column name) (no column name)

master 12 6
tempdb 12 6
model 10 5
msdb 8 4
ReportServer$MAIMOY2005 46 23
ReportServer$MAIMOY2005TempDB 58 29
BASE DE DATOS ORIGINAL 44 22
ALKI 8 4
aspnetdb_ALKI 26 13
AdventureWorks 28 14
AdventureWorksDW 32 16

(11 row(s) affected)

|||After a full uninstall and reinstall everything seems to work perfect. Aftes installation i install also service pack 2 downloaded and installed locally and everything works properly.|||

somehow, i missed this thread and I am sure if I could furnish this information bit earlier it would have been helpful. nevertheless, i think i should share my experience in this regards. the story is as follows :)

One of our development server had the same problem and I have documented this error. But at that time I was on the tows and somehow I was to get rid of this problem and I did the same trick - reinstalling the SQL Server. But I was not satisfied by this solution. when I did the postmortem of the process then I realized that our TL used to synchronies the Development database from Visio. There were many connection used to connect to different database (from visio) and one of them was to connect to master database. He used the master connection , and Visio automatically detects the objects in the connected database which are not there in the Model and it ask whether u want to delete those object or not. He selected Yes and Visio deleted all the objects from master database which are not there in the model. I verified the objects between two instances Master databases. There were five system tables missing , the missing tables were spt_fallback_db,spt_fallback_dev,spt_fallback_usg,spt_monitor,spt_value. Then I created the script of these tables from other instance and run on the problem server, but those tables were not having owner , though it shows owner as DBO. Actually these tables comes under System Tables tree but when I created these by the script those created as user table. I was pretty sure that these problem were because of these tables got deleted. But I was not having time to do R&D on this and I reinstalled the instance.

(a) How come Visio able to delete system tables (the irony is that , in SSMO these tables are shown as System Tables , but if u use sp_help it is shown as Usertable).

(b) IF somehow these tables got deleted, how can we restore these table and revert back to normal stage without reinstalling anything.

Also question to Antonisk, is something like this was happened in your side…

I think we need to dig out the root of this problem. If these tables are so critical , then these should not be deletable from anywhere. If it is a bug the we need to report this to MS..

Thanks for the time

Madhu

|||I don't use Visio at all. Also i can't check if this was the problem (system tables missing) because I reinstall the Sql Server.

Cannot display database properties windows in Sql server management studio.

I use sql server 2005 developer edition with service pack 1.

When i right click on a database and i select properties an error occured with the folowing stack trace

===================================

Cannot show requested dialog.

===================================

Cannot show requested dialog. (SqlMgmt)


Program Location:

at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.AllocateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider, CDataContainer dc)
at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.Microsoft.SqlServer.Management.SqlMgmt.ILaunchFormHostedControlAllocator.CreateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItem.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

===================================

Object reference not set to an instance of an object. (System.Data)


Program Location:

at System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp)
at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.DatabaseLevel.GetData(EnumResult res)
at Microsoft.SqlServer.Management.Smo.Environment.GetData()
at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorDataReader(Request req)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetInitDataReader(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ImplInitialize(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.Initialize(Boolean allProperties)
at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype.DatabaseData..ctor(CDataContainer context, String databaseName)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype.LoadDefinition(String newName)
at Microsoft.SqlServer.Management.SqlManagerUI.CreateDatabaseData.DatabasePrototype..ctor(CDataContainer context)
at Microsoft.SqlServer.Management.SqlManagerUI.DBPropSheet..ctor(CDataContainer context)

Accroding to the reflected sources:

public DatabaseData(CDataContainer context, string databaseName)
{
this.mirrorSafetyLevel = MirroringSafetyLevel.Off;
this.witnessServer = string.Empty;
Database database1 = context.Server.Databases[databaseName];


There might be a problem in getting the information from the database collection. So do the following steps:

-Run the profiler to the when the execution of the command stops. (Guess it has to do something with the database name)
-Select the database name from the sysdatabases and post it here

SELECT Name, DATALENGTH(Name),LEN(Name) from sys.databases

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

When i try to create a new view, in any of the databases i saw an error


Object reference not set to an instance of an object. (SQLEditors)


Program Location:

at System.Data.SqlClient.TdsParserStateObject.ReadStringWithEncoding(Int32 length, Encoding encoding, Boolean isPlp)
at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ReadColumnData()
at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
at System.Data.SqlClient.SqlDataReader.GetValues(Object[] values)
at Microsoft.SqlServer.Management.Smo.DataProvider.SetConnectionAndQuery(ExecuteSql execSql, String query)
at Microsoft.SqlServer.Management.Smo.ExecuteSql.GetDataProvider(StringCollection query, Object con, StatementBuilder sb, RetriveMode rm)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillData(ResultType resultType, StringCollection sql, Object connectionInfo, StatementBuilder sb)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.FillDataWithUseFailure(SqlEnumResult sqlresult, ResultType resultType)
at Microsoft.SqlServer.Management.Smo.SqlObjectBase.BuildResult(EnumResult result)
at Microsoft.SqlServer.Management.Smo.DatabaseLevel.GetData(EnumResult res)
at Microsoft.SqlServer.Management.Smo.Environment.GetData()
at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorDataReader(Request req)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetInitDataReader(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ImplInitialize(String[] fields, OrderBy[] orderby)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.OnPropertyMissing(String propname)
at Microsoft.SqlServer.Management.Smo.Database.get_DefaultSchema()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.GetDefaultSchema(Server server, String databaseName)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.GenerateNewObjectUrn()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.SetObjectAndParentUrns(Urn originalUrn)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProjectNode..ctor(Urn urn, DocumentOptions options, IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProjectNode.Allocate(Urn origUrn, DocumentType editorType, DocumentOptions options, IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProject.Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.CreateDesignerWindow(IManagedConnection mc, DocumentOptions options)

I think that there is a problem with the server installation. I will try to reinstalle it.

|||If you want to solve the problem, follow the mentioned steps to reproduce the executed script on the server. That might also help others to solve their problems and help to improve the product itself.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Hi,

Please make sure the database exists and is not deleted by clicking refresh on the server node and see if you can still see the database whose properties you were not able to access. I believe the database was dropped by some other means and your SSMS window was not refreshed after that.

Hope this helps.

Thanks,

Sravanthi.

|||Stack trace dump means there might be a probelm with the Windows, a virus or mismatch of hotfix/service pack on operating system. Make sure to check what has been changed since this was working correctly in previous state, if not you might try testing the same on other machine.|||All databases are in place. i can open tables and see their data.|||

thats what i believe too.

The problem appears after an update from microsoft windows update which find that my windows sql server installation need the service pack 1 update. I selected and install it.

after that i download and install service pack 2 for sql server 2005 but of course this doesn't correct anything.

I have in the same computer a sqlserver express edition installed and from microsoft sql server managment studio i can work properly with this instance without a problem (in case i thought that was a problem from microsoft sql server managment studio).

About response from Jens K. Suessmeyer .

Whene i execute the line

SELECT 'AdventureWorks', DATALENGTH('AdventureWorks'),LEN('AdventureWorks') from sys.databases

i get

'An error occurred while executing batch. Error message is: Object reference not set to an instance of an object.'

with any database there are in this installation.


|||

Hi,

From where are you running the queries? Please run the query SELECT Name, DATALENGTH(Name),LEN(Name) from sys.databases (run it as is as Jens K. Suessmeyer has given, dont replace Name in the query, if you want it specific to AdventureWorks just add a where clause). Run this query from new query window in SSMS and let us know the output. From the error that you are getting "Object reference..." looks like you are trying to run the query programmatically. Just run it from a SSMS query window and let us know the output. Make sure the database that is causing all these issues comes up in the query result.

Sravanthi

|||If you believe its SSMS tools problem, try to reinstall them again.|||

All databases causing that issues

The result after executing the above query is

NAME (no column name) (no column name)

master 12 6
tempdb 12 6
model 10 5
msdb 8 4
ReportServer$MAIMOY2005 46 23
ReportServer$MAIMOY2005TempDB 58 29
BASE DE DATOS ORIGINAL 44 22
ALKI 8 4
aspnetdb_ALKI 26 13
AdventureWorks 28 14
AdventureWorksDW 32 16

(11 row(s) affected)

|||After a full uninstall and reinstall everything seems to work perfect. Aftes installation i install also service pack 2 downloaded and installed locally and everything works properly.|||

somehow, i missed this thread and I am sure if I could furnish this information bit earlier it would have been helpful. nevertheless, i think i should share my experience in this regards. the story is as follows :)

One of our development server had the same problem and I have documented this error. But at that time I was on the tows and somehow I was to get rid of this problem and I did the same trick - reinstalling the SQL Server. But I was not satisfied by this solution. when I did the postmortem of the process then I realized that our TL used to synchronies the Development database from Visio. There were many connection used to connect to different database (from visio) and one of them was to connect to master database. He used the master connection , and Visio automatically detects the objects in the connected database which are not there in the Model and it ask whether u want to delete those object or not. He selected Yes and Visio deleted all the objects from master database which are not there in the model. I verified the objects between two instances Master databases. There were five system tables missing , the missing tables were spt_fallback_db,spt_fallback_dev,spt_fallback_usg,spt_monitor,spt_value. Then I created the script of these tables from other instance and run on the problem server, but those tables were not having owner , though it shows owner as DBO. Actually these tables comes under System Tables tree but when I created these by the script those created as user table. I was pretty sure that these problem were because of these tables got deleted. But I was not having time to do R&D on this and I reinstalled the instance.

(a) How come Visio able to delete system tables (the irony is that , in SSMO these tables are shown as System Tables , but if u use sp_help it is shown as Usertable).

(b) IF somehow these tables got deleted, how can we restore these table and revert back to normal stage without reinstalling anything.

Also question to Antonisk, is something like this was happened in your side…

I think we need to dig out the root of this problem. If these tables are so critical , then these should not be deletable from anywhere. If it is a bug the we need to report this to MS..

Thanks for the time

Madhu

|||I don't use Visio at all. Also i can't check if this was the problem (system tables missing) because I reinstall the Sql Server.sql

cannot display chinese

I cannot display Chinses at ASP page. All chinese data (whatever is
Traditional or Simply Chinese) are displayed as '.
My website connect to MS SQL Server 2005 and all the chinese data are
displayed as '.
I try to fix the problem for several days, but still can't fix it. Please
help me to solve this problem.
here is the detail of my system.
* SQL Server 2005 via TCP/IP
* the connection string is "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=xx;Initial Catalog=websonic_pos;Data
Source=xx.xx.xx.xx;Password=xx;"Hi
A client displaying ?'s is when it can't interpret the character value,
therefore look at things like the codepage or Locale settings for the page
etc.
This may help:
http://databases.aspfaq.com/general/can-i-fix-this-mm/dd/yyyy-dd/mm/yyyy-confusion-once-and-for-all.html
John
"HK newsgroup" wrote:
> I cannot display Chinses at ASP page. All chinese data (whatever is
> Traditional or Simply Chinese) are displayed as '.
> My website connect to MS SQL Server 2005 and all the chinese data are
> displayed as '.
> I try to fix the problem for several days, but still can't fix it. Please
> help me to solve this problem.
> here is the detail of my system.
> * SQL Server 2005 via TCP/IP
> * the connection string is "Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=xx;Initial Catalog=websonic_pos;Data
> Source=xx.xx.xx.xx;Password=xx;"
>
>

Wednesday, March 7, 2012

Cannot copy column names view result set

In SQL 2005 - when I display the results of a View and Copy all rows and columns, the resulting Paste in Excel does not include the column names.

How can I set SQL 2005 so the names of the columns will come along with the content of the copy function?

Background:

When I am using a SQL Query (instead of a view) I have the ability to control whether or not I am able to Include the Column Headers when copying or saving results. The control exists in the Options > Query Results > Results to Grid > Include column headings etc.

My question is how to get this same ability when attempting to copy the results of a VIEW vs. a Query.

Thank you,

Poppa Mike

The same way. Instead of opening the view into that grid thingy, open a query window and do a select from the view.|||

Yes Michael - I've thought of that but it causes me to take two steps. One to create the view and a second to get the results of the view by running a query against the view. I'd like to avoid the SQL Two-Step and just have the ability to copy the results from the view like I used to be able to do in SQL 2000. I appreciate your thoughts.

Regards, Poppa Mike

|||I was searching for the the same thing ..what i did was instead of selecting results to grid..choose the result as result to text and U can open the result file in excel and sort it out.