Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Friday, March 23, 2012

Getting Started - what do I need?

While I have been programming .Net for four years and T-SQL for about 12, I am a newbie to the whole SQL CLR thing. I have VS.NET 2003 on my machine, and I installed the client tools for SQL 2005 which also installs VS 2005 for SQL. Yet when I open VS 2005, it only has Data Analysis projects, but no Database projects. If I go into VS 2003 and try to import some of the assemblies I have found by googling 'SQL CLR' - VS 2003 won't let me add them.

Exactly what do I need to install so that I can get started? Do I need an instance of SQL server running on my machine? (I currently do not have a server running, only the client tools are installed)

TIA,

--Yonah

Hi Yonah,

SQL Server 2005 Requirements:

Every SQL Server Edition (not sure about the new EVERYWHERE) including Express supports "CLR Integration" aka SQLCLR. Here is the sql product feature compare URL, http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx, feature is called "Common Language Runtime and .NET Integration".

Visual Studio 2005 Requirements (you dont have to use VS to create SQLCLR routines...but come on who uses vbc & csc w/Notedpad everyday? Which is actually why my SQLCLR book ASSUMES you will be using VS for SQLCLR work):

You need Visual Studio 2005 Professional, Tools for Office (VSTO), or Visual Studio Team System (VSTS) editions. See http://msdn.microsoft.com/vstudio/products/compare/default.aspx and look for "SQL Server 2005 Integration" feature.

Enjoy SQLCLR!

Derek

|||

You can check my blogs. i remeber i wrote article on this

Monday, March 12, 2012

Getting password from another source!

I am using a shared data source to access a Teradata machine but the password
I need to use is generated elsewhere in a component and changed regularly.
Is there a way I can get the shared data source to grab the current password
from the component on the fly?Interesting. Every now and then I come across a question that leaves me
baffled for a while. The guy who implemented this must have been really
influenced by trustworthy computing :-) I am just curious how will the data
source be synchronized with the new password.
Well, you can't change the connection string during runtime which limits (at
least as far as I can tell) your choices to:
1. If that component raises an event or if you have other means to know when
the password is going to be changed you can write a simple app to update the
shared data source definition programmatically.
2. Wrap this data source in a custom data extension.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"St Matthew" <StMatthew@.discussions.microsoft.com> wrote in message
news:EF4BC011-4E6B-4E84-B54A-339B27C7DB0D@.microsoft.com...
> I am using a shared data source to access a Teradata machine but the
password
> I need to use is generated elsewhere in a component and changed regularly.
> Is there a way I can get the shared data source to grab the current
password
> from the component on the fly?|||Look at SetDataSourceContents SOAP API.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"St Matthew" <StMatthew@.discussions.microsoft.com> wrote in message
news:75326DAC-383F-42E5-A5B9-27D8DBA9F8E5@.microsoft.com...
> I can get the password change to trigger an event no problem so option 1
> looks good but I can't find any syntax on updating the shared data source
> definition programmatically.
> Thanks for your help!
> "Teo Lachev" wrote:
> > Interesting. Every now and then I come across a question that leaves me
> > baffled for a while. The guy who implemented this must have been really
> > influenced by trustworthy computing :-) I am just curious how will the
data
> > source be synchronized with the new password.
> >
> > Well, you can't change the connection string during runtime which limits
(at
> > least as far as I can tell) your choices to:
> >
> > 1. If that component raises an event or if you have other means to know
when
> > the password is going to be changed you can write a simple app to update
the
> > shared data source definition programmatically.
> >
> > 2. Wrap this data source in a custom data extension.
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "St Matthew" <StMatthew@.discussions.microsoft.com> wrote in message
> > news:EF4BC011-4E6B-4E84-B54A-339B27C7DB0D@.microsoft.com...
> > > I am using a shared data source to access a Teradata machine but the
> > password
> > > I need to use is generated elsewhere in a component and changed
regularly.
> > > Is there a way I can get the shared data source to grab the current
> > password
> > > from the component on the fly?
> >
> >
> >|||Thanks for that!
"Teo Lachev" wrote:
> Look at SetDataSourceContents SOAP API.
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "St Matthew" <StMatthew@.discussions.microsoft.com> wrote in message
> news:75326DAC-383F-42E5-A5B9-27D8DBA9F8E5@.microsoft.com...
> > I can get the password change to trigger an event no problem so option 1
> > looks good but I can't find any syntax on updating the shared data source
> > definition programmatically.
> >
> > Thanks for your help!
> >
> > "Teo Lachev" wrote:
> >
> > > Interesting. Every now and then I come across a question that leaves me
> > > baffled for a while. The guy who implemented this must have been really
> > > influenced by trustworthy computing :-) I am just curious how will the
> data
> > > source be synchronized with the new password.
> > >
> > > Well, you can't change the connection string during runtime which limits
> (at
> > > least as far as I can tell) your choices to:
> > >
> > > 1. If that component raises an event or if you have other means to know
> when
> > > the password is going to be changed you can write a simple app to update
> the
> > > shared data source definition programmatically.
> > >
> > > 2. Wrap this data source in a custom data extension.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ----
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ----
> > >
> > > "St Matthew" <StMatthew@.discussions.microsoft.com> wrote in message
> > > news:EF4BC011-4E6B-4E84-B54A-339B27C7DB0D@.microsoft.com...
> > > > I am using a shared data source to access a Teradata machine but the
> > > password
> > > > I need to use is generated elsewhere in a component and changed
> regularly.
> > > > Is there a way I can get the shared data source to grab the current
> > > password
> > > > from the component on the fly?
> > >
> > >
> > >
>
>

Wednesday, March 7, 2012

Getting Memory usage through T-SQL

I'm trying to get the machine free ram value using either T-SQL or
SQL-DMO.
I found .Registry.PhysicalMemory which takes care of the total ram but
I still need eithrt the free or the used.

Any ideas?
Thanks!"Adi Sapir" <adisapir@.gmail.com> wrote in message news:<ce7ucv$rg7@.odbk17.prod.google.com>...
> I'm trying to get the machine free ram value using either T-SQL or
> SQL-DMO.
> I found .Registry.PhysicalMemory which takes care of the total ram but
> I still need eithrt the free or the used.
> Any ideas?
> Thanks!

You should probably look at WMI for this, as it's intended for
retrieving this kind of system-level information:

http://groups.google.com/groups?hl=...news.jippii.net

Simon

Sunday, February 26, 2012

Getting Images to render in HTML using Web Service (SOAP)

I have created a web app that uses the reporting services Web Service to
pull reports from the SQL Server.
The web server is on one machine, SQL Server on another and I use the web
service to get the reports. I do not use URLs in any way in order to keep as
much information hidden as possible.
I have been able to list all reports, select a report, get back the
parameters required, set the parameter values and render reports using
ReportingService.Render
HOWEVER...
The reports that work do not include charts (graphics). When I render a
report using my app, if it has no chart I can view it in HTML, PDF, TIF,
Excel and MHTML. If it has a chart then for PDF, Excel and TIF all is fine.
If I try to use HTML or MHTML I get a big empty space where my charts should
be.
In reading the BOL under ReportingService.Render Method
I found this: "StreamIds
[out] The stream identifiers. These IDs are passed to the RenderStream
method. You can use them to render the external resources (images, etc.)
that are associated with a given report. "
I have found this topic:
ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_ref_soapapi_service_lz_49f6.htm
ReportingService.RenderStream Method
I read the code, and I have tried to implement it as in the BOL. I am able
to write the images onto the web-server hard-drive, and the image place
holder properties no longer point to my SQL server (which they did at first)
but I still don't get an image.
For example, my image is actually at:
http://sandy.murdocks.on.ca/1/reports/temp/C_79_S
It is there and it works. Now my report opens in a new window since I do the
final call to open it like this:
Response.AddHeader("Content-Disposition", "attachment; filename=" &
fileName)
Response.BinaryWrite(data)
When I right click on the image place holder I get this:
file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/QPIH2VE9/1/Reports/Temp/C_79_S
The images don't seem to get from being written on the drive, to being
picked up for display.
My code for writing the images looks like this:
If format = "HTML4.0" Then
For Each streamid In streamIDs
image = rs.RenderStream(strpath, "HTML4.0", streamid,
Nothing, Nothing, parameters, Nothing, Nothing)
Dim stream As System.IO.FileStream = _
System.IO.File.OpenWrite(Application("TempReports") &
streamid)
stream.Write(image, 0, CInt(image.Length))
stream.Close()
Next
End If
Sandy Murdock MCPlook at my previuos post:
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?&query=rome&lang=en&cr=US&guid=&dg=microsoft.public.sqlserver.reportingsvcs&p=1&tid=a830cc14-9b06-496b-b1f4-e55ab3611f0b
Antonio
"Roger Twomey" wrote:
> I have created a web app that uses the reporting services Web Service to
> pull reports from the SQL Server.
> The web server is on one machine, SQL Server on another and I use the web
> service to get the reports. I do not use URLs in any way in order to keep as
> much information hidden as possible.
> I have been able to list all reports, select a report, get back the
> parameters required, set the parameter values and render reports using
> ReportingService.Render
> HOWEVER...
> The reports that work do not include charts (graphics). When I render a
> report using my app, if it has no chart I can view it in HTML, PDF, TIF,
> Excel and MHTML. If it has a chart then for PDF, Excel and TIF all is fine.
> If I try to use HTML or MHTML I get a big empty space where my charts should
> be.
> In reading the BOL under ReportingService.Render Method
> I found this: "StreamIds
> [out] The stream identifiers. These IDs are passed to the RenderStream
> method. You can use them to render the external resources (images, etc.)
> that are associated with a given report. "
> I have found this topic:
> ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_ref_soapapi_service_lz_49f6.htm
> ReportingService.RenderStream Method
> I read the code, and I have tried to implement it as in the BOL. I am able
> to write the images onto the web-server hard-drive, and the image place
> holder properties no longer point to my SQL server (which they did at first)
> but I still don't get an image.
> For example, my image is actually at:
> http://sandy.murdocks.on.ca/1/reports/temp/C_79_S
> It is there and it works. Now my report opens in a new window since I do the
> final call to open it like this:
> Response.AddHeader("Content-Disposition", "attachment; filename=" &
> fileName)
> Response.BinaryWrite(data)
> When I right click on the image place holder I get this:
> file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/QPIH2VE9/1/Reports/Temp/C_79_S
> The images don't seem to get from being written on the drive, to being
> picked up for display.
> My code for writing the images looks like this:
> If format = "HTML4.0" Then
> For Each streamid In streamIDs
> image = rs.RenderStream(strpath, "HTML4.0", streamid,
> Nothing, Nothing, parameters, Nothing, Nothing)
> Dim stream As System.IO.FileStream = _
> System.IO.File.OpenWrite(Application("TempReports") &
> streamid)
> stream.Write(image, 0, CInt(image.Length))
> stream.Close()
> Next
> End If
>
> Sandy Murdock MCP
>
>|||Thank you!
I was able to take your solution and from it build one that works for me. I
was stuck.
Thanks.
"Antonio Rome" <AntonioRome@.discussions.microsoft.com> wrote in message
news:61BF34C8-98DB-4388-8E06-F5F8C1F22BBE@.microsoft.com...
> look at my previuos post:
>
http://www.microsoft.com/sql/community/newsgroups/dgbrowser/en-us/default.mspx?&query=rome&lang=en&cr=US&guid=&dg=microsoft.public.sqlserver.reportingsvcs&p=1&tid=a830cc14-9b06-496b-b1f4-e55ab3611f0b
> Antonio
>
> "Roger Twomey" wrote:
> > I have created a web app that uses the reporting services Web Service to
> > pull reports from the SQL Server.
> >
> > The web server is on one machine, SQL Server on another and I use the
web
> > service to get the reports. I do not use URLs in any way in order to
keep as
> > much information hidden as possible.
> >
> > I have been able to list all reports, select a report, get back the
> > parameters required, set the parameter values and render reports using
> > ReportingService.Render
> >
> > HOWEVER...
> >
> > The reports that work do not include charts (graphics). When I render a
> > report using my app, if it has no chart I can view it in HTML, PDF, TIF,
> > Excel and MHTML. If it has a chart then for PDF, Excel and TIF all is
fine.
> > If I try to use HTML or MHTML I get a big empty space where my charts
should
> > be.
> >
> > In reading the BOL under ReportingService.Render Method
> > I found this: "StreamIds
> > [out] The stream identifiers. These IDs are passed to the RenderStream
> > method. You can use them to render the external resources (images, etc.)
> > that are associated with a given report. "
> >
> > I have found this topic:
> > ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_ref_soapapi_service_lz_49f6.htm
> > ReportingService.RenderStream Method
> >
> > I read the code, and I have tried to implement it as in the BOL. I am
able
> > to write the images onto the web-server hard-drive, and the image place
> > holder properties no longer point to my SQL server (which they did at
first)
> > but I still don't get an image.
> >
> > For example, my image is actually at:
> > http://sandy.murdocks.on.ca/1/reports/temp/C_79_S
> >
> > It is there and it works. Now my report opens in a new window since I do
the
> > final call to open it like this:
> > Response.AddHeader("Content-Disposition", "attachment; filename=" &
> > fileName)
> > Response.BinaryWrite(data)
> >
> > When I right click on the image place holder I get this:
> >
file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/QPIH2VE9/1/Reports/Temp/C_79_S
> >
> > The images don't seem to get from being written on the drive, to being
> > picked up for display.
> >
> > My code for writing the images looks like this:
> >
> > If format = "HTML4.0" Then
> > For Each streamid In streamIDs
> > image = rs.RenderStream(strpath, "HTML4.0", streamid,
> > Nothing, Nothing, parameters, Nothing, Nothing)
> >
> > Dim stream As System.IO.FileStream = _
> > System.IO.File.OpenWrite(Application("TempReports") &
> > streamid)
> >
> > stream.Write(image, 0, CInt(image.Length))
> > stream.Close()
> > Next
> > End If
> >
> >
> > Sandy Murdock MCP
> >
> >
> >|||I've been rendering chart images successfully for a report using the
ReportingService web services for a few weeks now. Today I had to add a
parameter to the report and now after I call my render method and loop
through the returned streamId's to get the images, I get the exception:
"rsStreamNotFound The stream cannot be found. The stream identifier that is
provided to an operation cannot be located in the report server database."
Why would this be happening?! I'm looping through the very streamId's that
the render method just returned to me!
Thanks in advance, Brian Parker

Getting IDENT_CURRENT value as NULL

Hello,
I am getting everything fine at my machine database, for all tables
having identity columns I am getting the identity values properly. Using
this:
declare @.test int
set @.test = ident_current('Track_Changes_Table')
print @.test
However at the client production machine I am not getting any value
printed i.e. it is coming NULL. Any idea about the cause for this
problem.
Please help. . Thanks in advance.
Neha Magia
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
is this transactional or merge?
If transactional identity columns are not replicated as identity columns by
default.
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Neha Magia" <nehamagia9@.yahoo.com> wrote in message
news:%23ulCPwd3EHA.1144@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I am getting everything fine at my machine database, for all tables
> having identity columns I am getting the identity values properly. Using
> this:
> declare @.test int
> set @.test = ident_current('Track_Changes_Table')
> print @.test
>
> However at the client production machine I am not getting any value
> printed i.e. it is coming NULL. Any idea about the cause for this
> problem.
> Please help. . Thanks in advance.
> Neha Magia
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!

Sunday, February 19, 2012

Getting Error in 32bit DTEXEC on 64bit machine

I'm getting

will not acquire

a connection because the package OfflineMode property is TRUE. When the Offline

Mode is TRUE, connections cannot be acquired."

I'm running the 32bit DTEXEC on a 64bit machine since I'm using the Jet provider.

I see in the forum and other places that this error usually occurs when you try to run in 64bit.

I don't get this error when I've tried it, running the 64bit DTEXEC or when I run from BIDS on a 32bit machine.

Any help appreciated.

David

Hi, We are investigating this particular issue. Its unclear the various conditions/configurations which cause this to happen as in general what your attempting to do does work. As a work around try populating the package property OffLineMode as true with a configuration.

Thank you for your patience.

|||

Apologies, a compatriot pointed out I mistyped, and it should be false not true.

|||

The error is misleading. Two possible solutions. 1) try reinstalling the client tools. 2) Use package configuration to force System::OfflineMode = False

</DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="\Package.Properties[OfflineMode]" ValueType="Boolean"><ConfiguredValue>0</ConfiguredValue></Configuration></DTSConfiguration>

|||

Solved.

We solved the issue by reinstalling just the client components onto the SSIS server.

This replaces the 32bit DTEXEC and now works.

What gave us a clue is the SSMS couldn't connect to the SSIS Service.

David