Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Friday, March 30, 2012

problems with two insert queries in a page

Hello

I have a question about something odd happening with an insert query.

I am working on a password protected site and I want to moniter general student use. I have an on page load even which picks up their user id and the url and sends it to the database

Because my site is a beta site, I also want the users to be able to add their comments as and when they want, so I built a small feedback form on each page.

The quick feedback form has a panel to hide it until a user clicks on a radio button and this reveals a text box and a submit button.

However, since I have added this second sql connection with an insert, I now get an error message I was getting a connection string error when I tried to point at the connection string in the web.config file, so I put the full path in to the database and now I get an error message that says the conTrackUser has not been declared, but as you can see from the code it certainly has. So I'm beginning to thing that the error is something entierly different, but that's probably me being thick.

I've pasted the two insert blocks below, I can't see anything wrong with them, but then I'm mostly groping about in the dark with asp.net.

Is it not possible to have two insert commands on a page? That would be daft.

Here is the code.

Track and initilize the radio button and panel for the feedback:


Sub Page_Load(Sender As Object, E As EventArgs)
Dim UserID as String = session("UserID")
pnlQuickFeedback.Visible = False
If Not Page.IsPostback Then
Dim conTrackUser As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand

conTrackUser = New SqlConnection("server='server'; user id='me'; password='nuts'; database='database'")

cmdInsert = New SqlCommand("TrackUser5530", conTrackUser)
cmdInsert.CommandType = CommandType.StoredProcedure
cmdInsert.Parameters.Add("@.UserIdentity", session("UserID") )
cmdInsert.Parameters.Add("@.URL", Request.Url.AbsoluteUri )

conTrackUser.Open()
cmdInsert.ExecuteNonQuery()
conTrackUser.Close()
End If
End Sub


The sub for the feedback:

Sub SubmitFbbtn_Click(Sender As Object, E As EventArgs)
Dim UserID as String = session("UserID")

'If Not Page.IsPostback Then
Dim conQuickFeedback As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand

conQuickFeedback = New SqlConnection("server='server'; user id='me'; password='nuts'; database='database'")

cmdInsert = New SqlCommand("QuickComments5530", conQuickFeedback)
cmdInsert.CommandType = CommandType.StoredProcedure
cmdInsert.Parameters.Add("@.UserIdentity", session("UserID") )
cmdInsert.Parameters.Add("@.Comments", txtComments.text)
cmdInsert.Parameters.Add("@.URL", Request.Url.AbsoluteUri )

conQuickFeedback.Open()
cmdInsert.ExecuteNonQuery()
conQuickFeedback.Close()
pnlQuickFeedback.Visible = False
feedbackFormbtn.Visible = True
feedbackFormbtn.Checked = False
End Sub


thanksTry using

data source='server'; user id='me'; password='nuts'; initial catalog='database'

Wednesday, March 28, 2012

Problems with SqlDataAdapter

I'm working on a project to dynamically create PDFs with content from an SQL server. My current approach is to get the data I need into a DataSet using SqlDataAdapter, write the DataSet to a stream as XML, transform the XML into FO and then output a pdf using FOP. For some reason I get the following exception "System.NullReferenceException - Object reference not set to an instance of an object" when I try to set the SelectCommand property of my data adapter. Code for the project follows:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim IDlist As String
Dim keyidary As Array
Dim query As String
Dim tempxml As Stream

query = "*****query is valid and very long, so it's not included here*****"

IDlist = Request.Form("chosenIDs")

keyidary = Split(IDlist, ",")
Dim makequery As New StringBuilder(query)

For Each ID As String In keyidary
makequery.Append(" OR (KeyID = '" & ID & "')")
Next

query = makequery.ToString()

'Response.Write(query) When uncommented this prints the query just fine
'Response.End()

Try
con = New SqlConnection
con.ConnectionString = "****Connection String is valid****"

cmd = New SqlCommand
cmd.CommandText = query
cmd.CommandType = CommandType.Text
cmd.Connection = con

Dim adpt As SqlDataAdapter
adpt.SelectCommand = cmd

'Response.Write(query) When these are above or between the previous 2 statements, query is printed,
'Response.End() otherwise I get the error described above.

Dim profiles As New DataSet
adpt.Fill(profiles)
profiles.WriteXml(tempxml)

Dim step1 As XslTransform = New XslTransform
Dim step2 As XslTransform = New XslTransform
step1.Load(Server.MapPath("TransAttmpt1.xslt"))
step2.Load(Server.MapPath("formatXML.xsl"))

Dim xml, pdf As String
xml = "profiles.xml"
pdf = "Profiles.pdf"

Dim temp2xml As New XPathDocument(tempxml)

Response.Write(query)
Response.End()
Dim midstream As Stream
Dim finalxml As StreamWriter = New StreamWriter(xml)

step1.Transform(temp2xml, Nothing, midstream, Nothing)
Dim xpathdoc2 As XPathDocument = New XPathDocument(midstream)

step2.Transform(xpathdoc2, Nothing, finalxml, Nothing)
GeneratePDF(xml, pdf)

'There's a lot more but it doesn't seem relevant now...

I'm somewhat at a loss on how to proceed and any help is very greatly appreciated.

Thanks!

You are not initializing the dataadpater. You should initialize like this:

Dim adptAs SqlDataAdapter =New SqlDataAdapter()
|||

Figured this out probably 3 minutes before you posted but thanks!

Problems with SQL mail

I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
2000. I am trying to get SQL Mail working on this box but keep getting the
following message.
Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
I used to have this setup on a Windows 2000 Server box and it worked spot
on. Can anybody offer any advice? I have logged in as the user the SQL
services run as and setup a mail profile, e-mail works fine as this user. I
have also tried Outlook 2002 and got the same message. Rebooted the server
several times too.
thanks
Gav
SQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net. ..
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>
|||You have to log into the server as the SQL Server service account and use
the Control Panel Mail properties to configure a mail profile. Then you
have to launch Outlook for the first time to get through all of the initial
dialogue.
As far as xpsmtp is concerned, that's great but can't be used by SQL Agent
mail. So, you have no alerts and no job status reports unless you hand code
EVERYTHING.
Sincerely,
Anthony Thomas

"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
SQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net. ..
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>
|||If Microsoft would like to work on a "thorn in your XXX" problem with SQL
Server I vote for SQL Mail. I've had problems with SQL Mail since day one
and it should be a no brainer. I had mine set up on the SQL Servers I deal
with and after many hours finally got it to work with about 90% reliability.
We recently upgraded our Exchange server to 2003 and changed the name of the
email server, but now SQL Mail does NOT work. I can log in to the SQL
server under the domain account the service is running under, make the
changes to the Outlook client, send emails, get all the cute little SQL Mail
Test buttons to work, actually send an email using xp_sendmail, etc, etc,
etc but when it comes to "needing" it to work, it does not. All my
scheduled jobs and all the alerts I have set to notify of production issues
have yet to work. When I stop the SQL Agent service and restart it, I get
flooded with all the emails that should have been sent. I wouldn't recommend
the MAPI SQL Mail to anyone.
I've recently installed the xpsmtp on the servers and it works EVERY time.
I'm making the changes to all the processes I would like to have an email
notification from to use the smtp email - it's a pain, but it's reliable.
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
> SQL Mail can be a real bear to get working. I have not used it since I
> stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
> XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
> is very powerful and it just works. By plug and play I am referring to
> things like automated job failure notification. Instead of clicking on
> "notify operator on error" you have to create a job step that you call on
> failure. The job step will call xp_smtp_sendmail with the appropriate
> parameters.
> --
> Keith
>
> "Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
> news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net. ..
> I
>
|||Microsoft must be aware of the problems with the current implementation of
SQLMail.
SQLiMail is slated be included within the next version of SQLServer. Here
are a few links:
http://www.microsoft.com/technet/com.../tnt1-133.mspx
http://www.microsoft.com/technet/pro...wsqlagent.mspx
http://www.microsoft.com/technet/com...l/SQL0113.mspx
http://www.microsoft.com/technet/com...l/sql1209.mspx
Keith
"cw" <cwilson@.3mc.com> wrote in message
news:OfHtdr8KFHA.4092@.tk2msftngp13.phx.gbl...
> If Microsoft would like to work on a "thorn in your XXX" problem with SQL
> Server I vote for SQL Mail. I've had problems with SQL Mail since day one
> and it should be a no brainer. I had mine set up on the SQL Servers I
deal
> with and after many hours finally got it to work with about 90%
reliability.
> We recently upgraded our Exchange server to 2003 and changed the name of
the
> email server, but now SQL Mail does NOT work. I can log in to the SQL
> server under the domain account the service is running under, make the
> changes to the Outlook client, send emails, get all the cute little SQL
Mail
> Test buttons to work, actually send an email using xp_sendmail, etc, etc,
> etc but when it comes to "needing" it to work, it does not. All my
> scheduled jobs and all the alerts I have set to notify of production
issues
> have yet to work. When I stop the SQL Agent service and restart it, I get
> flooded with all the emails that should have been sent. I wouldn't
recommend
> the MAPI SQL Mail to anyone.
> I've recently installed the xpsmtp on the servers and it works EVERY time.
> I'm making the changes to all the processes I would like to have an email
> notification from to use the smtp email - it's a pain, but it's reliable.
sql

Problems with SQL mail

I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
2000. I am trying to get SQL Mail working on this box but keep getting the
following message.
Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
I used to have this setup on a Windows 2000 Server box and it worked spot
on. Can anybody offer any advice? I have logged in as the user the SQL
services run as and setup a mail profile, e-mail works fine as this user. I
have also tried Outlook 2002 and got the same message. Rebooted the server
several times too.
thanks
GavSQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>|||You have to log into the server as the SQL Server service account and use
the Control Panel Mail properties to configure a mail profile. Then you
have to launch Outlook for the first time to get through all of the initial
dialogue.
As far as xpsmtp is concerned, that's great but can't be used by SQL Agent
mail. So, you have no alerts and no job status reports unless you hand code
EVERYTHING.
Sincerely,
Anthony Thomas
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
SQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>|||If Microsoft would like to work on a "thorn in your XXX" problem with SQL
Server I vote for SQL Mail. I've had problems with SQL Mail since day one
and it should be a no brainer. I had mine set up on the SQL Servers I deal
with and after many hours finally got it to work with about 90% reliability.
We recently upgraded our Exchange server to 2003 and changed the name of the
email server, but now SQL Mail does NOT work. I can log in to the SQL
server under the domain account the service is running under, make the
changes to the Outlook client, send emails, get all the cute little SQL Mail
Test buttons to work, actually send an email using xp_sendmail, etc, etc,
etc but when it comes to "needing" it to work, it does not. All my
scheduled jobs and all the alerts I have set to notify of production issues
have yet to work. When I stop the SQL Agent service and restart it, I get
flooded with all the emails that should have been sent. I wouldn't recommend
the MAPI SQL Mail to anyone.
I've recently installed the xpsmtp on the servers and it works EVERY time.
I'm making the changes to all the processes I would like to have an email
notification from to use the smtp email - it's a pain, but it's reliable.
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
> SQL Mail can be a real bear to get working. I have not used it since I
> stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
> XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
> is very powerful and it just works. By plug and play I am referring to
> things like automated job failure notification. Instead of clicking on
> "notify operator on error" you have to create a job step that you call on
> failure. The job step will call xp_smtp_sendmail with the appropriate
> parameters.
> --
> Keith
>
> "Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
> news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
> I
>|||Microsoft must be aware of the problems with the current implementation of
SQLMail.
SQLiMail is slated be included within the next version of SQLServer. Here
are a few links:
http://www.microsoft.com/technet/co...5/tnt1-133.mspx
http://www.microsoft.com/technet/pr...ql/SQL0113.mspx
http://www.microsoft.com/technet/co...ql/sql1209.mspx
Keith
"cw" <cwilson@.3mc.com> wrote in message
news:OfHtdr8KFHA.4092@.tk2msftngp13.phx.gbl...
> If Microsoft would like to work on a "thorn in your XXX" problem with SQL
> Server I vote for SQL Mail. I've had problems with SQL Mail since day one
> and it should be a no brainer. I had mine set up on the SQL Servers I
deal
> with and after many hours finally got it to work with about 90%
reliability.
> We recently upgraded our Exchange server to 2003 and changed the name of
the
> email server, but now SQL Mail does NOT work. I can log in to the SQL
> server under the domain account the service is running under, make the
> changes to the Outlook client, send emails, get all the cute little SQL
Mail
> Test buttons to work, actually send an email using xp_sendmail, etc, etc,
> etc but when it comes to "needing" it to work, it does not. All my
> scheduled jobs and all the alerts I have set to notify of production
issues
> have yet to work. When I stop the SQL Agent service and restart it, I get
> flooded with all the emails that should have been sent. I wouldn't
recommend
> the MAPI SQL Mail to anyone.
> I've recently installed the xpsmtp on the servers and it works EVERY time.
> I'm making the changes to all the processes I would like to have an email
> notification from to use the smtp email - it's a pain, but it's reliable.

Problems with SQL mail

I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
2000. I am trying to get SQL Mail working on this box but keep getting the
following message.
Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
I used to have this setup on a Windows 2000 Server box and it worked spot
on. Can anybody offer any advice? I have logged in as the user the SQL
services run as and setup a mail profile, e-mail works fine as this user. I
have also tried Outlook 2002 and got the same message. Rebooted the server
several times too.
thanks
GavSQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
--
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>|||You have to log into the server as the SQL Server service account and use
the Control Panel Mail properties to configure a mail profile. Then you
have to launch Outlook for the first time to get through all of the initial
dialogue.
As far as xpsmtp is concerned, that's great but can't be used by SQL Agent
mail. So, you have no alerts and no job status reports unless you hand code
EVERYTHING.
Sincerely,
Anthony Thomas
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
SQL Mail can be a real bear to get working. I have not used it since I
stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
is very powerful and it just works. By plug and play I am referring to
things like automated job failure notification. Instead of clicking on
"notify operator on error" you have to create a job step that you call on
failure. The job step will call xp_smtp_sendmail with the appropriate
parameters.
--
Keith
"Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
> 2000. I am trying to get SQL Mail working on this box but keep getting the
> following message.
> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
> I used to have this setup on a Windows 2000 Server box and it worked spot
> on. Can anybody offer any advice? I have logged in as the user the SQL
> services run as and setup a mail profile, e-mail works fine as this user.
I
> have also tried Outlook 2002 and got the same message. Rebooted the server
> several times too.
> thanks
> Gav
>|||If Microsoft would like to work on a "thorn in your ass" problem with SQL
Server I vote for SQL Mail. I've had problems with SQL Mail since day one
and it should be a no brainer. I had mine set up on the SQL Servers I deal
with and after many hours finally got it to work with about 90% reliability.
We recently upgraded our Exchange server to 2003 and changed the name of the
email server, but now SQL Mail does NOT work. I can log in to the SQL
server under the domain account the service is running under, make the
changes to the Outlook client, send emails, get all the cute little SQL Mail
Test buttons to work, actually send an email using xp_sendmail, etc, etc,
etc but when it comes to "needing" it to work, it does not. All my
scheduled jobs and all the alerts I have set to notify of production issues
have yet to work. When I stop the SQL Agent service and restart it, I get
flooded with all the emails that should have been sent. I wouldn't recommend
the MAPI SQL Mail to anyone.
I've recently installed the xpsmtp on the servers and it works EVERY time.
I'm making the changes to all the processes I would like to have an email
notification from to use the smtp email - it's a pain, but it's reliable.
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:eW7SCzuKFHA.592@.TK2MSFTNGP10.phx.gbl...
> SQL Mail can be a real bear to get working. I have not used it since I
> stumbled upon XPSMTP -- http://sqldev.net/xp/xpsmtp.htm
> XPSMTP does not have the "plug and play" behavior that SQL Mail has but it
> is very powerful and it just works. By plug and play I am referring to
> things like automated job failure notification. Instead of clicking on
> "notify operator on error" you have to create a job step that you call on
> failure. The job step will call xp_smtp_sendmail with the appropriate
> parameters.
> --
> Keith
>
> "Gav" <gavin.metcalfe@.nospam.portakabin.com> wrote in message
> news:d1bip6$rtu$1@.newsreaderg1.core.theplanet.net...
>> I have just setup a Windows 2003 Server with SQL 2000 (sp 3a) and Outlook
>> 2000. I am trying to get SQL Mail working on this box but keep getting
>> the
>> following message.
>> Error 18025: xp_test_mapi_profile : failed with mail error 0x80040111
>> I used to have this setup on a Windows 2000 Server box and it worked spot
>> on. Can anybody offer any advice? I have logged in as the user the SQL
>> services run as and setup a mail profile, e-mail works fine as this user.
> I
>> have also tried Outlook 2002 and got the same message. Rebooted the
>> server
>> several times too.
>> thanks
>> Gav
>>
>|||Microsoft must be aware of the problems with the current implementation of
SQLMail.
SQLiMail is slated be included within the next version of SQLServer. Here
are a few links:
http://www.microsoft.com/technet/community/events/sql2005/tnt1-133.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2005/evaluate/newsqlagent.mspx
http://www.microsoft.com/technet/community/chats/trans/sql/SQL0113.mspx
http://www.microsoft.com/technet/community/chats/trans/sql/sql1209.mspx
--
Keith
"cw" <cwilson@.3mc.com> wrote in message
news:OfHtdr8KFHA.4092@.tk2msftngp13.phx.gbl...
> If Microsoft would like to work on a "thorn in your ass" problem with SQL
> Server I vote for SQL Mail. I've had problems with SQL Mail since day one
> and it should be a no brainer. I had mine set up on the SQL Servers I
deal
> with and after many hours finally got it to work with about 90%
reliability.
> We recently upgraded our Exchange server to 2003 and changed the name of
the
> email server, but now SQL Mail does NOT work. I can log in to the SQL
> server under the domain account the service is running under, make the
> changes to the Outlook client, send emails, get all the cute little SQL
Mail
> Test buttons to work, actually send an email using xp_sendmail, etc, etc,
> etc but when it comes to "needing" it to work, it does not. All my
> scheduled jobs and all the alerts I have set to notify of production
issues
> have yet to work. When I stop the SQL Agent service and restart it, I get
> flooded with all the emails that should have been sent. I wouldn't
recommend
> the MAPI SQL Mail to anyone.
> I've recently installed the xpsmtp on the servers and it works EVERY time.
> I'm making the changes to all the processes I would like to have an email
> notification from to use the smtp email - it's a pain, but it's reliable.

Friday, March 23, 2012

Problems with Printing and rendering to PDF

Hi,

I have an SQL server 2000 and I am creating a simple 1 page report using the Reporting Services and Visual Studio 2003. Everything is working fine. When I on "Preview" or when I access the report using a URL to disply it in HTML, I get a perfect report.

However, when I click on the "Print Preview" Icon (in the Preview Tab), or when I Render it as PDF, something goes wrong and it divides the report in 2 pages. On the first, there is only the company logo and the outlines of the tables used, while the rest of the report (minus the logo) is on the second page! I tried removing the logo, but still got a first page with only the outlines of tables. I also tried increasing the margins, with no success! I even tried removing some of the tables from the report, and test it, also the same result! could it be the datasets?

Did anybody get this problem? What could possibly be the reason?

Thanks a lot

Bob

Yes, the only way that I was able to stop this from happening was to reduce the margin size in the report properties.|||

Thx

yes it was the margins of the report that did this, especially the left and right margins.

sql

Problems with Printing and rendering to PDF

Hi,

I have an SQL server 2000 and I am creating a simple 1 page report using the Reporting Services and Visual Studio 2003. Everything is working fine. When I on "Preview" or when I access the report using a URL to disply it in HTML, I get a perfect report.

However, when I click on the "Print Preview" Icon (in the Preview Tab), or when I Render it as PDF, something goes wrong and it divides the report in 2 pages. On the first, there is only the company logo and the outlines of the tables used, while the rest of the report (minus the logo) is on the second page! I tried removing the logo, but still got a first page with only the outlines of tables. I also tried increasing the margins, with no success! I even tried removing some of the tables from the report, and test it, also the same result! could it be the datasets?

Did anybody get this problem? What could possibly be the reason?

Thanks a lot

Bob

Yes, the only way that I was able to stop this from happening was to reduce the margin size in the report properties.|||

Thx

yes it was the margins of the report that did this, especially the left and right margins.

Wednesday, March 21, 2012

Problems with Nulls and SQL UDT's

I created a UDT in C# that is working fine except when I request rows where the type is null.

If I use SELECT Film.ToString() FROM ImageData it works fine, or any property they return Null as expected

but if I use SELECT Film FROM ImageData it produces the error below

An error occurred while executing batch. Error message is: Data is Null. This method or property cannot be called on Null values.

I looked through all the examples in C# and my code matches the pattern for nulls exactly. Can anyone shead some light on what attribute I may have to add or method I should override which is not documented.

This was a bug. Please see http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125552

Cheers,

Tuesday, March 20, 2012

Problems with Multi-column and Footers

I have a multi-column report that I had working fine as of Friday night. It
is basically a two-column report of bar-codes to be read by a scanner, with
some identifying information under each entry.
I then added a Header that picked up a data field using the recommended
method I found in one other entry -- basically, refer to a field on the page
rather than a data base field -- that worked fine, and put a nice header all
of the way across the top of each page.
I then told it to add a footer that had static information across the bottom
of the page. Once I did that, it would no longer print the right
hand-column. It continued to print the header across the top of the page,
the data, all in the left-hand column (on three pages), and the footer
across the complete bottom of each page.
However, try as I might, I was never able to get it to print the barcode in
multiple columns.
Walt Crosby
walt.crosby@.everydaywireless.comAfter reading McGraw-Hill/Osborne's Microsoft SQL Server 2005 Reporting
Services by Brian Larson, I discovered that I was using the wrong body
format. I was using Table when I should have used List. Once I changed my
data type to List, everything worked fine.
I also had gone overboard on making solid outlines around each of the items
in the list. Once I reduced the number of outlines, everything cleaned up.
Walt
"Walt Crosby" <Walt.Crosby@.everydaywireless.com> wrote in message
news:OXxcbb%23OGHA.2268@.TK2MSFTNGP09.phx.gbl...
>I have a multi-column report that I had working fine as of Friday night.
>It is basically a two-column report of bar-codes to be read by a scanner,
>with some identifying information under each entry.
> I then added a Header that picked up a data field using the recommended
> method I found in one other entry -- basically, refer to a field on the
> page rather than a data base field -- that worked fine, and put a nice
> header all of the way across the top of each page.
> I then told it to add a footer that had static information across the
> bottom of the page. Once I did that, it would no longer print the right
> hand-column. It continued to print the header across the top of the page,
> the data, all in the left-hand column (on three pages), and the footer
> across the complete bottom of each page.
> However, try as I might, I was never able to get it to print the barcode
> in multiple columns.
> Walt Crosby
> walt.crosby@.everydaywireless.com
>

Monday, March 12, 2012

Problems with identity column

I was working on a program recently that had a bit field called 'completed'
which recorded when a certain event was complete. I was removing this field
because it was possible to tell that the event was complete through other
means so the field was a duplication and a violation of good data design.
The end result was that it was possible for something in the program to show
as completed when in fact it wasn't. I thought this was a really good
example of how bad data design effects the end user.
When using Identity columns as the primary key some here think it is bad
design but I've never seen anyone quote an actual divantage for the end
user, all the "divantages" seem to be quite abstract and far removed from
the real world. In fact all I can see is advantages for the end user. Can
anyone come up with an actual real word divantage for an identity column
pk?IDENTITY, BIT, and "field" are **totally non-relational** concepts.
But in fairness, you realized that you had a computed column (NOT
field!!) so perhaps you can be saved.
Let me go ahead one more step and play Q&A with the direction I think
you are going:
Q: Couldn't a compound key become very long?
A1: So what? This is the 21-s's century and we have much better
computers than we did in the 1950's when key size was a real physical
issue. What is funny to me is the number of idiots who replace a
natural two or three integer compound key with a huge GUID that no
human being or other system can possibly understand because they think
it will be "faster and easy" to program.
A2: This is an implementation problem that the SQL engine can handle.
For example, Teradata is an SQL designed for VLDB apps that uses
hashing instead of B-tree or other indexes. They guarantee that no
search requires more than two probes, no matter how large the database.
A tree index requires more and more probes as the size of the database
increases.
A3: A long key is not always a bad thing for performance. For example,
if I use (city, state) as my key, I get a free index on just (city). I
can also add extra columns to the key to make it a super-key when such
a super-key gives me a covering index (i.e. an index which contains all
of the columns required for a query, so that the base table does not
have to be accessed at all).
A handle to the row? Oh, you mean faking a sequential file's
positional record number, so I can reference the physical storage
location? Sure, if I want to lose all the advantages of an abstract
data model, SQL set oriented programming, carry extra data and destroy
the portability of code!
More and more programmers who have absolutely no database training are
being told to design a database. They are using GUIDs, IDENTITY, ROWID
and other proprietary auto-numbering "features" in SQL products to
imitate either a record number (sequential file system mindset) or OID
(OO mindset) since they don't know anything else.
Experienced database designers tend toward intelligent keys they find
in industry standard codes, such as UPC, VIN, GTIN, ISBN, etc. They
know that they need to verify the data against the reality they are
modeling. A trusted external source is a good thing to have.
The IDENTITY column is a holdover from the early programming languages
which were very close to the hardware. For example, the fields (not
columns; big difference) in a COBOL or FORTRAN program were assumed to
be physically located in main storage in the order they were declared
in the program. The languages have constructs using that model --
logical and physical implementations are practically one! The data has
meaning BECAUSE of the program reading it (i.e. the same bits could be
a character in one program and be an integer in another)
The early SQLs were based on existing file systems. The data was kept
in physically contiguous disk pages, in physically contiguous rows,
made up of physically contiguous columns. In short, just like a deck
of punch cards or a magnetic tape. Most programmer still carry that
mental model, which is why I keep doing that rant about file vs. table,
row vs. record and column vs. field.
But physically contiguous storage is only one way of building a
relational database and it is not the best one. The basic idea of a
relational database is that user is not supposed to know *how* or
*where* things are stored at all, much less write code that depends on
the particular physical representation in a particular release of a
particular product on particular hardware at a particular time.
One of the biggest errors is the IDENTITY column (actually property,
not a column at all) in the Sybase/SQL Server family. People actually
program with this "feature" and even use it as the primary key for the
table! Now, let's go into painful details as to why this thing is bad.
The first practical consideration is that IDENTITY is proprietary and
non-portable, so you know that you will have maintenance problems when
you change releases or port your system to other products. Newbies
actually think they will never port code! Perhaps they only work for
companies that are failing and will be gone. Perhaps their code is
such crap nobody else want their application.
But let's look at the logical problems. First try to create a table
with two columns and try to make them both IDENTITY. If you cannot
declare more than one column to be of a certain data type, then that
thing is not a datatype at all, by definition. It is a property which
belongs to the PHYSICAL table, not the LOGICAL data in the table.
Next, create a table with one column and make it an IDENTITY. Now try
to insert, update and delete different numbers from it. If you cannot
insert, update and delete rows from a table, then it is not a table by
definition.
Finally create a simple table with one IDENTITY and a few other
columns. Use a few statements like
INSERT INTO Foobar (a, b, c) VALUES ('a1', 'b1', 'c1');
INSERT INTO Foobar (a, b, c) VALUES ('a2', 'b2', 'c2');
INSERT INTO Foobar (a, b, c) VALUES ('a3', 'b3', 'c3');
To put a few rows into the table and notice that the IDENTITY
sequentially numbered them in the order they were presented. If you
delete a row, the gap in the sequence is not filled in and the sequence
continues from the highest number that has ever been used in that
column in that particular table. This is how we did record numbers in
pre-allocated sequential files in the 1950's, by the way. A utility
program would then "pack" or "compress" the records that were flagged
as deleted or unused to move the empty space to the physical end of the
physical file. IDENTITY leaves the gaps.
But now use a statement with a query expression in it, like this:
INSERT INTO Foobar (a, b, c)
SELECT x, y, z
FROM Floob;
Since a query result is a table, and a table is a set which has no
ordering, what should the IDENTITY numbers be? The entire, whole,
completed set is presented to Foobar all at once, not a row at a time.
There are (n!) ways to number (n) rows, so which one do you pick? The
answer has been to use whatever the *physical* order of the result set
happened to be. That non-relational phrase "physical order" again!
But it is actually worse than that. If the same query is executed
again, but with new statistics or after an index has been dropped or
added, the new execution plan could bring the result set back in a
different physical order.
Can you explain from a logical model why the same rows in the second
query get different IDENTITY numbers? In the relational model, they
should be treated the same if all the values of all the attributes are
identical.
Using IDENTITY as a primary key is a sign that there is no data model,
only an imitation of a sequential file system. Since this "magic,
all-purpose, one-size-fits-all" pseudo-identifier exists only as a
result of the physical state of a particular piece of hardware at a
particular time as read by the current release of a particular database
product, how do you verify that an entity has such a number in the
reality you are modeling?
You will see newbies who design tables like this:
CREATE Drivers
(driver_id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL REFERENCES Personnel(ssn),
vin CHAR(17) NOT NULL REFERENCES Motorpool(vin));
Now input data and submit the same row a thousand times, a million
times. Your data integrity is trashed. The natural key was this:
CREATE Drivers
(ssn CHAR(9) NOT NULL REFERENCES Personnel(ssn),
vin CHAR(17) NOT NULL REFERENCES Motorpool(vin),
PRIMARY KEY (ssn, vin));
To demonstrate, here is a typical newbie schema -- you will them all
over the news groups. I call them "idiots" because they always name
the IDENTITY property column "id" in EVERY table. They don't
understand basic data modeling -- one and only name for an attribute.
About half the time they don't use any DRI, but let's show it.
CREATE TABLE MotorPool
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL REFERENCES Personnel(snn),
vin CHAR(17) NOT NULL REFERENCES Vehicle(vin));
CREATE TABLE Personnel
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL UNIQUE,
.);
CREATE TABLE Vehicles
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
vin CHAR(17) NOT NULL UNIQUE,
..);
Now change a row in Personnel:
UPDATE Personnel
SET ssn = '666666666'
WHERE id = 1;
or
UPDATE Personnel
SET ssn = '666666666'
WHERE ssn = '999999999';
or
BEGIN ATOMIC
DELETE FROM Personnel WHERE id = 1;
INSERT INTO Personnel VALUES ('666666666');
END;
What happened in Motorpool? There is no logical relationship between
the real key and the exposed physical locator, not is there any way to
make one.
Another cute way to destroy data integrity:
BEGIN ATOMIC
DELETE FROM Foobar
WHERE id = <<some row>>;
INSERT INTO Foobar
VALUES ( <<recreate deleted row>> )
END;
Logically this should do nothing, but since IDENTITY has gaps, it
trashes the data.
Now you are REALLY thinking about relations and keys instead of 1950's
sequential record numbering. Adding an IDENTITY column to either of
these tables as a candidate key would be dangerously redundant; one
query uses the IDENTITY and another uses the real key, and like a man
with two watches, you are never sure what time it is.
Finally, an appeal to authority, with a quote from Dr. Codd:
"..Database users may cause the system to generate or delete a
surrogate, but they have no control over its value, nor is its value
ever displayed to them ..."(Dr. Codd in ACM TODS, pp 409-410) and Codd,
E. (1979), Extending the database relational model to capture more
meaning. ACM Transactions on Database Systems, 4(4). pp. 397-434.
This means that a surrogate ought to act like an index; created by the
user, managed by the system and NEVER seen by a user. That means never
used in queries, DRI or anything else that a user does.
Codd also wrote the following:
"There are three difficulties in employing user-controlled keys as
permanent surrogates for entities.
(1) The actual values of user-controlled keys are determined by users
and must therefore be subject to change by them (e.g. if two companies
merge, the two employee databases might be combined with the result
that some or all of the serial numbers might be changed.).
(2) Two relations may have user-controlled keys defined on distinct
domains (e.g. one uses social security, while the other uses employee
serial numbers) and yet the entities denoted are the same.
(3) It may be necessary to carry information about an entity either
before it has been assigned a user-controlled key value or after it has
ceased to have one (e.g. and applicant for a job and a retiree).
These difficulties have the important consequence that an equi-join on
common key values may not yield the same result as a join on common
entities. A solution - proposed in part [4] and more fully in [14] -
is to introduce entity domains which contain system-assigned
surrogates. Database users may cause the system to generate or delete
a surrogate, but they have no control over its value, nor is its value
ever displayed to them...." (Codd in ACM TODS, pp 409-410).
References
Codd, E. (1979), Extending the database relational model to capture
more meaning. ACM Transactions on Database Systems, 4(4). pp. 397-434|||Although I do use identity columns myself, off the top of my head, I can thi
nk
of four issues with Identity columns
1. Users have to make a call to the database to get the PK value. This is a
pain
in parent-child situations where the parent must save before you save the
children. It is much nicer from a development standpoint to be able to gener
ate
a unique PK value on the client (or middle-tier) side. This is an easy issue
to
solve of course, it just doesn't make it as nice.
2. It is difficult if not impossible to share your keys with third parties.
If
you need to allow third-parties to generate keys (e.g. shipping numbers), th
en
Identity columns are out of the question. They absolutely will need the abil
ity
to generate a unique key on their side that will be unique on your side. Thi
s is
situation where a check digit of some sort is truly necessary. However, most
systems do not have this requirement. If it is never expected for this situa
tion
to arise, then this shouldn't be a consideration. Not every system has to be
designed to meet DOD standards.
3. Replication is more difficult. If you have multiple sites with databases
that
contain Identity columns, it is much more difficult to set it up in such a w
ay
as to not get conflicts between the two sites. It is still doable, but more
problematic. In addition, the more sites you add, the more difficult it is.
4. It is more difficult to port to a system that does not contain Identity
columns. This one is a pipe dream IMO. Part of the cost of porting to anothe
r
system would be the creation of a new key generation mechanism to take the p
lace
of the identity column. Further, it is likely that there are far more issues
that will need to be resolved than handling identity column.
Part of the problem is that "primary key" denotes two vastly different conce
pts.
In the relational model, a key is a subset of an entity's attributes that a
human can use to identify that entity. However, in every vendor's DBMS, the
PK
is also the "glue" used to relate entities to each other. I.e., it has speci
al
meaning and purpose.
Further, I would argue that there are rare situations where a human has no n
eed
of identifying a entity. Generally, this happens when a human treats a serie
s of
items as a set of indistinguishable elements. For example, suppose we have
invoices and invoice items. While it is true that users will want a means to
identify an invoice, they may never have a desire to uniquely identify the i
tems
on the invoice and may specifically want to allow for situations where the s
ame
product is listed twice on the same invoice (A friend of mine actually
encountered this situation. I believe the reason given was clarity in displa
ying
discounts). However, while the *users* may never have a need to identify an
invoice item, the *system* that retrieves and saves them most likely will
(granted you could always read and write the entire list each time).
That said, when using Identity columns, I will make an effort to include at
least one unique index on the attributes other than the PK. The advantage of
this approach is that you can change and/or add unique keys far easier than
changing the makeup of the PK itself.
Thomas|||"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1117151361.768467.270510@.z14g2000cwz.googlegroups.com...
> Q: Couldn't a compound key become very long?

> IDENTITY, BIT, and "field" are **totally non-relational** concepts.

> The first practical consideration is that IDENTITY is proprietary and
> non-portable,

> A handle to the row? Oh, you mean faking a sequential file's
> positional record number

> The IDENTITY column is a holdover from the early programming languages
<snip>
You proved my point perfectly. I asked if you could come up with an actual
real world end user divantage to identity pks. As I expected you came up
with a whole lot of abstract points that wouldn't affect the end user. I'm
sure that was a big cut and paste and largely irrelevant to the actual
question so I didn't read the whole thing but if by some chance there was a
divantage in there please let me know, I'd be very interested to see it.
Michael|||"Thomas Coleman" <replyingroup@.anywhere.com> wrote in message
news:ungSrBlYFHA.584@.TK2MSFTNGP15.phx.gbl...
> Although I do use identity columns myself, off the top of my head, I can
> think of four issues with Identity columns
> 1. Users have to make a call to the database to get the PK value. This is
> a pain in parent-child situations where the parent must save before you
> save the children.
Users wouldn't see this though as you could make the save into a single
operation.

> It is much nicer from a development standpoint to be able to generate a
> unique PK value on the client (or middle-tier) side. This is an easy issue
> to solve of course, it just doesn't make it as nice.
The uniqueidentifier solves this. By "identity pk" in my original Q I really
meant non-natural pk, either identity or guid or just an int, which I know I
should have stated :-)
> 2. It is difficult if not impossible to share your keys with third
> parties. If you need to allow third-parties to generate keys (e.g.
> shipping numbers), then Identity columns are out of the question. They
> absolutely will need the ability to generate a unique key on their side
> that will be unique on your side. This is situation where a check digit of
> some sort is truly necessary. However, most systems do not have this
> requirement. If it is never expected for this situation to arise, then
> this shouldn't be a consideration. Not every system has to be designed to
> meet DOD standards.
In that case I would drop the identity but keep it as an int.

> 3. Replication is more difficult. If you have multiple sites with
> databases that contain Identity columns, it is much more difficult to set
> it up in such a way as to not get conflicts between the two sites. It is
> still doable, but more problematic. In addition, the more sites you add,
> the more difficult it is.
Can you still replicated on your unique index?

> 4. It is more difficult to port to a system that does not contain Identity
> columns. This one is a pipe dream IMO. Part of the cost of porting to
> another system would be the creation of a new key generation mechanism to
> take the place of the identity column. Further, it is likely that there
> are far more issues that will need to be resolved than handling identity
> column.
True.

> That said, when using Identity columns, I will make an effort to include
> at least one unique index on the attributes other than the PK. The
> advantage of this approach is that you can change and/or add unique keys
> far easier than changing the makeup of the PK itself.
I agree with that, you should still have something unique that identifies
each records.
Michael|||> Users wouldn't see this though as you could make the save into a single
> operation.
Using stored procedures makes this a snap, or it would be easy in the
dynamic SQL generation to use the data entered as the key to retrieve the
row:
insert into table (col1, col2) values (1,2)
select pkValue from table where col1 = 1 --assuming it is the natural key.

> The uniqueidentifier solves this. By "identity pk" in my original Q I
> really meant non-natural pk, either identity or guid or just an int, which
> I know I should have stated :-)
The problem is that it is so darn big. I mean it will take four times as
much space as an integer! Meaning four times as many pages in your index,
and even worse if you use it in your clustered index. Why is it so hard to
just get the value back after you create the new row? It is easy to do
using the natural key of the row you have created, or scope_identity() (of
course this is assuming you are using a surrogate)

Here you are really mixing paradigms. The identity value should not be the
key you share. The key you share would be the third-party key. It gives
you a lot of freedom to modify the value later without shifting around
structures in your database, or even to have more than one third party
reference to the same row. Identities or any surrogate key with no
check-digit or something(as you continue on to discuss) generally make lousy
keys. because they are kind of plain, and too easy to mistake. It is best
when you can type in a value 00003002 not to be able to fat finger it and
type 00003001 and get an actual value that works. Not impossible to stumble
upon a value, but unlikely.
I think that either type of key works just fine, but I like identies for the
flexibility of building the natural keys, as well as the ability to have a
common pattern of development (all primary keys int, all primary keys
singular, etc.) I don't think this is a requirement for a good design, not
at all. But it is a good design and works great.
> I agree with that, you should still have something unique that identifies
> each records.
>
Unless there is a compelling reason not to, you should ALWAYS do this! This
is what really kills so many databases that use identity keys. Hopefully I
am preaching to the choir, but it bears repeating that a surrogate key must
be a surrogate for something.
There are cases where you can't come up with a unique key, but they are very
few and far between. The best example I have is logging operations that
occur closer together than .003 seconds (the grain of the datetime.)
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Michael C" <mculley@.NOSPAMoptushome.com.au> wrote in message
news:%23SVYvUlYFHA.2756@.tk2msftngp13.phx.gbl...
> "Thomas Coleman" <replyingroup@.anywhere.com> wrote in message
> news:ungSrBlYFHA.584@.TK2MSFTNGP15.phx.gbl...
> Users wouldn't see this though as you could make the save into a single
> operation.
>
> The uniqueidentifier solves this. By "identity pk" in my original Q I
> really meant non-natural pk, either identity or guid or just an int, which
> I know I should have stated :-)
> In that case I would drop the identity but keep it as an int.
>
> Can you still replicated on your unique index?
>
> True.
>
> I agree with that, you should still have something unique that identifies
> each records.
> Michael
>|||>> Users wouldn't see this though as you could make the save into a single
> Using stored procedures makes this a snap, or it would be easy in the dyna
mic
> SQL generation to use the data entered as the key to retrieve the row:
> insert into table (col1, col2) values (1,2)
> select pkValue from table where col1 = 1 --assuming it is the natural key.
Granted. Didn't say it wasn't possible; just more of a pain. It's more of a
pain
with the parent-child scenario like a invoice and invoice items. You have to
save the invoice, retrieve the new key and then save the invoice items. Not
a
big deal and I have used stored procs to solve this problem easily. Just mor
e of
a pain.
<snip>
> Why is it so hard to just get the value back after you create the new row?
It
> is easy to do using the natural key of the row you have created, or
> scope_identity() (of course this is assuming you are using a surrogate)
It isn't *so* hard per se. Just more of a pain. Like I said, if you have a l
ong
inheritance chain (parent-child-child...), it makes it more of a pain. Not
impossible to overcome. Just more problematic.

> Here you are really mixing paradigms. The identity value should not be th
e
> key you share.
<snip>
Exactly. The identity value in and of itself cannot be shared to a third par
ty.
Another unique key must be derived that is given to the third party (as you
said) that contains check digits and such. I have used this exact schema in
situations where a bar code with a check digit was necessary. A new key was
derived *once it was realized* that it would be needed. The bar coded value
was
merely one more way to identify the entity.
<snip>

> Unless there is a compelling reason not to, you should ALWAYS do this! Th
is
> is what really kills so many databases that use identity keys. Hopefully
I am
> preaching to the choir, but it bears repeating that a surrogate key must b
e a
> surrogate for something.
> There are cases where you can't come up with a unique key, but they are ve
ry
> few and far between. The best example I have is logging operations that o
ccur
> closer together than .003 seconds (the grain of the datetime.)
Agreed or that the exact make up the unique key is not known at initial desi
gn.
The lesson here is to strive to be the most restrictive in your design. Try
to
apply unique indexes initially. Try to make columns non-nullable. Add check
constraints etc. By abstracting the key away from the data, you make it poss
ible
to remove these restrictions later or even add new ones.
Remember, that the original poster asked what *potential* downsides are ther
e to
an identity. They do exist. As with all design decisions, their use must be
evaluated using more criteria than just "Codd says don't use them!".
Thomas|||> Remember, that the original poster asked what *potential* downsides are
> there to an identity. They do exist. As with all design decisions, their
> use must be evaluated using more criteria than just "Codd says don't use
> them!".
True enough, I was just opining back because I just felt the rush of the
"don't let the db server do anything" mentality that seems to be so popular
these days (and often ruining good data everywhere when not done by
extremely professional people, due to the multitude of tools that let you
subtrovert the rules of the database if they are not implemented for every
modification, not just those going through an exterior layer.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Thomas Coleman" <thomas@.newsgroup.nospam> wrote in message
news:%23Hp5tDnYFHA.3272@.TK2MSFTNGP14.phx.gbl...
> Granted. Didn't say it wasn't possible; just more of a pain. It's more of
> a pain with the parent-child scenario like a invoice and invoice items.
> You have to save the invoice, retrieve the new key and then save the
> invoice items. Not a big deal and I have used stored procs to solve this
> problem easily. Just more of a pain.
> <snip>
> It isn't *so* hard per se. Just more of a pain. Like I said, if you have a
> long inheritance chain (parent-child-child...), it makes it more of a
> pain. Not impossible to overcome. Just more problematic.
>
> <snip>
> Exactly. The identity value in and of itself cannot be shared to a third
> party. Another unique key must be derived that is given to the third party
> (as you said) that contains check digits and such. I have used this exact
> schema in situations where a bar code with a check digit was necessary. A
> new key was derived *once it was realized* that it would be needed. The
> bar coded value was merely one more way to identify the entity.
> <snip>
>
> Agreed or that the exact make up the unique key is not known at initial
> design. The lesson here is to strive to be the most restrictive in your
> design. Try to apply unique indexes initially. Try to make columns
> non-nullable. Add check constraints etc. By abstracting the key away from
> the data, you make it possible to remove these restrictions later or even
> add new ones.
> Remember, that the original poster asked what *potential* downsides are
> there to an identity. They do exist. As with all design decisions, their
> use must be evaluated using more criteria than just "Codd says don't use
> them!".
>
> Thomas
>|||Michael,
First, I can think of three good uses for IDENTITY columns:
1) Provide a search key for full-text search
2) Small applications that very well could be done in Access
3) Non "database" usage -- logging tables, error tables, etc.
The single largest reason not to use an IDENTITY, GUID, or any other
meaningless key is that they become POINTERs to data. There are inherent
problems with pointer-based data models that the relational data model set
out to solve. If you ever research implementation of Heirarchical (IMS) or
Network (CODASYL) models (which both are pointer-based), you'll see why this
is so problematic.
The whole point of the relational model is that data inherently relate to
eachother and need no pointers to tie them together. When you have
Order_Nums, Part_Nums, Codes, etc, you don't need a pointer -- you already
have something that uniquely identifies the entity.
Just like any improvement in technology, you can choose to ignore it and go
with how they used to do it. They built houses just fine in the 40's with
knob & tube wiring, and if you built a house today with it, I'm sure it woul
d
work ok. But professionals build houses with Romex and grounding because
those improvements solved a helluva lot of problems that N&T have. Your new
N&T house would probably start to have issues if you try to draw too many
amps and will become a safety hazard after a few decades.
As such, if you choose to go with pointer-based data model, it will face the
same problems that other pointer-based models have. And it will fall apart.
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Michael C" wrote:

> I was working on a program recently that had a bit field called 'completed
'
> which recorded when a certain event was complete. I was removing this fiel
d
> because it was possible to tell that the event was complete through other
> means so the field was a duplication and a violation of good data design.
> The end result was that it was possible for something in the program to sh
ow
> as completed when in fact it wasn't. I thought this was a really good
> example of how bad data design effects the end user.
> When using Identity columns as the primary key some here think it is bad
> design but I've never seen anyone quote an actual divantage for the end
> user, all the "divantages" seem to be quite abstract and far removed fr
om
> the real world. In fact all I can see is advantages for the end user. Can
> anyone come up with an actual real word divantage for an identity colum
n
> pk?
>
>|||> [...] Just more of a pain.

> It isn't *so* hard per se. Just more of a pain. Like I said, if you have a
long
> inheritance chain (parent-child-child...), it makes it more of a pain.
The right way is usually the harder way. I have yet to find anything where
this is not true -- shortcuts create problems in everything.
I don't quite understand the lazy programmer. I can understand a lazy
carpenter -- lifting wood, sawing, etc is, quite literally, hard work. But
with a programmer, we're talking keystrokes and a few mouse clicks. What
exactly are we avoiding here?
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis

Friday, March 9, 2012

Problems with Enterprise manager

Hallo,
I had SQL Server 2000 SP3 personal edition and its Enterprise manager
stopped working. When I'm trying to run Enterprise manager, I get error
"Microsoft Management Console has encountered a problem and needs to close.
We are sorry for the inconvenience." (More information about this error in
the end of this letter)
I tried to reinstall SQL server, but this didn't help.
Do you know what is the problem?
Thank you for your help
Vycka
========================
Information about error:
AppName: mmc.exe AppVer: 5.1.2600.2180 ModName: mmc.exe
ModVer: 5.1.2600.2180 Offset: 0001f07e
I get the same problem. Please let me know if you know a solution.
Thanks.
"Vycka" wrote:

> Hallo,
> I had SQL Server 2000 SP3 personal edition and its Enterprise manager
> stopped working. When I'm trying to run Enterprise manager, I get error
> "Microsoft Management Console has encountered a problem and needs to close.
> We are sorry for the inconvenience." (More information about this error in
> the end of this letter)
> I tried to reinstall SQL server, but this didn't help.
> Do you know what is the problem?
> Thank you for your help
> Vycka
> ========================
> Information about error:
> AppName: mmc.exe AppVer: 5.1.2600.2180 ModName: mmc.exe
> ModVer: 5.1.2600.2180 Offset: 0001f07e
>
>
|||Did anyone find a solution to this problem. I just started getting the
same error today. I'm only running the client tools on my machine.
Other MMC consoles(analysis services, query analyzer) work fine.
Thanks!
|||I have recently encountered this same error and I was able to fix it. It
happens to be an error with the MMC application data file for enterprise
manager in your user profile.
From windows explorer, browse to the "MMC" folder under C:\Documents and
Settings\[user_profile]\Applicaiton Data\Microsoft\ (This is a hidden folder
and to be able to view it you must show hidden files and folders in the
"Tools" --> "Folder Options" --> "View" settings). There should be a file
named "SQL Server Enterprise Manager". You can either delete or rename this
file (I prefer the latter). MMC will re-create this file the next time you
access Enterprise Manager and should then be working properly.

Problems with DTS package

I am working on sql server 2000.

here is my question.

How can I update a table from the data in a text file.

I created a DTS package to do this job. I am able to insert the data from text file to a table perfectly. But What I want is to update the existing row instead of inserting a new row.

Here is sample data:

text file:

col1 col2

1 A

2 B

data in the table:

Col1 Col2

1 C

2 B

Now I want to update the first row for which the col2 is not matching. How can i do this. I wrote a activex script (for transformation) to update but it alwasy trys to insert rather than update, Here is the script.

Function Main()
if DTSDestination("Col1") = DTSSource("Col001") and DTSDestination("Col002") <> DTSSource("Col002") then
update DTSDestination
set DTSDestination("Col002") = DTSSource("Col002")
end if
Main = DTSTransformStat_OK
End Function

Thanks in advance

The script code that you posted should actually error out. It contains VB code with TSQL code. In any case, it looks like you should use a staging table approach and simply insert all the rows into server first & then use DMLs. This is the most efficient way. If you do it from the DTS package you are doing row-by-row processing and performance will suffer. Below are steps

1. Create staging table on server that contains same structure as destination table

2. Create a SP that does the following:

begin

update your_table

set Col2 = s.Col2, Col3 = s.Col3, ...

from staging_table as s

where s.Col1 = your_table.Col1

insert into your_table (Col1, Col2, Col3, ....)

select s.Col1, s.Col2, s.Col3, ...

from staging_table as s

where not exists(

select * from your_table as t

where t.key_col1 = s.key_col1

and ....

)

truncate staging_table

end

Now, modify your DTS package to do the following:

1. Bulk insert into the staging table

2. Call SP to update data from staging to main table

|||Thanks a lot for your advice

Wednesday, March 7, 2012

Problems with date

Hi, my name is MANUEL. I don't speak english very well...
Today I am working with SQLServer. I would want to compare two dateTime fields for to determine if two or more customers are connected in the same moment into my applications...
For example:
Begin date of connections:
16/01/2007 16.19.59
end date of connection
16/01/2007 16.25.23 for customers 01

Begin date of connections:
16/01/2007 16.20.59
end date of connection
16/01/2007 16.24.23 for customers 02

What i have to do!!!!
I must make this control to every hour of the day
Please Help!

Hi Manuel,

If I understand you question, you are looking to write a query that shows overlapping sessions.

If you start with a list of all the distinct start times, you can then use a correlated query to look for overlapping sessions (something like):

Code Snippet

select s1.app, st, (
select count(*)
from Sessions as s2
where
s1.app = s2.app

and s1.st >= s2.StartDateTime
and s1.st < s2.StopDateTime ) as Overlaps
from (
select distinct app, StartDateTime st
from Sessions
) as s1

Note that set based solutions around this type of problem can become really slow, really quickly! A cursor based solution can scale much better. You'd have to do some testing to see which would work best for you.

Hope that helps.

Jamie

|||

Here is a query that will retrieve all the connections that are overlapping.

Code Snippet

Select Conn1.Customer, Conn1.BeginDate, Conn1.EndDate,

Conn2.Customer, Conn2.BeginDate, Conn2.EndDate, *

From Connections Conn1, Connections Conn2

Where Conn2.BeginDate Between Conn1.BeginDate And Conn1.EndDate

And Conn1.ID <> Conn2.ID

I'm assuming the table name is called 'Connections' and that there is a primary key which is called ID. Here I've joined the table on itself looking for connections that have their start time between another connection's start and end time. I added 'Conn1.ID <> Conn2.ID' so that the query does not assume that the same connection is as an overlapping one.

I hope this answers your question.

Best regards,

Sami Samir

|||

This query might help you...

Code Snippet

Select
MainThread.CustomerId Customer
,MainThread.Startdate Customer1StartAt
,MainThread.Enddate Customer2EndAt
,ParlelThread.CustomerId ParllelWith
,ParlelThread.Startdate ParllelCustomerJoinAt
,ParlelThread.Enddate ParllelCustomerLeaveAt
,DateDiff(Mi, ParlelThread.Startdate, Case When MainThread.Enddate < ParlelThread.Enddate Then MainThread.Enddate Else ParlelThread.Enddate End ) TotalMinutesParllel
from AuditLog MainThread
Join AuditLog ParlelThread On
MainThread.Enddate > ParlelThread.Startdate And
MainThread.Startdate <= ParlelThread.Startdate
And MainThread.CustomerId <> ParlelThread.CustomerId
Order By 1

|||Sorry!I don't know SQL SERVER too

I have only one table which contains:
IDCustomers
Name
BeginDate
EndDate

My really problem is to abtain the list of cutomers whitch day,mount, years is the same and

have the same hour of logon.

I ask for new excuse for my English


|||

Try this :

Substitute your actual table name in <YourTable>

select BeginDate,IDCustomers,Name,EndDate

from <YourTable>

where BeginDate in

(

select BeginDate

from <YourTable>

group by BeginDate

having count(*) > 1

)

order by BeginDate,IDCustomers

Thanks.

Naras.

|||

The following query may help you...


Code Snippet

Select
MainThread.CustomerId Customer
,MainThread.Startdate Customer1StartAt
,MainThread.Enddate Customer2EndAt
,ParlelThread.CustomerId ParllelWith
,ParlelThread.Startdate ParllelCustomerJoinAt
,ParlelThread.Enddate ParllelCustomerLeaveAt
Into #Data
from <YourTable> MainThread
Join <YourTable>ParlelThread On
MainThread.Enddate > ParlelThread.Startdate And
MainThread.Startdate <= ParlelThread.Startdate
And MainThread.CustomerId <> ParlelThread.CustomerId
Order By 1

Select Customer, Customer1StartAt, Customer2EndAt From #Data
Union
Select ParllelWith, ParllelCustomerJoinAt, ParllelCustomerLeaveAt From #Data

Drop Table #Data

|||thanks to all… I have resolved the problem with one function.
you have been fast and kind
BYE

Problems with Custom Delivery Extension

I am working on putting together a custom delivery extension (fax delivery)
based on the built-in File Share delivery extension.
Most of the functionality I need already exists in the File Share delivery
extension so I used the Lutz Roeder's .NET Reflector to disassemble the
ReportingServicesFileShareDeliveryProvider.dll and then built my own assembly
which essentially mimics the ReportingServicesFileShareDeliveryProvider.dll.
I changed two class names, the FileShareProvider and FileShareUIControl
classes are known in my assembly as FaxProvider and FaxUIControl.
Once I had all the functionality of the
ReportingServicesFileShareDeliveryProvider.dll (I have only changed the two
class names and replaced references to them with the new names) I attempted
to deploy my assembly as a custom delivery extension so that I can test that
I have attained the same functionality as the
ReportingServicesFileShareDeliveryProvider.dll. This is where I run into
problems.
I see the following in my log files for RS:
aspnet_wp!extensionfactory!15ec!08/17/2005-14:45:59:: e ERROR: Exception
caught instantiating report server extension:
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. --> System.TypeInitializationException: The type
initializer for "FaxDeliveryProvider.FaxProvider" threw an exception. -->
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at FaxDeliveryProvider.FaxProvider..cctor()
The state of the failed permission was:
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"/>
-- End of inner exception stack trace --
-- End of inner exception stack trace --
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String extensionName, String extensionType).
I have been doing some research and I know that the built in delivery file
share delivery extension usese strong name security instead of URLMembership
security...but I am not sure what I need to do or what changes I need to
make to my config files to get around this. ANY HELP would be much
appreciated...
The following are the changes to the configuration files I made during
deployment:
RSReportServer.config
Added:
<Extension Name="Report Server Fax Delivery Extension"
Type="FaxDeliveryProvider.FaxProvider,FaxDeliveryProvider">
<MaxRetries>0</MaxRetries>
<SecondsBeforeRetry>900</SecondsBeforeRetry>
<Configuration>
<FileShareConfiguration>
<ExcludedRenderFormats>
<RenderingExtension>HTMLOWC</RenderingExtension>
<RenderingExtension>NULL</RenderingExtension>
</ExcludedRenderFormats>
</FileShareConfiguration>
</Configuration>
</Extension>
rssrvpolicy.config
Added:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="FaxDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\FaxDeliveryProvider.dll"
/>
</CodeGroup>
RSWebApplication.confg
Added to the DeliveryUI element:
<Extension Name="Report Server Fax Delivery Extension"
Type="FaxDeliveryProvider.FaxUIControl,FaxDeliveryProvider">
<Configuration>
<FileShare>
<DefaultRenderingExtension>MHTML</DefaultRenderingExtension>
</FileShare>
</Configuration>
</Extension>
rsmgrpolicy.config
added:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="FaxDeliveryCodeGroup"
Description="Code group for my delivery extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportManager\bin\FaxDeliveryProvider.dll"
/>
</CodeGroup>Anyone?
"Nick @. INDATA" wrote:
> I am working on putting together a custom delivery extension (fax delivery)
> based on the built-in File Share delivery extension.
> Most of the functionality I need already exists in the File Share delivery
> extension so I used the Lutz Roeder's .NET Reflector to disassemble the
> ReportingServicesFileShareDeliveryProvider.dll and then built my own assembly
> which essentially mimics the ReportingServicesFileShareDeliveryProvider.dll.
> I changed two class names, the FileShareProvider and FileShareUIControl
> classes are known in my assembly as FaxProvider and FaxUIControl.
> Once I had all the functionality of the
> ReportingServicesFileShareDeliveryProvider.dll (I have only changed the two
> class names and replaced references to them with the new names) I attempted
> to deploy my assembly as a custom delivery extension so that I can test that
> I have attained the same functionality as the
> ReportingServicesFileShareDeliveryProvider.dll. This is where I run into
> problems.
> I see the following in my log files for RS:
> aspnet_wp!extensionfactory!15ec!08/17/2005-14:45:59:: e ERROR: Exception
> caught instantiating report server extension:
> System.Reflection.TargetInvocationException: Exception has been thrown by the
> target of an invocation. --> System.TypeInitializationException: The type
> initializer for "FaxDeliveryProvider.FaxProvider" threw an exception. -->
> System.Security.SecurityException: Request for the permission of type
> System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> at FaxDeliveryProvider.FaxProvider..cctor()
> The state of the failed permission was:
> <IPermission
> class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
> version="1"
> PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"/>
> -- End of inner exception stack trace --
> -- End of inner exception stack trace --
> at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
> at System.Activator.CreateInstance(Type type, Boolean nonPublic)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
> binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
> at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
> Binder binder, Object[] args, CultureInfo culture, Object[]
> activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
> ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
> CultureInfo culture, Object[] activationAttributes)
> at System.Reflection.Assembly.CreateInstance(String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.AssertAndCreate(Assembly assembly, String typeName)
> at
> Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.GetNewExtensionInstance(String extensionName, String extensionType).
> I have been doing some research and I know that the built in delivery file
> share delivery extension usese strong name security instead of URLMembership
> security...but I am not sure what I need to do or what changes I need to
> make to my config files to get around this. ANY HELP would be much
> appreciated...
> The following are the changes to the configuration files I made during
> deployment:
> RSReportServer.config
> Added:
> <Extension Name="Report Server Fax Delivery Extension"
> Type="FaxDeliveryProvider.FaxProvider,FaxDeliveryProvider">
> <MaxRetries>0</MaxRetries>
> <SecondsBeforeRetry>900</SecondsBeforeRetry>
> <Configuration>
> <FileShareConfiguration>
> <ExcludedRenderFormats>
> <RenderingExtension>HTMLOWC</RenderingExtension>
> <RenderingExtension>NULL</RenderingExtension>
> </ExcludedRenderFormats>
> </FileShareConfiguration>
> </Configuration>
> </Extension>
>
> rssrvpolicy.config
> Added:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="FaxDeliveryCodeGroup"
> Description="Code group for my delivery extension">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\bin\FaxDeliveryProvider.dll"
> />
> </CodeGroup>
> RSWebApplication.confg
> Added to the DeliveryUI element:
> <Extension Name="Report Server Fax Delivery Extension"
> Type="FaxDeliveryProvider.FaxUIControl,FaxDeliveryProvider">
> <Configuration>
> <FileShare>
> <DefaultRenderingExtension>MHTML</DefaultRenderingExtension>
> </FileShare>
> </Configuration>
> </Extension>
> rsmgrpolicy.config
> added:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="FaxDeliveryCodeGroup"
> Description="Code group for my delivery extension">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportManager\bin\FaxDeliveryProvider.dll"
> />
> </CodeGroup>
>