Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Monday, March 26, 2012

getting "Error 1314 from CreateProcessAsUser" when using xp_cmdshe

Hi All,
After setting the proxy account, I'm getting this error msg. I've read
articles to set the "Increase Quotas" setting but can't find it in the list.
We're running on Windows 2003. Also, if and when I do find it, what do I set
it to?
Thanks,
BN
Basically, SQL cannot spawn a new process using the existing credentials. OS
error 1314 translates to "A required privilege is not held by the client."
Make sure that the proxy and SQL start-up accounts have the "Act as part of
the operating system" privilege.
Adrian
"OutlookNewbieDev" <OutlookNewbieDev@.discussions.microsoft.com> wrote in
message news:E440EF6B-6080-4BAF-A2B5-1A56C6067A45@.microsoft.com...
> Hi All,
> After setting the proxy account, I'm getting this error msg. I've read
> articles to set the "Increase Quotas" setting but can't find it in the
> list.
> We're running on Windows 2003. Also, if and when I do find it, what do I
> set
> it to?
> Thanks,
> BN
>

Wednesday, March 21, 2012

getdata.xml vs getdata.asp

As I've started to use XML more extensively for data transfer to web
pages, I have started to use the XMLHttpRequest object to get data
from the server. Since I want the data to be returned as XML, I have
been playing around with http: requests to SQL Server. I have also
created ASP pages that return XML after using SQL Server to collect
data.
As far as I know, these two methods are approximately equivalent. ASP
clearly has some important advantages over SQL Http requests,
maintaining session information immediately comes to mind, but does
the convenience of ASP come at a high enough cost that I should
consider using SQL Http requests?
I should clarify the question: I'm your typical geek who loves to
learn and use new technology: I'm inclined to use SQL Http requests
simply because they are new and different and I like how they can help
delegate different logical tasks in my project. Am I wasting my
client's money and my own time looking to SQL Http requests for
performance improvements?
TIA for any light you can shed on this...
Chuck Jungmann
"Chuck Jungmann" <NOchuckSPAM@.cpjj.net> wrote in message
news:frepj0ddqr0m68kt7rak5og95lv4dfg3j6@.4ax.com...
[snip]
> Am I wasting my
> client's money and my own time looking to SQL Http requests for
> performance improvements?
As with all technology, most things are a compromise. SQLXML is no
exception. I would suggest looking at the pros and cons and then choosing
the method that best suits your needs.
SQLXML vs. ASP pros:
1) Less layers (possible speed increase)
2) Not scripted (possible speed increase)
3) SQL and XML knowledge only
SQLXML vs. ASP cons:
1) Less flexible.
2) Possibly more vunerable to attacks (less testing and real-world use than
ASP)
3) Upgrade path somewhat unclear at the moment (although it looks like 2005
will provide a good upgrade path to SQLXML HTTP).
I would also suggest doing some performance tests and reliability tests to
see how your two methods measure up. I don't think your testing is a waste
of time.
Bryant

Monday, March 12, 2012

Get the sa password possible?

Hello,
Is it possible to get or change the existing sa password for microsoft
sql server 2000 as i've forgotten it?
I'm able to use Enterprise Manager by via Windows Authentication, but
i need to connect to a database with SQL Authentication.
Thanks,
jack.
Hello,
YOu can not see the password, but you can change the password. All you have
to do is:-
1. Login into the query analyzer using windows authentication
2. Execute the below query to change the SA password
sp_password NULL,'Newpassword','sa'
This will change the password of SA to a new password. THis will work well
if you r windows user is part od Admin group.
Thanks
Hari
"Jack" <bradnerdhss@.hotmail.com> wrote in message
news:1171849045.996306.258230@.s48g2000cws.googlegr oups.com...
> Hello,
> Is it possible to get or change the existing sa password for microsoft
> sql server 2000 as i've forgotten it?
> I'm able to use Enterprise Manager by via Windows Authentication, but
> i need to connect to a database with SQL Authentication.
> Thanks,
> jack.
>
|||On Feb 19, 11:19 am, "Hari Prasad" <hari_prasa...@.hotmail.com> wrote:
> Hello,
> YOu can not see the password, but you can change the password. All you have
> to do is:-
> 1. Login into the query analyzer using windows authentication
> 2. Execute the below query to change the SA password
> sp_password NULL,'Newpassword','sa'
> This will change the password of SA to a new password. THis will work well
> if you r windows user is part od Admin group.
> Thanks
> Hari
> "Jack" <bradnerd...@.hotmail.com> wrote in message
> news:1171849045.996306.258230@.s48g2000cws.googlegr oups.com...
>
>
>
> - Show quoted text -
Yes thanks. That worked perfectly.
Jack.

Friday, February 24, 2012

Get PDF from SQL

Hi guys. I've seen a lot posted about this on various sites and can't come up with a working solution. I've got a PDF saved as a byte array in a SQL image field. I figured out how to save/load with images, and I'm pretty sure it's saving the PDF corectly, but I can't get it to load at all.

Here's what I've got:

byte[] image = (byte[])Com.ExecuteScalar();

stream.Write (image, 0, image.Length);

Response.ContentType = "application/pdf";

Response.OutputStream.Write(image,0,image.Length);

This returns a blank page with some spaces. Now that I think about it, maybe its not saving right then.. Any insight? It'd be greatly appreciated.

Try this:

byte[] image = (byte[])Com.ExecuteScalar();

Response.ClearContent();

Response.ClearHeaders();

Response.ContentType ="application/pdf";

Response.BinaryWrite(image);

Response.Flush();

Response.Close();

|||Hi, thanks. I still got a blank page though. Should that be working, in other words might it not be saving correctly? Is there any way to check? It saves images fine using the same method. Does anyone know any other methods off hand to display it? Thanks for your time.|||

Try saving your byte[] to disk and opening it in Acrobat to see if you are getting valid PDF data out. That code should work i took it straight out of a page that i use.

Martin

|||Make sure it's a separate page that dumps the PDF. If you are doing something silly like setting a session variable that tells a .ASPX page whether to dump the .PDF file, or display a form, you'll confuse the browser. The browser has a tendancy to remember the content type of a specific URL, if the URL remains the same, it expects the content type to remain the same as well.|||

Looks similar to mine:

Dim cmdAsNew SqlCommand("SELECT MimeType,Filename,Data FROM Attachments WHERE ID=@.ID", conn)

cmd.Parameters.Add(New SqlParameter("@.ID", SqlDbType.Int))

cmd.Parameters("@.ID").Value = Request.QueryString("ID")

' cmd.Parameters("@.ID").Value = 3

Dim drAs SqlDataReader

dr = cmd.ExecuteReader

dr.Read()

Response.Clear()

Response.AddHeader("Content-type", dr("MimeType"))

Response.AddHeader("Content-Disposition","inline; filename=""" & dr("Filename") &"""")

Dim buffer()AsByte = dr("Data")

Dim blenAsInteger =CType(dr("Data"),Byte()).Length

Response.OutputStream.Write(buffer, 0, blen)

Response.End()