Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Friday, March 23, 2012

Have Stored Procedure with input parameters and want to Use Spreadsheet

I have a stored procedure that is able to ultimately do an create a temp table and insert into another table. I'm trying to figure out how I could execute the stored procedure that would get it's input parameters from a spreadsheet rather than execute it line by line. Can anyone suggest anything?

CREATE PROCEDURE osp_xmlSvc_UpdateItemAttribute

@.PartNumber varchar(50) = '',

@.Rev varchar(50) = '',

@.AttributeName varchar(256) = '',

@.AttributeValue varchar(1024) = '',

@.EditSource varchar(255) = '',

@.UserName varchar(50) = 'admin',

@.ReturnState int = 0 Output

WITH ENCRYPTION

AS

DECLARE @.ItemID int

DECLARE @.RevID int

DECLARE @.AssignAllRevs int

DECLARE @.ParamIndexID int

DECLARE @.CurrentValue varchar(1024)

DECLARE @.UserID int

SET @.ReturnState = -1

SET @.ItemID = -1

SET @.RevID = -1

SET @.ParamIndexID = -1

SET @.CurrentValue = ''

SET @.AssignAllRevs = 0

SELECT @.UserID = ID FROM UserProfile WHERE UserName = @.UserName

SELECT @.ItemID = ID FROM Entry WHERE PartNumber = @.PartNumber

if(NOT(@.ItemID = -1) AND @.ItemID IS NOT NULL) begin

SELECT @.RevID = ID FROM Rev WHERE ItemID = @.ItemID AND Rev=@.Rev

if(@.RevID = -1 OR @.RevID IS NULL) begin

SET @.AssignAllRevs = 1

SELECT @.RevID = ID FROM Rev WHERE ItemID = @.ItemID AND Expired=0

end

SELECT @.ParamIndexID = ID FROM ParamIndex WHERE [Name]=@.AttributeName

if(NOT(@.ParamIndexID = -1) AND @.ParamIndexID IS NOT NULL) begin

SET @.ReturnState = 0

CREATE TABLE tmp_xml_AV (AttVal varchar(1024))

DECLARE @.tmpSQL nvarchar(2024)

SET @.tmpSQL = 'INSERT INTO tmp_xml_AV (AttVal) SELECT [' + @.AttributeName + '] FROM ParamValue WHERE Expired=0 AND ItemID=' + CAST(@.ItemID AS VARCHAR)+ ' AND RevID=' + CAST(@.RevID AS VARCHAR)

EXECUTE sp_executesql @.tmpSQL

SELECT @.CurrentValue = IsNull(AttVal, '') FROM tmp_xml_AV

DROP TABLE tmp_xml_AV

if(NOT(@.CurrentValue = @.AttributeValue) OR @.CurrentValue IS NULL) begin

SET @.ReturnState = 1

SET @.tmpSQL = 'UPDATE ParamValue SET [' + @.AttributeName + ']=''' + @.AttributeValue + ''' WHERE ItemID=' + CAST(@.ItemID AS VARCHAR)

if(@.AssignAllRevs = 0) begin

SET @.tmpSQL = @.tmpSQL + ' AND RevID=' + CAST(@.RevID AS VARCHAR)

end

EXECUTE sp_executesql @.tmpSQL

-- Record history

DECLARE @.tmpInt int

SELECT @.tmpInt = Max(ID)+1 FROM EntryChangeAction

INSERT INTO EntryChangeAction (ID,EntryAffected,RevID,ActionType,Details,Tool,UserID)

VALUES (@.tmpInt,@.ItemID,@.RevID,6,@.AttributeName + ': ' + @.CurrentValue + ' to: ' + @.AttributeValue,@.EditSource,@.UserID)

end

end

end

GRANT EXECUTE ON [dbo].[osp_xmlSvc_UpdateItemAttribute] TO [public]

GO

Thanks.

Amy

In the stored procedure, you could open and read the xls file and put the values into variables. (An xml file would be simpler -Excel could save the file as xml.)

Check in Books Online about [OpenXML].

Have a bet .... curious on input :)

So I have a person who is adamant in tell me that SQL Server does not run on windows XP.

Now, I have already done all the research on this (i.e. sql server 2000 product page / requirements) and know the answer, but they insist on asking the question, so here it is .....

'Will SQL Server run on Windows XP'

A simple YES or NO will suffice; however, if you want to explain the answer (if it requires one ;) ), please feel free.

YES and NO . Depends on what version of SQL Server you want to install. MSDE/SQL Server Express work. Also is the Developer Edition of SQL Server. But with the Enterprise Edition I think you're out of luck... it won't install.|||

Mike's right... it's a little trickier than Yes/No. :)

Here is the SQL Server 2005 Enterprise Edition page:

http://www.microsoft.com/sql/editions/enterprise/sysreqs.mspx

You can see that XP is not supported for the Enterprise SKU, but it is supported for the Standard SKU (as with Workgroup and Express SKU's). The standard SKU page is found here if you need proof for your bet. :)

http://www.microsoft.com/sql/editions/standard/sysreqs.mspx

Thanks,
Sam Lester (MSFT)

|||

i'm well aware of this as its covered in the product information page.

However, this person claims that 'SQL Server' automatically states you are talking about the Enterprise / Standard Editions wihch do not run on XP. My point is that 'SQL Server' without stating which edition is vague and the statement SQL Server WILL NOT run on XP is invalid because SQL Server is not a product but a product family. If one is talking about SQL Server without specifying, it would be talking about hte family of products.

If the question were ' Does SQL Server - Enterprise Edition run on XP', I would agree the answer is no. I would also agree 'Does SQL Server Developer run on XP, I would agree that answer is yes. However, if the ONLY question posed is 'Does SQL Server on XP', I would argue the answer is yes (with the above clarification attached to that. The statement 'SQL Server 2000 does NOT run on XP' would be false for the reason that SQL Server (without specificying which edition) is a general statement about the product family and that is incorrect as parts of the family DO run on XP.

I apologize for the splitting of hairs, but I was just curious on other people's take on this one.

Friday, March 9, 2012

Hardware for SQL

Not really a SQL question, but wondering if anyone has any input on HP vs.
Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge 6800.
We are historically a pure HP shop, but Dell's making a very good case
financially. Any thoughts on Dell's reliability and service?Hi
I used servers from both suppliers and they are pretty much equal IMO.
John
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?|||I IT manage one company of all HP equipment (4 servers) and one company of
all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
Tech support for Dell (which is rare), I get people that react quickly. If
the warranty is 4 hours, the guy is here in 4 hours or less (never over). I
also find getting new drivers and updates far easier at Dell.
--
Thanks,
TheBurgerMan
at
gmail.com
--
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?|||Thanks for your input!
"TheBurgerMan" wrote:

> I IT manage one company of all HP equipment (4 servers) and one company of
> all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
> tech support for Dell (which is rare), I get people that react quickly. I
f
> the warranty is 4 hours, the guy is here in 4 hours or less (never over).
I
> also find getting new drivers and updates far easier at Dell.
> --
> Thanks,
> TheBurgerMan
> at
> gmail.com
> --
> "LSI" <LSI@.discussions.microsoft.com> wrote in message
> news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
>
>

Hardware for SQL

Not really a SQL question, but wondering if anyone has any input on HP vs.
Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge 6800.
We are historically a pure HP shop, but Dell's making a very good case
financially. Any thoughts on Dell's reliability and service?
Hi
I used servers from both suppliers and they are pretty much equal IMO.
John
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?
|||I IT manage one company of all HP equipment (4 servers) and one company of
all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
Tech support for Dell (which is rare), I get people that react quickly. If
the warranty is 4 hours, the guy is here in 4 hours or less (never over). I
also find getting new drivers and updates far easier at Dell.
Thanks,
TheBurgerMan
at
gmail.com
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?
|||Thanks for your input!
"TheBurgerMan" wrote:

> I IT manage one company of all HP equipment (4 servers) and one company of
> all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
> Tech support for Dell (which is rare), I get people that react quickly. If
> the warranty is 4 hours, the guy is here in 4 hours or less (never over). I
> also find getting new drivers and updates far easier at Dell.
> --
> Thanks,
> TheBurgerMan
> at
> gmail.com
> --
> "LSI" <LSI@.discussions.microsoft.com> wrote in message
> news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
>
>

Hardware for SQL

Not really a SQL question, but wondering if anyone has any input on HP vs.
Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge 6800.
We are historically a pure HP shop, but Dell's making a very good case
financially. Any thoughts on Dell's reliability and service?Hi
I used servers from both suppliers and they are pretty much equal IMO.
John
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?|||I IT manage one company of all HP equipment (4 servers) and one company of
all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
Tech support for Dell (which is rare), I get people that react quickly. If
the warranty is 4 hours, the guy is here in 4 hours or less (never over). I
also find getting new drivers and updates far easier at Dell.
--
Thanks,
TheBurgerMan
at
gmail.com
--
"LSI" <LSI@.discussions.microsoft.com> wrote in message
news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> Not really a SQL question, but wondering if anyone has any input on HP vs.
> Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> 6800.
> We are historically a pure HP shop, but Dell's making a very good case
> financially. Any thoughts on Dell's reliability and service?|||Thanks for your input!
"TheBurgerMan" wrote:
> I IT manage one company of all HP equipment (4 servers) and one company of
> all Dell (20+ servers) and I prefer the Dell. For one thing, when I call
> Tech support for Dell (which is rare), I get people that react quickly. If
> the warranty is 4 hours, the guy is here in 4 hours or less (never over). I
> also find getting new drivers and updates far easier at Dell.
> --
> Thanks,
> TheBurgerMan
> at
> gmail.com
> --
> "LSI" <LSI@.discussions.microsoft.com> wrote in message
> news:E4BE6240-C988-4493-86A0-EF7BC27FF821@.microsoft.com...
> > Not really a SQL question, but wondering if anyone has any input on HP vs.
> > Dell. Specifically, we're comparing the HP ML570G3 to Dell's PowerEdge
> > 6800.
> > We are historically a pure HP shop, but Dell's making a very good case
> > financially. Any thoughts on Dell's reliability and service?
>
>

hardcoding password instead of showing password box everytime

Dear all
Everytime, when my aspx application connect with the reports, it will also
show the password box for the input of username and password, however, can we
avoid it to show the password box? I want to implicity hardcoding the
username and password into the aspx and i don't want to show the password box
in the IEYou can use stored credentials for the data sources. In report manager, go
to the properties page of the report, click on the data sources tab and
specify a user name / pwd and click apply to store these credentials.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:81E41716-A88F-4C3B-B785-6012F6767E9D@.microsoft.com...
> Dear all
> Everytime, when my aspx application connect with the reports, it will also
> show the password box for the input of username and password, however, can
> we
> avoid it to show the password box? I want to implicity hardcoding the
> username and password into the aspx and i don't want to show the password
> box
> in the IE
>|||No the password prompt is from I.E. it ask from the domain user password to
see whether it have the right to see the reports or not, not the data sources
password
"Robert Bruckner [MSFT]" wrote:
> You can use stored credentials for the data sources. In report manager, go
> to the properties page of the report, click on the data sources tab and
> specify a user name / pwd and click apply to store these credentials.
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Joe" <Joe@.discussions.microsoft.com> wrote in message
> news:81E41716-A88F-4C3B-B785-6012F6767E9D@.microsoft.com...
> > Dear all
> > Everytime, when my aspx application connect with the reports, it will also
> > show the password box for the input of username and password, however, can
> > we
> > avoid it to show the password box? I want to implicity hardcoding the
> > username and password into the aspx and i don't want to show the password
> > box
> > in the IE
> >
>
>