Showing posts with label running. Show all posts
Showing posts with label running. Show all posts

Tuesday, March 27, 2012

@@identity

I'm running the following within a For Next loop but the
@.@.identity value doesn't always show up. It only shows
for every 3rd record. Any ideas on why this might be?
Thanks,
Ben Bleser
sql = "INSERT INTO table . . . . "
conn.execute(sql)
sql = "Select @.@.Identity as Id"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
rsTmp.close
set rsTmp = nothing
Response.write RequestID & "<br><br>"
Try putting them in the same sql command string; i.e.,
sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
Also, just a performance enhancement, but if you're looping over the INSERT
statements you might consider putting your FOR...NEXT inside of the OPEN and
CLOSE statements. Opening and closing connections can add up to some
serious overhead.
"Ben Bleser" <bbleser@.airway.com> wrote in message
news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
> I'm running the following within a For Next loop but the
> @.@.identity value doesn't always show up. It only shows
> for every 3rd record. Any ideas on why this might be?
> Thanks,
> Ben Bleser
> sql = "INSERT INTO table . . . . "
> conn.execute(sql)
> sql = "Select @.@.Identity as Id"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> rsTmp.close
> set rsTmp = nothing
> Response.write RequestID & "<br><br>"
|||Another way could be to passed the values to insert to a stored procedure
and to get a OUTPUT as a return code back which would represent the
identity.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"Michael C#" <howsa@.boutdat.com> schrieb im Newsbeitrag
news:OOD0dCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Try putting them in the same sql command string; i.e.,
> sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> Also, just a performance enhancement, but if you're looping over the
> INSERT statements you might consider putting your FOR...NEXT inside of the
> OPEN and CLOSE statements. Opening and closing connections can add up to
> some serious overhead.
> "Ben Bleser" <bbleser@.airway.com> wrote in message
> news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
>

@@identity

I am running an insert sp that looks like this
*****************************
@.x int,
@.x1 int,
@.x2 int,
@.NewID int
AS
BEGIN
INSERT INTO TABLE1 (x,x1,x2) VALUES (@.x,@.x1,@.x2)
SET @.New ID = (Select @.@.IDENTITY)
INSERT INTO TABLE2 (@.newID,@.x)
END
***********************
I am getting a conversion error, "Error converting data type varchar to
int.". I cannot figure out the converstion process. I have tried a ton of
different options but nothing works.
I want to run both INSERTs in the same sp.
Any ideas...>SET @.New ID = (Select @.@.IDENTITY)
Try: @.NewID = @.@.IDENTITY
If you are on SQL Server 2000, look at Scope_Identity() in BOL.
--
Lars Broberg
Elbe-Data AB
http://www.elbe-data.se
Remove "nothing." when replying to private e-mail!
M.Smith wrote:
> I am running an insert sp that looks like this
> *****************************
> @.x int,
> @.x1 int,
> @.x2 int,
> @.NewID int
> AS
> BEGIN
> INSERT INTO TABLE1 (x,x1,x2) VALUES (@.x,@.x1,@.x2)
> SET @.New ID = (Select @.@.IDENTITY)
> INSERT INTO TABLE2 (@.newID,@.x)
> END
> ***********************
> I am getting a conversion error, "Error converting data type varchar to
> int.". I cannot figure out the converstion process. I have tried a ton of
> different options but nothing works.
> I want to run both INSERTs in the same sp.
> Any ideas...
>|||worked with SCOPE, thanks
"Lars Broberg" <lars.b@.elbe-data.nothing.se> wrote in message
news:ugIkZPFPFHA.2788@.TK2MSFTNGP09.phx.gbl...
> Try: @.NewID = @.@.IDENTITY
> If you are on SQL Server 2000, look at Scope_Identity() in BOL.
> --
> Lars Broberg
> Elbe-Data AB
> http://www.elbe-data.se
> Remove "nothing." when replying to private e-mail!
>
> M.Smith wrote:|||Hi
Unless you want to keep @.NEWID for later use then you may want to use
SCOPE_IDENTITY() directly in the insert statement.
John
"M.Smith" <martys@.bennyhinn.org> wrote in message
news:uxQhOmFPFHA.3372@.TK2MSFTNGP10.phx.gbl...
> worked with SCOPE, thanks
> "Lars Broberg" <lars.b@.elbe-data.nothing.se> wrote in message
> news:ugIkZPFPFHA.2788@.TK2MSFTNGP09.phx.gbl...
>|||Don't forget to specify the fileds in your INSERT statement.
INTO into TheTable (Field1,Field2) values (@.Value1,@.Value2)
JN.
"M.Smith" <martys@.bennyhinn.org> a crit dans le message de news:
%23Z$GiMFPFHA.1088@.TK2MSFTNGP14.phx.gbl...
>I am running an insert sp that looks like this
> *****************************
> @.x int,
> @.x1 int,
> @.x2 int,
> @.NewID int
> AS
> BEGIN
> INSERT INTO TABLE1 (x,x1,x2) VALUES (@.x,@.x1,@.x2)
> SET @.New ID = (Select @.@.IDENTITY)
> INSERT INTO TABLE2 (@.newID,@.x)
> END
> ***********************
> I am getting a conversion error, "Error converting data type varchar to
> int.". I cannot figure out the converstion process. I have tried a ton of
> different options but nothing works.
> I want to run both INSERTs in the same sp.
> Any ideas...
>

@@identity

I'm running the following within a For Next loop but the
@.@.identity value doesn't always show up. It only shows
for every 3rd record. Any ideas on why this might be?
Thanks,
Ben Bleser
sql = "INSERT INTO table . . . . "
conn.execute(sql)
sql = "Select @.@.Identity as Id"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
rsTmp.close
set rsTmp = nothing
Response.write RequestID & "<br><br>"Try putting them in the same sql command string; i.e.,
sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
Also, just a performance enhancement, but if you're looping over the INSERT
statements you might consider putting your FOR...NEXT inside of the OPEN and
CLOSE statements. Opening and closing connections can add up to some
serious overhead.
"Ben Bleser" <bbleser@.airway.com> wrote in message
news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
> I'm running the following within a For Next loop but the
> @.@.identity value doesn't always show up. It only shows
> for every 3rd record. Any ideas on why this might be?
> Thanks,
> Ben Bleser
> sql = "INSERT INTO table . . . . "
> conn.execute(sql)
> sql = "Select @.@.Identity as Id"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> rsTmp.close
> set rsTmp = nothing
> Response.write RequestID & "<br><br>"|||Another way could be to passed the values to insert to a stored procedure
and to get a OUTPUT as a return code back which would represent the
identity.
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Michael C#" <howsa@.boutdat.com> schrieb im Newsbeitrag
news:OOD0dCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Try putting them in the same sql command string; i.e.,
> sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> Also, just a performance enhancement, but if you're looping over the
> INSERT statements you might consider putting your FOR...NEXT inside of the
> OPEN and CLOSE statements. Opening and closing connections can add up to
> some serious overhead.
> "Ben Bleser" <bbleser@.airway.com> wrote in message
> news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
>> I'm running the following within a For Next loop but the
>> @.@.identity value doesn't always show up. It only shows
>> for every 3rd record. Any ideas on why this might be?
>> Thanks,
>> Ben Bleser
>> sql = "INSERT INTO table . . . . "
>> conn.execute(sql)
>> sql = "Select @.@.Identity as Id"
>> set rsTmp = conn.execute(sql)
>> RequestID = rsTmp("Id")
>> rsTmp.close
>> set rsTmp = nothing
>> Response.write RequestID & "<br><br>"
>|||Hello Ben,
Take a look at SCOPE_IDNTITY() too - in books online.
Cheers
SQLCatZ

@@identity

I'm running the following within a For Next loop but the
@.@.identity value doesn't always show up. It only shows
for every 3rd record. Any ideas on why this might be?
Thanks,
Ben Bleser
sql = "INSERT INTO table . . . . "
conn.execute(sql)
sql = "Select @.@.Identity as Id"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
rsTmp.close
set rsTmp = nothing
Response.write RequestID & "<br><br>"Try putting them in the same sql command string; i.e.,
sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
set rsTmp = conn.execute(sql)
RequestID = rsTmp("Id")
Also, just a performance enhancement, but if you're looping over the INSERT
statements you might consider putting your FOR...NEXT inside of the OPEN and
CLOSE statements. Opening and closing connections can add up to some
serious overhead.
"Ben Bleser" <bbleser@.airway.com> wrote in message
news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
> I'm running the following within a For Next loop but the
> @.@.identity value doesn't always show up. It only shows
> for every 3rd record. Any ideas on why this might be?
> Thanks,
> Ben Bleser
> sql = "INSERT INTO table . . . . "
> conn.execute(sql)
> sql = "Select @.@.Identity as Id"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> rsTmp.close
> set rsTmp = nothing
> Response.write RequestID & "<br><br>"|||Another way could be to passed the values to insert to a stored procedure
and to get a OUTPUT as a return code back which would represent the
identity.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Michael C#" <howsa@.boutdat.com> schrieb im Newsbeitrag
news:OOD0dCFRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Try putting them in the same sql command string; i.e.,
> sql = "INSERT INTO tbl ...; SELECT @.@.identity AS ID;"
> set rsTmp = conn.execute(sql)
> RequestID = rsTmp("Id")
> Also, just a performance enhancement, but if you're looping over the
> INSERT statements you might consider putting your FOR...NEXT inside of the
> OPEN and CLOSE statements. Opening and closing connections can add up to
> some serious overhead.
> "Ben Bleser" <bbleser@.airway.com> wrote in message
> news:00bf01c54449$a62c9c50$a601280a@.phx.gbl...
>

Sunday, March 25, 2012

@@connections increases by 2

Running SQL Server locally for testing purpose
Running select @.@.connections returns 21
Opened a new window in QA
Running select @.@.connections returns 23
I was assuming it to return 22.
Why does it increase it by 2. I have done this many times by opening just
window and nobody else is connected..so why does it increase it by 2 instead
of 1 ?The @.@.connections global variable holds returns the number of connections,
or attempted connections, since SQL ServerT was last started, not the number
of current connections. If you use Profiler, you can trace Query Analyzer -
you can find out that QA makes login, checks some things, makes logout and
then makes login again. This way QA makes 2 connecions for a session.
--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OzWDlyzbDHA.2024@.TK2MSFTNGP12.phx.gbl...
> Running SQL Server locally for testing purpose
> Running select @.@.connections returns 21
> Opened a new window in QA
> Running select @.@.connections returns 23
> I was assuming it to return 22.
> Why does it increase it by 2. I have done this many times by opening just
> window and nobody else is connected..so why does it increase it by 2
instead
> of 1 ?
>

Tuesday, March 20, 2012

::fn_trace_getinfo(default)

To check for any traces running :
SELECT * FROM ::fn_trace_getinfo(default)
Why do we use the :: before the function name ?Hassan
Take a look at this article
http://vyaskn.tripod.com/fn_get_sql.htm
"Hassan" <Hassan@.hotmail.com> wrote in message
news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
> To check for any traces running :
> SELECT * FROM ::fn_trace_getinfo(default)
> Why do we use the :: before the function name ?
>
>|||But it does not answer my question of the 2 colons :: ?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
> Hassan
> Take a look at this article
> http://vyaskn.tripod.com/fn_get_sql.htm
>
>
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
>> To check for any traces running :
>> SELECT * FROM ::fn_trace_getinfo(default)
>> Why do we use the :: before the function name ?
>>
>|||In books online
System table functions that are included in Microsoft=AE SQL Server=99
2000 need to be invoked using a '::' prefix before the function name.
Regards
Amish|||Hi,
If i am not wrong the owner of these functions (there are several others)
seems system_function_schema. Which means there is no corresponding user for
them on master db. And you can only refer them using ::.
That's what i know but there might be a better explanation..
"Hassan" wrote:
> But it does not answer my question of the 2 colons :: ?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
> > Hassan
> > Take a look at this article
> > http://vyaskn.tripod.com/fn_get_sql.htm
> >
> >
> >
> >
> >
> >
> > "Hassan" <Hassan@.hotmail.com> wrote in message
> > news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
> >> To check for any traces running :
> >>
> >> SELECT * FROM ::fn_trace_getinfo(default)
> >>
> >> Why do we use the :: before the function name ?
> >>
> >>
> >>
> >
> >
>
>

::fn_trace_getinfo(default)

To check for any traces running :
SELECT * FROM ::fn_trace_getinfo(default)
Why do we use the :: before the function name ?
Hassan
Take a look at this article
http://vyaskn.tripod.com/fn_get_sql.htm
"Hassan" <Hassan@.hotmail.com> wrote in message
news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
> To check for any traces running :
> SELECT * FROM ::fn_trace_getinfo(default)
> Why do we use the :: before the function name ?
>
>
|||But it does not answer my question of the 2 colons :: ?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
> Hassan
> Take a look at this article
> http://vyaskn.tripod.com/fn_get_sql.htm
>
>
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
>
|||In books online
System table functions that are included in Microsoft=AE SQL Server=99
2000 need to be invoked using a '::' prefix before the function name.
Regards
Amish
|||Hi,
If i am not wrong the owner of these functions (there are several others)
seems system_function_schema. Which means there is no corresponding user for
them on master db. And you can only refer them using ::.
That's what i know but there might be a better explanation..
"Hassan" wrote:

> But it does not answer my question of the 2 colons :: ?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
>
>

::fn_trace_getinfo(default)

To check for any traces running :
SELECT * FROM ::fn_trace_getinfo(default)
Why do we use the :: before the function name ?Hassan
Take a look at this article
http://vyaskn.tripod.com/fn_get_sql.htm
"Hassan" <Hassan@.hotmail.com> wrote in message
news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
> To check for any traces running :
> SELECT * FROM ::fn_trace_getinfo(default)
> Why do we use the :: before the function name ?
>
>|||But it does not answer my question of the 2 colons :: ?
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
> Hassan
> Take a look at this article
> http://vyaskn.tripod.com/fn_get_sql.htm
>
>
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:uJ09PygAGHA.2912@.tk2msftngp13.phx.gbl...
>|||In books online
System table functions that are included in Microsoft=AE SQL Server=99
2000 need to be invoked using a '::' prefix before the function name.
Regards
Amish|||Hi,
If i am not wrong the owner of these functions (there are several others)
seems system_function_schema. Which means there is no corresponding user fo
r
them on master db. And you can only refer them using ::.
That's what i know but there might be a better explanation..
"Hassan" wrote:

> But it does not answer my question of the 2 colons :: ?
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ezuePShAGHA.436@.TK2MSFTNGP10.phx.gbl...
>
>

: xp_smtp_sendmail error on windows server 2005 (x64) n sql server 2005 (64 bit)

hi, i have an application that was running successfully on sql server 2000 x86 machine but now its been migrated to sql server 2005(64 bit) with windows 2003 server x64 machine. And now the xp_smtp_sendmail is not working when called through sql server even declare @.rc int exec @.rc = master.dbo.xp_smtp_sendmail @.server = 'my.server.com', @.port = 25, @.ping = 1 select RC = @.rc wont work it would give error that could not load the dll or one of its module not a valid win32 application. but its working fine in x86 win server 2003 n sql server 2005 machine when i run dependency walkthrough it, it shows some dlls missing i have also read that in syswow64 can run only those application that are not running in kernel mode. what might be the problem...or should i look for another alternative.. thanks for help in advance

Hi,

I have also had some problems with xp_smtp_sendmail in SQL 2005.

But now SQL 2005 supports the use of SMTP email with out the need for a MAPI client. There is minor set up and then you can use the procedure msdb.dbo.sp_send_dbmail. It works basically like xp_smtp_sendmail.

To set up database mail you need to first make sure that Database Mail is enabled in the MS SQL server 2005 Surface Area configuration. Then go into SQL server management studio under Management and right click on Database Mail and select Configure Database Mail.

Here are a couple of links http://www.sqlservercentral.com/columnists/cBunch/introtodatabasemailinsql2005.asp

http://www.databasejournal.com/features/mssql/article.php/3626056

|||Very helpful information, it helped me a lot.. Thank you|||

can you really to send e-mails on 64-bit version?

could you help me in this case?

answer me plz!

|||

I use msdb.dbo.sp_send_dbmail.

It is easier and works better...

|||"msdb.dbo.sp_send_dbmail" works on 64-bit without any errors?
how do you tune environment of SQL Server 2005 (64-bit) for working with "msdb.dbo.sp_send_dbmail"?

could you get me helping article?
|||

This is easy, I will look for an article tomorrow, but for now just do this

Get a SMTP server that you can connect to and you know you have privledges on use outlook express to test it, or some other pop client.

Once you know you have a 'working' smtp server that you can connect to. Set up DBMAIL

to do this just open up the 'Management' folder and right click on dbmail, stomp thru the menu's to set up an account and a profile.

Test this profile by again right clicking on the dbmail icon under the managment folder of your server, and do a "test email" and select your profile check your reciepent's mailbox for the mail. If it doesn't work check the history on the same icon.

Once you KNOW that works....

Then go to the msdb database and drill down to the msdb.dbo.sp_send_dbmail script it to a query window so that you can find all the variables you can give to the stored procedure when you call it.. Like @.profile, @.recepients, @.body, @.subject etc...

Then try to send a message thru your query window and you are done....

That is the short version... I will look for 8X10 glossies tomorrow, and post...

Best Regards,

Dow

|||i've done like you wrote.
outlook has sent the e-mails from this computer (64-bit).

but i've got this error:

Date 2007-04-19 10:00:41
Log Database Mail (Database Mail Log)

Log ID 49
Process ID 4556
Mail Item ID 20
Last Modified 2007-04-19 10:00:41
Last Modified By sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2007-04-19T10:00:40). Exception Message: Could not connect to mail server. (An established connection was aborted by the software in your host machine).
)

i cannot find in internet some clarifying answer about this problem
|||

Okay, so you KNOW you can send mail thru your SMTP server from the very same box that you have sql loaded on.

Therefore, what dbmail is complaining about, if you are doing the send test message step, then the account you are using cannot

authenticate with the SMTP server. Since you KNOW you have sent SMTP mail from the same nic card to the smtp server you know that there is no network issues or server issues. The problem MUST be with the way that you have answered the questions on the ACCOUNT.

Now is your SMTP server a unix type or a windows type? If it is a unix type then make sure you set the username and password are set exactly like you did for the test with the outlook client. and you don't use the secure socket layer setting. If you smtp server will allow anonymous use that.

notice your error is telling you that it cannot connect. Also make sure you have put the correct NAME for the server and you are using the correct port, the default port is 25...

You are almost there, don't give up...

|||GUYS!!!!!!

It WORK!!!

See:

Database Mail in SQL Server 2005
www.databasejournal.com/features/mssql/article.php/3626056

|||

Hi, guys!

I have another problem with SQL Server 2005 & Mail & 64-bit.

I can sent e-mail from SQL Server 2005, but how can i receive e-mail from internet to SQL Server 2005?

I've got the answer:

Msg 17938, Level 16, State 0, Line 0
SQL Mail does not work with the 64-bit version of SQL Server

Help me plz.

|||DatabaseMail is an SMTP client only, which means that is can send but not receive emails. Receiving emails requires POP3 or IMAP support. SQLMail has that built-in, but is being depreciated in coming versions of SQL Server so you'll want to stay away from that implementation.

SQLMail is available in the 32-bit version of SQL Server 2005, but not in the 64-bit version.

HTH...

Joe|||I was wondering if you have a fix to the error on sending mail using the windows vista edition using the windows mail. I love the mail program but can only receive. Get an error report about the port 25. Thanks for any help I can get.

/3GB with 3.7GB RAM?

Hi All,
SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
It's a dedicated sql server; no clustering and no replication.
I would like to increase max memory of sql server process by leaving 1GB for
kernal/OS.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 7MB ?
Thanks,
Ada
SQL Server DBAAda
How much memory does the server have?
Why would you think that changing a memory from a default will be
beneficial?
http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> Hi All,
> SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> It's a dedicated sql server; no clustering and no replication.
> I would like to increase max memory of sql server process by leaving 1GB
> for
> kernal/OS.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 7MB ?
> Thanks,
> Ada
> SQL Server DBA|||Uri,
It's 3.7GB.
To be able to utilize existing physical memory.
Ada
SQL Server DBA
"Uri Dimant" wrote:
> Ada
> How much memory does the server have?
> Why would you think that changing a memory from a default will be
> beneficial?
> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> >
> > Hi All,
> >
> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> > It's a dedicated sql server; no clustering and no replication.
> > I would like to increase max memory of sql server process by leaving 1GB
> > for
> > kernal/OS.
> >
> > If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> > have
> > 1GB or 3.7GB - 3GB = 7MB ?
> >
> > Thanks,
> >
> > Ada
> > SQL Server DBA
>
>|||Ada
Please read a topic in BOL about set up max memory in SQL Server.
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
> Uri,
> It's 3.7GB.
> To be able to utilize existing physical memory.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>> Ada
>> How much memory does the server have?
>> Why would you think that changing a memory from a default will be
>> beneficial?
>> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
>> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
>> >
>> > Hi All,
>> >
>> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
>> > It's a dedicated sql server; no clustering and no replication.
>> > I would like to increase max memory of sql server process by leaving
>> > 1GB
>> > for
>> > kernal/OS.
>> >
>> > If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
>> > have
>> > 1GB or 3.7GB - 3GB = 7MB ?
>> >
>> > Thanks,
>> >
>> > Ada
>> > SQL Server DBA
>>|||Uri,
I read the article and the topic on BOL. They don't have the answer.
Ada
SQL Server DBA
"Uri Dimant" wrote:
> Ada
> Please read a topic in BOL about set up max memory in SQL Server.
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
> >
> > Uri,
> >
> > It's 3.7GB.
> > To be able to utilize existing physical memory.
> >
> > Ada
> >
> > SQL Server DBA
> >
> >
> > "Uri Dimant" wrote:
> >
> >> Ada
> >> How much memory does the server have?
> >>
> >> Why would you think that changing a memory from a default will be
> >> beneficial?
> >>
> >> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
> >>
> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> >> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> >> >
> >> > Hi All,
> >> >
> >> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> >> > It's a dedicated sql server; no clustering and no replication.
> >> > I would like to increase max memory of sql server process by leaving
> >> > 1GB
> >> > for
> >> > kernal/OS.
> >> >
> >> > If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> >> > have
> >> > 1GB or 3.7GB - 3GB = 7MB ?
> >> >
> >> > Thanks,
> >> >
> >> > Ada
> >> > SQL Server DBA
> >>
> >>
> >>
>
>|||Ada
Have you read the article that I posted ?
Here is another one
http://support.microsoft.com/kb/291988/
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...
> Uri,
> I read the article and the topic on BOL. They don't have the answer.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>> Ada
>> Please read a topic in BOL about set up max memory in SQL Server.
>>
>> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
>> >
>> > Uri,
>> >
>> > It's 3.7GB.
>> > To be able to utilize existing physical memory.
>> >
>> > Ada
>> >
>> > SQL Server DBA
>> >
>> >
>> > "Uri Dimant" wrote:
>> >
>> >> Ada
>> >> How much memory does the server have?
>> >>
>> >> Why would you think that changing a memory from a default will be
>> >> beneficial?
>> >>
>> >> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
>> >>
>> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> >> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
>> >> >
>> >> > Hi All,
>> >> >
>> >> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
>> >> > It's a dedicated sql server; no clustering and no replication.
>> >> > I would like to increase max memory of sql server process by leaving
>> >> > 1GB
>> >> > for
>> >> > kernal/OS.
>> >> >
>> >> > If I use /3GB and set "max server memory" to 2.7GB, will OS be able
>> >> > to
>> >> > have
>> >> > 1GB or 3.7GB - 3GB = 7MB ?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Ada
>> >> > SQL Server DBA
>> >>
>> >>
>> >>
>>|||Uri,
I read those articles after they published. I just wanted what my
understanding to be confirmed. Otherwise I need to make the change and run
sy.mon. t make sure. It's not easy to do it on a prod box.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 700MB ?
My understanding is that it will be limited to 700MB, and 0.3GB on user-mode
will be wasted. All I need is a Yes or No.
Thanks,
Ada
SQL Server DBA
"Uri Dimant" wrote:
> Ada
> Have you read the article that I posted ?
> Here is another one
> http://support.microsoft.com/kb/291988/
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...
> >
> > Uri,
> >
> > I read the article and the topic on BOL. They don't have the answer.
> >
> > Ada
> > SQL Server DBA
> >
> >
> > "Uri Dimant" wrote:
> >
> >> Ada
> >>
> >> Please read a topic in BOL about set up max memory in SQL Server.
> >>
> >>
> >>
> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> >> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
> >> >
> >> > Uri,
> >> >
> >> > It's 3.7GB.
> >> > To be able to utilize existing physical memory.
> >> >
> >> > Ada
> >> >
> >> > SQL Server DBA
> >> >
> >> >
> >> > "Uri Dimant" wrote:
> >> >
> >> >> Ada
> >> >> How much memory does the server have?
> >> >>
> >> >> Why would you think that changing a memory from a default will be
> >> >> beneficial?
> >> >>
> >> >> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
> >> >>
> >> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> >> >> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> >> >> >
> >> >> > Hi All,
> >> >> >
> >> >> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> >> >> > It's a dedicated sql server; no clustering and no replication.
> >> >> > I would like to increase max memory of sql server process by leaving
> >> >> > 1GB
> >> >> > for
> >> >> > kernal/OS.
> >> >> >
> >> >> > If I use /3GB and set "max server memory" to 2.7GB, will OS be able
> >> >> > to
> >> >> > have
> >> >> > 1GB or 3.7GB - 3GB = 7MB ?
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Ada
> >> >> > SQL Server DBA
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>|||It's obvious how NT partitions memory when you have <=2GB or >=4GB but what
about 3.75GB
If the /3GB switch is used with 3.75GB does this mean:
NT gets 0.75GB and applications get 3.0GB
or
NT gets 1.00GB and applications get 2.75GB
Paul
I guess
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:BD42BFD4-1ABF-4375-9A91-00EEFE544C6A@.microsoft.com...
> Uri,
> I read those articles after they published. I just wanted what my
> understanding to be confirmed. Otherwise I need to make the change and run
> sy.mon. t make sure. It's not easy to do it on a prod box.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 700MB ?
> My understanding is that it will be limited to 700MB, and 0.3GB on
> user-mode
> will be wasted. All I need is a Yes or No.
> Thanks,
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>> Ada
>> Have you read the article that I posted ?
>> Here is another one
>> http://support.microsoft.com/kb/291988/
>>
>> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...
>> >
>> > Uri,
>> >
>> > I read the article and the topic on BOL. They don't have the answer.
>> >
>> > Ada
>> > SQL Server DBA
>> >
>> >
>> > "Uri Dimant" wrote:
>> >
>> >> Ada
>> >>
>> >> Please read a topic in BOL about set up max memory in SQL Server.
>> >>
>> >>
>> >>
>> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> >> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
>> >> >
>> >> > Uri,
>> >> >
>> >> > It's 3.7GB.
>> >> > To be able to utilize existing physical memory.
>> >> >
>> >> > Ada
>> >> >
>> >> > SQL Server DBA
>> >> >
>> >> >
>> >> > "Uri Dimant" wrote:
>> >> >
>> >> >> Ada
>> >> >> How much memory does the server have?
>> >> >>
>> >> >> Why would you think that changing a memory from a default will be
>> >> >> beneficial?
>> >> >>
>> >> >> http://support.microsoft.com/default.aspx?scid=kb;en-us;274750&sd=tech
>> >> >>
>> >> >> "Ada" <Ada@.discussions.microsoft.com> wrote in message
>> >> >> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
>> >> >> >
>> >> >> > Hi All,
>> >> >> >
>> >> >> > SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
>> >> >> > It's a dedicated sql server; no clustering and no replication.
>> >> >> > I would like to increase max memory of sql server process by
>> >> >> > leaving
>> >> >> > 1GB
>> >> >> > for
>> >> >> > kernal/OS.
>> >> >> >
>> >> >> > If I use /3GB and set "max server memory" to 2.7GB, will OS be
>> >> >> > able
>> >> >> > to
>> >> >> > have
>> >> >> > 1GB or 3.7GB - 3GB = 7MB ?
>> >> >> >
>> >> >> > Thanks,
>> >> >> >
>> >> >> > Ada
>> >> >> > SQL Server DBA
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>sql

/3GB with 3.7GB RAM?

Hi All,
SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
It's a dedicated sql server; no clustering and no replication.
I would like to increase max memory of sql server process by leaving 1GB for
kernal/OS.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 7MB ?
Thanks,
Ada
SQL Server DBAAda
How much memory does the server have?
Why would you think that changing a memory from a default will be
beneficial?
http://support.microsoft.com/defaul...;274750&sd=tech
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> Hi All,
> SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> It's a dedicated sql server; no clustering and no replication.
> I would like to increase max memory of sql server process by leaving 1GB
> for
> kernal/OS.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 7MB ?
> Thanks,
> Ada
> SQL Server DBA|||Uri,
It's 3.7GB.
To be able to utilize existing physical memory.
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> How much memory does the server have?
> Why would you think that changing a memory from a default will be
> beneficial?
> http://support.microsoft.com/defaul...;274750&sd=tech
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
>
>|||Ada
Please read a topic in BOL about set up max memory in SQL Server.
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...[vbcol=seagreen]
> Uri,
> It's 3.7GB.
> To be able to utilize existing physical memory.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>|||Uri,
I read the article and the topic on BOL. They don't have the answer.
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> Please read a topic in BOL about set up max memory in SQL Server.
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
>
>|||Ada
Have you read the article that I posted ?
Here is another one
http://support.microsoft.com/kb/291988/
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...[vbcol=seagreen]
> Uri,
> I read the article and the topic on BOL. They don't have the answer.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>|||Uri,
I read those articles after they published. I just wanted what my
understanding to be confirmed. Otherwise I need to make the change and run
sy.mon. t make sure. It's not easy to do it on a prod box.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 700MB ?
My understanding is that it will be limited to 700MB, and 0.3GB on user-mode
will be wasted. All I need is a Yes or No.
Thanks,
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> Have you read the article that I posted ?
> Here is another one
> http://support.microsoft.com/kb/291988/
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...
>
>|||It's obvious how NT partitions memory when you have <=2GB or >=4GB but what
about 3.75GB
If the /3GB switch is used with 3.75GB does this mean:
NT gets 0.75GB and applications get 3.0GB
or
NT gets 1.00GB and applications get 2.75GB
Paul
I guess
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:BD42BFD4-1ABF-4375-9A91-00EEFE544C6A@.microsoft.com...[vbcol=seagreen]
> Uri,
> I read those articles after they published. I just wanted what my
> understanding to be confirmed. Otherwise I need to make the change and run
> sy.mon. t make sure. It's not easy to do it on a prod box.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 700MB ?
> My understanding is that it will be limited to 700MB, and 0.3GB on
> user-mode
> will be wasted. All I need is a Yes or No.
> Thanks,
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
>

/3GB with 3.7GB RAM?

Hi All,
SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
It's a dedicated sql server; no clustering and no replication.
I would like to increase max memory of sql server process by leaving 1GB for
kernal/OS.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 7MB ?
Thanks,
Ada
SQL Server DBA
Ada
How much memory does the server have?
Why would you think that changing a memory from a default will be
beneficial?
http://support.microsoft.com/default...274750&sd=tech
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
> Hi All,
> SQL Server 2000 Ent.Ed. is running on Windows 2000 Adv. Server.
> It's a dedicated sql server; no clustering and no replication.
> I would like to increase max memory of sql server process by leaving 1GB
> for
> kernal/OS.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 7MB ?
> Thanks,
> Ada
> SQL Server DBA
|||Uri,
It's 3.7GB.
To be able to utilize existing physical memory.
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> How much memory does the server have?
> Why would you think that changing a memory from a default will be
> beneficial?
> http://support.microsoft.com/default...274750&sd=tech
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:390E7800-A4CD-4F18-AC52-C9FF26C5DF7C@.microsoft.com...
>
>
|||Ada
Please read a topic in BOL about set up max memory in SQL Server.
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...[vbcol=seagreen]
> Uri,
> It's 3.7GB.
> To be able to utilize existing physical memory.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
|||Uri,
I read the article and the topic on BOL. They don't have the answer.
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> Please read a topic in BOL about set up max memory in SQL Server.
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:923E5CDC-1E94-40EA-AC1E-A918FD68A670@.microsoft.com...
>
>
|||Ada
Have you read the article that I posted ?
Here is another one
http://support.microsoft.com/kb/291988/
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...[vbcol=seagreen]
> Uri,
> I read the article and the topic on BOL. They don't have the answer.
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:
|||Uri,
I read those articles after they published. I just wanted what my
understanding to be confirmed. Otherwise I need to make the change and run
sy.mon. t make sure. It's not easy to do it on a prod box.
If I use /3GB and set "max server memory" to 2.7GB, will OS be able to have
1GB or 3.7GB - 3GB = 700MB ?
My understanding is that it will be limited to 700MB, and 0.3GB on user-mode
will be wasted. All I need is a Yes or No.
Thanks,
Ada
SQL Server DBA
"Uri Dimant" wrote:

> Ada
> Have you read the article that I posted ?
> Here is another one
> http://support.microsoft.com/kb/291988/
>
> "Ada" <Ada@.discussions.microsoft.com> wrote in message
> news:6960BEF0-1F2F-4009-9CB6-80CF6EF60DED@.microsoft.com...
>
>
|||It's obvious how NT partitions memory when you have <=2GB or >=4GB but what
about 3.75GB
If the /3GB switch is used with 3.75GB does this mean:
NT gets 0.75GB and applications get 3.0GB
or
NT gets 1.00GB and applications get 2.75GB
Paul
I guess
"Ada" <Ada@.discussions.microsoft.com> wrote in message
news:BD42BFD4-1ABF-4375-9A91-00EEFE544C6A@.microsoft.com...[vbcol=seagreen]
> Uri,
> I read those articles after they published. I just wanted what my
> understanding to be confirmed. Otherwise I need to make the change and run
> sy.mon. t make sure. It's not easy to do it on a prod box.
> If I use /3GB and set "max server memory" to 2.7GB, will OS be able to
> have
> 1GB or 3.7GB - 3GB = 700MB ?
> My understanding is that it will be limited to 700MB, and 0.3GB on
> user-mode
> will be wasted. All I need is a Yes or No.
> Thanks,
> Ada
> SQL Server DBA
>
> "Uri Dimant" wrote:

Monday, March 19, 2012

.rss methods no longer supported

I am having a problem running a sql2k report service script on my new sql2005 server. It seems that the methods SessionHeader() and rs.render are no longer suport. can someone help me figure out what I need to do to continue automating my report running?

rss file contents: (the parts that should matter)

--

Report Parameters
Dim branch as string = nothing

Dim skipreport as string = nothing
dim skip as integer = 0

dim allbranchreport as string = nothing
dim allbranch as integer = 0

dim report as CatalogItem
dim repname as string = nothing
dim specificreport as string = nothing
dim filepath as string = nothing
dim errorpath as string = nothing
dim basefilepath as string = nothing
dim baseerrorpath as string = nothing
dim errorlog as integer = 0
Dim parameters() As ParameterValue = nothing
Dim paramcount as integer = 0

' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = nothing
'Dim format As String = "PDF"
Dim format as string = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo as string = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader()
rs.SessionHeaderValue = sh

Dim omitdocmap as string = "True"
'**************************************

'**************************************
'Repset run
Dim repset as string = ""
for each repset in repsetlist
specificreports = specificreportsstart
if specificreports = 0 then
select case repset.tolower
case "all"
specificreports = 0
case "brkctr"
specificreports = 1
reportcount = reportset_brkctr.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_brkctr(reportloop)
next
case "cashmgmt"
specificreports = 1
reportcount = reportset_cashmgmt.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cashmgmt(reportloop)
next
case "com"
specificreports = 1
reportcount = reportset_com.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com(reportloop)
next
case "com_vw"
specificreports = 1
reportcount = reportset_com_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com_vw(reportloop)
next
repset = "com"
case "comcons"
specificreports = 1
reportcount = reportset_comcons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_comcons(reportloop)
next
case "cons"
specificreports = 1
reportcount = reportset_cons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons(reportloop)
next
case "cons_vw"
specificreports = 1
reportcount = reportset_cons_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons_vw(reportloop)
next
repset = "cons"
case "dep"
specificreports = 1
reportcount = reportset_dep.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_dep(reportloop)
next
case "staff"
specificreports = 1
reportcount = reportset_staff.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff(reportloop)
next
omitdocmapbranch = "False"
case "staff2"
specificreports = 1
reportcount = reportset_staff2.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff2(reportloop)
next
omitdocmapbranch = "False"
case else
specificreports = 1
redim specificreportslist(0)
specificreportslist(0) = "Undefined"
end select

if repset.tolower = "staff2" then repset = "staff"
End if


'Base values
basefilepath = basepath & client & "\" & repset & "\"
baseerrorpath = basepath & client & "\" & "error_" & repset & "_"


'Reports List
Dim reports() as CatalogItem
reports = rs.ListChildren(basereportpath, False)

'Execution
if datasourceok = 1 then
for each report in reports

skip = 0
allbranch = allbranchrun

for each skipreport in skipreports
if report.name.tolower = skipreport.tolower then skip = 1
next

if skip = 0 then
if specificreports = 1 then
skip = 1
for each specificreport in specificreportslist
if report.name.tolower = specificreport.tolower then skip = 0
next
end if
end if

if skip = 0 then
for each allbranchreport in allbranchreports
if report.name.tolower = allbranchreport.tolower then allbranch = 1
next

Redim parameters(1)
parameters(0) = New ParameterValue()
parameters(0).name = "branchall"
parameters(1) = New ParameterValue()
parameters(1).Name = "branch"

'5 parameters reports
repname = report.name
if (repname.substring(0,5).tolower = "loans" or repname.substring(0,4).tolower = "locs") then paramcount = 4
if (repname.length >= 13) then
if repname.substring(0,13).tolower = "loans_beacons" then paramcount = 1
end if

if paramcount = 4 then
paramcount = 0
redim preserve parameters(4)

parameters(2) = New ParameterValue()
parameters(2).name = "comconsall"
if repset.tolower = "cons" or repset.tolower = "com" then parameters(2).value = 0 else parameters(2).value = 1

parameters(3) = New ParameterValue()
parameters(3).Name = "comcons"
if repset.tolower = "com" then parameters(3).value = "commercial" else parameters(3).value = "consumer"

parameters(4) = New ParameterValue()
parameters(4).Name = "brokered"
parameters(4).value = 0
if repset.substring(0,3).tolower = "brk" then parameters(4).value = 1
end if

'All Branches Reports
if allbranch = 1 then

parameters(0).value = "1"
parameters(1).value = "admin"
if client = "CSCU" then parameters(1).value = "newwst"
if clienttype = "vw" then parameters(1).value = "1"

errorlog = 0
filepath = basefilepath & report.name & ".xls"
errorpath = baseerrorpath & report.name & ".txt"
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapall
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " All branches")

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if


'Other Reports
else
parameters(0).value = "0"

for each branch in branches
parameters(1).value = branch

errorlog = 0
if branch <> "h/o" then
filepath = basefilepath & branch & "\" & report.name & ".xls"
else
filepath = basefilepath & "ho\" & report.name & ".xls"
end if
if branch <> "h/o" then
errorpath = baseerrorpath & branch & "_" & report.name & ".txt"
else
errorpath = baseerrorpath & "ho_" & report.name & ".txt"
end if
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapbranch
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " " & "Branch: " & branch)

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if

next
end if

end if
next
end if
next

-

I get this error message from cmd when I try and run my batch:

-

J:\PRA Publisher>rs -i pra_publisher.rss -s http://localhost/reportserver -l 0

The specified script failed to compile with the following errors:
J:\PRA Publisher> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:exe
/main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Web
.Services.dll" /R:"C:\Program Files\Microsoft SQL Server\90\Tools\binn\rs.exe" /
out:"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.exe" /debug-
"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.0.vb" "C:\Docu
ments and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(253) : error
BC30002: Type 'SessionHeader' is not defined.

Dim sh As New SessionHeader()
~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(254) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

rs.SessionHeaderValue = sh
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(434) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID, de
vInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(436) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(496) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID
, devInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(498) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~

--

Any advice on how to fix this would be graetly appreciated. Thanks!

The version of rs.exe that ships with SQL 2005 is configured to run against the new 2005 management SOAP endpoint by default. The old 2000 endpoint is still supported. Just add -e mgmt2000 to the command line to use the old endpoint. You can get more information on this option by running rs.exe /? or in the MSDN help files.|||

Thank you so much!!!

That seems to be working beautifully. Just started the batch and its running smoothly so far!

|||

Hi,

my opinion is that this is not a solution, only a workaround. How would a script look like, which is using the ReportingServices2005 endpoint and methods.

I could use the endpoint by this

Dim rs As New ReportingService2005()

But now the debugger tells me that the render method is not a member of Microsoft.SqlServer.ReportingServices2005.ReportingServices2005 .

I want to render a report to the file system. This is the whole script:

' Export report to pdf format to the specified path under filePath and to the file which is specified under fileN
Dim format as string = "PDF"
Dim filePath as String = "D:\temp\"
Dim fileN as String = "reportx"
'Dim Datum as String = CString(Date)
Dim fileName as String = filePath + fileN + ".pdf"
Dim reportPath as String = "/reportx/reportx

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "application/pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
'Windows Credentials were send to Reporting server service
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials


' Report Parameters
Dim parameters(0) As ParameterValue
results = rs.Render(reportPath, format, _
Nothing, Nothing, Nothing, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryParameters, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

'End of script

.rss methods no longer supported

I am having a problem running a sql2k report service script on my new sql2005 server. It seems that the methods SessionHeader() and rs.render are no longer suport. can someone help me figure out what I need to do to continue automating my report running?

rss file contents: (the parts that should matter)

--

Report Parameters
Dim branch as string = nothing

Dim skipreport as string = nothing
dim skip as integer = 0

dim allbranchreport as string = nothing
dim allbranch as integer = 0

dim report as CatalogItem
dim repname as string = nothing
dim specificreport as string = nothing
dim filepath as string = nothing
dim errorpath as string = nothing
dim basefilepath as string = nothing
dim baseerrorpath as string = nothing
dim errorlog as integer = 0
Dim parameters() As ParameterValue = nothing
Dim paramcount as integer = 0

' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = nothing
'Dim format As String = "PDF"
Dim format as string = "EXCEL"
Dim historyID As String = Nothing
Dim devInfo as string = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader()
rs.SessionHeaderValue = sh

Dim omitdocmap as string = "True"
'**************************************

'**************************************
'Repset run
Dim repset as string = ""
for each repset in repsetlist
specificreports = specificreportsstart
if specificreports = 0 then
select case repset.tolower
case "all"
specificreports = 0
case "brkctr"
specificreports = 1
reportcount = reportset_brkctr.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_brkctr(reportloop)
next
case "cashmgmt"
specificreports = 1
reportcount = reportset_cashmgmt.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cashmgmt(reportloop)
next
case "com"
specificreports = 1
reportcount = reportset_com.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com(reportloop)
next
case "com_vw"
specificreports = 1
reportcount = reportset_com_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_com_vw(reportloop)
next
repset = "com"
case "comcons"
specificreports = 1
reportcount = reportset_comcons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_comcons(reportloop)
next
case "cons"
specificreports = 1
reportcount = reportset_cons.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons(reportloop)
next
case "cons_vw"
specificreports = 1
reportcount = reportset_cons_vw.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_cons_vw(reportloop)
next
repset = "cons"
case "dep"
specificreports = 1
reportcount = reportset_dep.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_dep(reportloop)
next
case "staff"
specificreports = 1
reportcount = reportset_staff.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff(reportloop)
next
omitdocmapbranch = "False"
case "staff2"
specificreports = 1
reportcount = reportset_staff2.getupperbound(0)
redim specificreportslist(reportcount)
for reportloop = 0 to reportcount
specificreportslist(reportloop) = reportset_staff2(reportloop)
next
omitdocmapbranch = "False"
case else
specificreports = 1
redim specificreportslist(0)
specificreportslist(0) = "Undefined"
end select

if repset.tolower = "staff2" then repset = "staff"
End if


'Base values
basefilepath = basepath & client & "\" & repset & "\"
baseerrorpath = basepath & client & "\" & "error_" & repset & "_"


'Reports List
Dim reports() as CatalogItem
reports = rs.ListChildren(basereportpath, False)

'Execution
if datasourceok = 1 then
for each report in reports

skip = 0
allbranch = allbranchrun

for each skipreport in skipreports
if report.name.tolower = skipreport.tolower then skip = 1
next

if skip = 0 then
if specificreports = 1 then
skip = 1
for each specificreport in specificreportslist
if report.name.tolower = specificreport.tolower then skip = 0
next
end if
end if

if skip = 0 then
for each allbranchreport in allbranchreports
if report.name.tolower = allbranchreport.tolower then allbranch = 1
next

Redim parameters(1)
parameters(0) = New ParameterValue()
parameters(0).name = "branchall"
parameters(1) = New ParameterValue()
parameters(1).Name = "branch"

'5 parameters reports
repname = report.name
if (repname.substring(0,5).tolower = "loans" or repname.substring(0,4).tolower = "locs") then paramcount = 4
if (repname.length >= 13) then
if repname.substring(0,13).tolower = "loans_beacons" then paramcount = 1
end if

if paramcount = 4 then
paramcount = 0
redim preserve parameters(4)

parameters(2) = New ParameterValue()
parameters(2).name = "comconsall"
if repset.tolower = "cons" or repset.tolower = "com" then parameters(2).value = 0 else parameters(2).value = 1

parameters(3) = New ParameterValue()
parameters(3).Name = "comcons"
if repset.tolower = "com" then parameters(3).value = "commercial" else parameters(3).value = "consumer"

parameters(4) = New ParameterValue()
parameters(4).Name = "brokered"
parameters(4).value = 0
if repset.substring(0,3).tolower = "brk" then parameters(4).value = 1
end if

'All Branches Reports
if allbranch = 1 then

parameters(0).value = "1"
parameters(1).value = "admin"
if client = "CSCU" then parameters(1).value = "newwst"
if clienttype = "vw" then parameters(1).value = "1"

errorlog = 0
filepath = basefilepath & report.name & ".xls"
errorpath = baseerrorpath & report.name & ".txt"
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapall
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " All branches")

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if


'Other Reports
else
parameters(0).value = "0"

for each branch in branches
parameters(1).value = branch

errorlog = 0
if branch <> "h/o" then
filepath = basefilepath & branch & "\" & report.name & ".xls"
else
filepath = basefilepath & "ho\" & report.name & ".xls"
end if
if branch <> "h/o" then
errorpath = baseerrorpath & branch & "_" & report.name & ".txt"
else
errorpath = baseerrorpath & "ho_" & report.name & ".txt"
end if
reportpath = basereportpath & "/" & report.name
omitdocmap = omitdocmapbranch
devinfo = "<DeviceInfo><OmitDocumentMap>" & omitdocmap & "</OmitDocumentMap></DeviceInfo>"

Console.WriteLine (repset.toupper & " " & report.name & " " & "Branch: " & branch)

Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Catch e As SoapException
errorlog = 1
Console.WriteLine(e.Detail.OuterXml)
Catch f as Exception
errorlog = 1
Console.writeline(f.message)
End Try

' Create an error log
If errorlog <> 0 then
Try
Dim stream As FileStream = File.Create(errorpath, 1024)
Console.WriteLine("Errorlog created: " & errorpath)
stream.Close()
Catch g As Exception
Console.WriteLine(g.Message)
End Try
End if

' Write the contents of the report to a file.
If errorlog <> 1 then
Try
Dim stream As FileStream = File.Create(filepath, result.Length)
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to file: " & filepath)
stream.Close()

Catch e As Exception
Console.WriteLine(e.Message)
End Try
end if

next
end if

end if
next
end if
next

-

I get this error message from cmd when I try and run my batch:

-

J:\PRA Publisher>rs -i pra_publisher.rss -s http://localhost/reportserver -l 0

The specified script failed to compile with the following errors:
J:\PRA Publisher> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:exe
/main:MainModule /utf8output /R:"System.dll" /R:"System.Xml.dll" /R:"System.Web
.Services.dll" /R:"C:\Program Files\Microsoft SQL Server\90\Tools\binn\rs.exe" /
out:"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.exe" /debug-
"C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.0.vb" "C:\Docu
ments and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb"


Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(253) : error
BC30002: Type 'SessionHeader' is not defined.

Dim sh As New SessionHeader()
~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(254) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

rs.SessionHeaderValue = sh
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(434) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID, de
vInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(436) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~
C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(496) : error
BC30456: 'Render' is not a member of 'Microsoft.SqlServer.ReportingServices2005
.ReportingService2005'.

result = rs.Render(reportPath, format, historyID
, devInfo, parameters, _
~~~~~~~~~

C:\Documents and Settings\netop\Local Settings\Temp\1\bfw7qn9k.1.vb(498) : error
BC30456: 'SessionHeaderValue' is not a member of 'Microsoft.SqlServer.Reporting
Services2005.ReportingService2005'.

sh.SessionId = rs.SessionHeaderValue.SessionId
~~~~~~~~~~~~~~~~~~~~~

--

Any advice on how to fix this would be graetly appreciated. Thanks!

The version of rs.exe that ships with SQL 2005 is configured to run against the new 2005 management SOAP endpoint by default. The old 2000 endpoint is still supported. Just add -e mgmt2000 to the command line to use the old endpoint. You can get more information on this option by running rs.exe /? or in the MSDN help files.|||

Thank you so much!!!

That seems to be working beautifully. Just started the batch and its running smoothly so far!

|||

Hi,

my opinion is that this is not a solution, only a workaround. How would a script look like, which is using the ReportingServices2005 endpoint and methods.

I could use the endpoint by this

Dim rs As New ReportingService2005()

But now the debugger tells me that the render method is not a member of Microsoft.SqlServer.ReportingServices2005.ReportingServices2005 .

I want to render a report to the file system. This is the whole script:

' Export report to pdf format to the specified path under filePath and to the file which is specified under fileN
Dim format as string = "PDF"
Dim filePath as String = "D:\temp\"
Dim fileN as String = "reportx"
'Dim Datum as String = CString(Date)
Dim fileName as String = filePath + fileN + ".pdf"
Dim reportPath as String = "/reportx/reportx

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string = "application/pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
'Windows Credentials were send to Reporting server service
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials


' Report Parameters
Dim parameters(0) As ParameterValue
results = rs.Render(reportPath, format, _
Nothing, Nothing, Nothing, _
Nothing, Nothing, encoding, mimeType, _
reportHistoryParameters, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

'End of script

|||

This link helped me: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69650

I also saw that render error. Since I'm using rs.exe, I used the -e parameter to specify the endpoint. Here's the command line I used: rs -i sample2.rss -s http://localhost/reportserver -e Exec2005

And here's the contents of sample2.rss (very similar to yours):

'Dim format as string = "Excel"
'Dim fileName as String = "C:\Export2.xls"
Dim format as string = "PDF"
Dim fileName as String = "C:\Export2.pdf"
Dim reportPath as String = "/My_Reports/Test_Report"

Public Sub Main()

' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string = Nothing
'Dim mimeType as string = "ms-excel"
'Dim extension as string = "xls"
Dim mimeType as string = "application/pdf"
Dim extension as string = "pdf"
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim parameters(1) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "UserID"
parameters(0).Value = "myuserid"
parameters(1) = New ParameterValue()
parameters(1).Name = "GroupNum"
parameters(1).Value = Nothing
Dim execHeader AS New ExecutionHeader()
Dim rpt AS New ExecutionInfo
rpt = rs.LoadReport(reportPath, Nothing)
rs.SetExecutionParameters(parameters, "en-us")
rs.ExecutionHeaderValue = execHeader
rs.ExecutionHeaderValue.ExecutionID = rpt.ExecutionID
results = rs.Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)

' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()

End Sub

Sunday, March 11, 2012

.net Security Exception

I am trying to access a stored proc from windows app (VS 2005 running on windows 2003 server).

The code is

SqlConnection conn = new SqlConnection(sCn);

SqlCommand command = new SqlCommand(sCmd, conn);

SqlDataAdapter adapter = new SqlDataAdapter(command);

DataSet ds = new DataSet();

adapter.Fill(ds, "Location");

this.dg.DataSource = ds;

this.dg.DataMember = "Location";

I get the following exception!!!

System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:
Internet

What am I doing wrong?

Thanks

SqlCommand command = new SqlCommand(sCmd, conn);

SqlDataAdapter adapter = new SqlDataAdapter(command);

what exactly is command refering to?

Secondly, if it's refering to a networked application, you probably have to publish the assemblies via caspol on the server.

Based on the error, you need to add a key for the Internet codebase.

Thursday, March 8, 2012

.NET Framwork error when starting SQL Server Profiler

Greetings,

I have been having a problem when I try starting the SQL Profiler. I am running the SQL Server 2005 - Developer edition. I get a message box from Microsoft .NET Framework saying:

Unhandled exception has occurred in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.

Could not load file or assembly 'ConnectionDlg, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its

The details listed under the Details button are:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'ConnectionDlg, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'ConnectionDlg, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.SqlServer.Management.UI.Profiler.SplashScreen.OptimizeLoadTime()
at Microsoft.SqlServer.Management.UI.Profiler.SplashScreen.splashTimer_Elapsed(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
-
PROFILER90
Assembly Version: 9.0.242.0
Win32 Version: 2005.090.1399.00
CodeBase: file:///C:/PROGRA~1/MICROS~4/90/Tools/Binn/PROFIL~1.EXE
-
msvcm80
Assembly Version: 8.0.50608.0
Win32 Version: 8.00.50727.91
CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.91_x-ww_0de56c07/msvcm80.dll
-
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
-
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
-
pfui90
Assembly Version: 9.0.242.0
Win32 Version: 9.00.1399.00
CodeBase: file:///C:/PROGRA~1/MICROS~4/90/Tools/Binn/pfui90.DLL
-

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

******

I have tried uninstalling SQL Server completely as well as .NET2 and then reinstalling them. There is still no change. The rest of the program appears to function fine. Only the Profiler is affected.

Any help would be greatly appreciated.

Thank you for your time.

Terry.

verify this file exists...

C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ConnectionDlg.dll

The namespace of this assembly is Microsoft.SqlServer.Management.UI.ConnectionDlg and I do NOT see this assembly in my GAC, so just ensure its there.

|||Greetings,

I have checked and yes, the file does exist. It is version 9.0.1399.0 (Assembly Version: 9.0.242.0) and file size is: 981,720 bytes.|||then I am assuming that onLoad of Profiler it is looking in the wrong binn directory for the assemblies it uses. No clue at this point dude.|||

No problem. At least you did try so for that I do thank you. Besides, for most problems, it's the simple or obvious answer that solves it. This one so far has been the rarity.

|||Greetings,

I had found out the problem with the Profiler. It turned out that the problem was a bad link file. I would click on the link to start the Profiler, but it would not set the path environment correctly. So, the Profiler was not able to find the needed files. I had deleted the link and made a new one and it worked fine after that. Definitely a strange cause to the problem.

Thanks for the help.

.Net Framework 2.0 and Sql Server 2005

Does anyone know if there are any issues with .Net Framework 2.0 and SQL Server 2005?

Here is my problem .....

I have a web application running on a Windows 2003 Server SE with IIS 6.0. We recently migrated all of our databases to SQL Server 2005 and now we are getting an exception when retrieving data from the DB (Exception Below). We have switched our databases back to Sql Server 2000 and the problem does not occur. Any Help would be much appreciated.

-Ryan

Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 7/3/2006
Time: 10:15:46 AM
User: N/A
Computer: WEBSERVER12
Description:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 system.data, P5 2.0.0.0, P6 4333aea2, P7 1946, P8 25, P9 system.invalidoperationexception, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 63 00 6c 00 72 00 32 00 c.l.r.2.
0008: 30 00 72 00 33 00 2c 00 0.r.3.,.
0010: 20 00 77 00 33 00 77 00 .w.3.w.
0018: 70 00 2e 00 65 00 78 00 p...e.x.
0020: 65 00 2c 00 20 00 36 00 e.,. .6.
0028: 2e 00 30 00 2e 00 33 00 ..0...3.
0030: 37 00 39 00 30 00 2e 00 7.9.0...
0038: 31 00 38 00 33 00 30 00 1.8.3.0.
0040: 2c 00 20 00 34 00 32 00 ,. .4.2.
0048: 34 00 33 00 35 00 62 00 4.3.5.b.
0050: 65 00 31 00 2c 00 20 00 e.1.,. .
0058: 73 00 79 00 73 00 74 00 s.y.s.t.
0060: 65 00 6d 00 2e 00 64 00 e.m...d.
0068: 61 00 74 00 61 00 2c 00 a.t.a.,.
0070: 20 00 32 00 2e 00 30 00 .2...0.
0078: 2e 00 30 00 2e 00 30 00 ..0...0.
0080: 2c 00 20 00 34 00 33 00 ,. .4.3.
0088: 33 00 33 00 61 00 65 00 3.3.a.e.
0090: 61 00 32 00 2c 00 20 00 a.2.,. .
0098: 31 00 39 00 34 00 36 00 1.9.4.6.
00a0: 2c 00 20 00 32 00 35 00 ,. .2.5.
00a8: 2c 00 20 00 73 00 79 00 ,. .s.y.
00b0: 73 00 74 00 65 00 6d 00 s.t.e.m.
00b8: 2e 00 69 00 6e 00 76 00 ..i.n.v.
00c0: 61 00 6c 00 69 00 64 00 a.l.i.d.
00c8: 6f 00 70 00 65 00 72 00 o.p.e.r.
00d0: 61 00 74 00 69 00 6f 00 a.t.i.o.
00d8: 6e 00 65 00 78 00 63 00 n.e.x.c.
00e0: 65 00 70 00 74 00 69 00 e.p.t.i.
00e8: 6f 00 6e 00 20 00 4e 00 o.n. .N.
00f0: 49 00 4c 00 0d 00 0a 00 I.L.....What is odd is that we have set up the same application on a diferent machine running Windows 2003 Server Web Edition with IIS 6.0 and it works fine. I have checked the versions of the framework and they are identical. The only difference between the two apps is that we are running SSL and connecting to the database through a VPN tunnel on the app that throws the exception.|||

I'm not aware of issues between SQL 2005 and .NET Framework 2.0 as the later is required to run the former.

You might try asking about this on the .NET Data Access forum on MSDN or trying over on the ASP.NET forums at www.asp.net, which is where all the ASP.NET folks hang out. (Obvious I suppose) Those two foums would be better equipt to help troubleshoot the server configuration and application code to track down the source of the error.

Mike

.NET Framework 1.1 and SQL server express 2005?

Hi

I am running VS.NET 2003 on my computer and wish to try to install the *free* SQL server express 2005 .

The problem is I can't install SQL express as it asks me to install .NET framework 2.0 first.

I wonder if I do so, will I be able to work with VS.NET 2003?

Thanks,

Yes VS.NET 2003 would work just fine. Multiple versions of .NET framework can run easily.

.NET DiffGram

I am running VS Studio 2003 and a VB.NET web application. I have installed
SQLXML 3 SP3 on both my .NET machine and my SQL server machine, and SOAP 3 on
db Server machine.
I have created a Diffgram from a dataset with writexml to stream and xsd
with SQL relations mapped. Yet when it tries to execute the SQLXMLcommand, I
continually get an Invalid Authorization Specification error.
I have not found anything about it online. Please let me know what I can do
to help the situation. I would love to use Diff gram instead of hand writing
the same XML consuming code into SQL server.
thanks
Hello,
Could you please send the repro so I can take a look ?
Thanks,
Monica Frintu
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
|||This is an interesting error. Do you get this error while you are executing
the SqlXmlcommand? It would help a lot, if you can send your diffgram and
the managed code to execute it.
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"gehrigsranch" <gehrigsranch@.discussions.microsoft.com> wrote in message
news:6BDCC7A7-0E15-46FD-810B-46558F0CB035@.microsoft.com...
>I am running VS Studio 2003 and a VB.NET web application. I have installed
> SQLXML 3 SP3 on both my .NET machine and my SQL server machine, and SOAP 3
> on
> db Server machine.
> I have created a Diffgram from a dataset with writexml to stream and xsd
> with SQL relations mapped. Yet when it tries to execute the
> SQLXMLcommand, I
> continually get an Invalid Authorization Specification error.
> I have not found anything about it online. Please let me know what I can
> do
> to help the situation. I would love to use Diff gram instead of hand
> writing
> the same XML consuming code into SQL server.
> thanks