Friday, March 30, 2012
How to simulate an array in SQL Server
items in an 'array' by declaring a local variable as table
----
declare @.MyTable table (MyRowID int identity, MyData varchar(255))
declare @.MyCurrentRow as int
declare @.MyRowCount as int
insert into @.MyTable select Name from sysobjects -- (or whatever)
set @.MyRowCount = @.@.RowCount
-- @.@.Rowcount hold the count of the last table in these cases anyway
-- then you can use statement to access the nth. row in the 'array'
select MyData from @.MyTable where MyRowID = 5 -- as an example
--
-- or step through the table using @.MyCurrentRow
Set @.MyCurrentRow = 1
while @.MyCurrentRow < @.MyRowCount +1
Begin
Select MyData from @.MyTable where MyRowID = @.MyCurrentRow
set @.MyCurrentRow = @.MyCurrentRow + 1
Continue
end
Just thought it might help. It isn't rocket science but I saw a few
with problems so thought I'd post.
I needed it to obtain individual values from a table and use those
values to call a stored procedure repeatedly.
CheersSee if these help:
http://www.aspfaq.com/show.asp?id=2248 Arrays & Lists
http://www.sommarskog.se/dynamic_sql.html Dynamic SQL
http://www.users.drew.edu/skass/sql...bleProc.sql.txt List to
Table script
Andrew J. Kelly SQL MVP
<mal_k100@.hotmail.com> wrote in message
news:1125573743.271138.167070@.o13g2000cwo.googlegroups.com...
> Just thought some might be interested in how to identify individual
> items in an 'array' by declaring a local variable as table
> ----
> declare @.MyTable table (MyRowID int identity, MyData varchar(255))
> declare @.MyCurrentRow as int
> declare @.MyRowCount as int
> insert into @.MyTable select Name from sysobjects -- (or whatever)
> set @.MyRowCount = @.@.RowCount
> -- @.@.Rowcount hold the count of the last table in these cases anyway
> -- then you can use statement to access the nth. row in the 'array'
> select MyData from @.MyTable where MyRowID = 5 -- as an example
> --
> -- or step through the table using @.MyCurrentRow
> Set @.MyCurrentRow = 1
> while @.MyCurrentRow < @.MyRowCount +1
> Begin
> Select MyData from @.MyTable where MyRowID = @.MyCurrentRow
> set @.MyCurrentRow = @.MyCurrentRow + 1
> Continue
> end
> Just thought it might help. It isn't rocket science but I saw a few
> with problems so thought I'd post.
> I needed it to obtain individual values from a table and use those
> values to call a stored procedure repeatedly.
> Cheers
>sql
Friday, March 23, 2012
how to setup local SQL Server 2005 DB
I installed 2005 Developer edition on a local workstation in our lab. I can connect to a network SQL Server with it just fine. But I do not have a local instance of SQL Server on this workstation.
How do I create a local instance of SQL Server? (box is WinXPPro-SP3)
After accepting the defaults for this installation, I noticed that there were no "local" instances of SQL server available, whereby I could go out and create my own test databases locally or copy a few tables from a production server over to my local box for testing. I'm looking through the books online and do not see (maybe I missed it) the steps to creating a local instance for setting up a workstaiton as a 'test' environment.
Assistance is appreciated.
RLN
Bummer to find that no one responded to this problem because its the same exact problem I'm having except that I have Standard edition installed on XPPro SP2
Anyone have any ideas on how I can set this up?
Thanks
|||Hi,
i do not understand what you are try to achieve here!!!
Local Instance of SQL Server !? you may try installing SQL 2005 Developer Edition / SQL 2005 Express Edition on your Workstation and then you may restore backup of your production database or you may detach db on prod server copy .mdf and .ldf files to your workstation and attach it on your work station to work as local/test environment and attach your prod db again so that prod server is also up for use.
is this you are looking for!?
Hemantgiri S. Goswami
|||
I'm in the same situation.
In S2K you could only do this with personal edition so I guess it could be the same here....Express edition maybe?
But if there's any help out there I too would welcome any advice.
Thanks,
Eamon
Ireland
how to setup local SQL Server 2005 DB
I installed 2005 Developer edition on a local workstation in our lab. I can connect to a network SQL Server with it just fine. But I do not have a local instance of SQL Server on this workstation.
How do I create a local instance of SQL Server? (box is WinXPPro-SP3)
After accepting the defaults for this installation, I noticed that there were no "local" instances of SQL server available, whereby I could go out and create my own test databases locally or copy a few tables from a production server over to my local box for testing. I'm looking through the books online and do not see (maybe I missed it) the steps to creating a local instance for setting up a workstaiton as a 'test' environment.
Assistance is appreciated.
RLN
Bummer to find that no one responded to this problem because its the same exact problem I'm having except that I have Standard edition installed on XPPro SP2
Anyone have any ideas on how I can set this up?
Thanks
|||Hi,
i do not understand what you are try to achieve here!!!
Local Instance of SQL Server !? you may try installing SQL 2005 Developer Edition / SQL 2005 Express Edition on your Workstation and then you may restore backup of your production database or you may detach db on prod server copy .mdf and .ldf files to your workstation and attach it on your work station to work as local/test environment and attach your prod db again so that prod server is also up for use.
is this you are looking for!?
Hemantgiri S. Goswami
|||
I'm in the same situation.
In S2K you could only do this with personal edition so I guess it could be the same here....Express edition maybe?
But if there's any help out there I too would welcome any advice.
Thanks,
Eamon
Ireland
how to setup local SQL Server 2005 DB
I installed 2005 Developer edition on a local workstation in our lab. I can connect to a network SQL Server with it just fine. But I do not have a local instance of SQL Server on this workstation.
How do I create a local instance of SQL Server? (box is WinXPPro-SP3)
After accepting the defaults for this installation, I noticed that there were no "local" instances of SQL server available, whereby I could go out and create my own test databases locally or copy a few tables from a production server over to my local box for testing. I'm looking through the books online and do not see (maybe I missed it) the steps to creating a local instance for setting up a workstaiton as a 'test' environment.
Assistance is appreciated.
RLN
Bummer to find that no one responded to this problem because its the same exact problem I'm having except that I have Standard edition installed on XPPro SP2
Anyone have any ideas on how I can set this up?
Thanks
|||Hi,
i do not understand what you are try to achieve here!!!
Local Instance of SQL Server !? you may try installing SQL 2005 Developer Edition / SQL 2005 Express Edition on your Workstation and then you may restore backup of your production database or you may detach db on prod server copy .mdf and .ldf files to your workstation and attach it on your work station to work as local/test environment and attach your prod db again so that prod server is also up for use.
is this you are looking for!?
Hemantgiri S. Goswami
|||
I'm in the same situation.
In S2K you could only do this with personal edition so I guess it could be the same here....Express edition maybe?
But if there's any help out there I too would welcome any advice.
Thanks,
Eamon
Ireland
How to Setup Linked Server
Would you mind to tell me how can I setup the Link
between 2 SQL server that both server have located in
their local domain?
Thanks a lot!Probably easiest to use Enterprise Manager for this purpose. Expand your
server, expand "Security", click on "Linked Servers", and click the new
icon. You can set up the link from that menu fairly easily.
You can also set up linked servers using the sp_addlinkedserver and
sp_addlinkedsrvlogin stored procedures, which you can find syntax for in
BOL.
"Alan Tang" <alantang@.netband.com.hk> wrote in message
news:3b4501c488b1$f0f19690$a301280a@.phx.gbl...
> Hello:
> Would you mind to tell me how can I setup the Link
> between 2 SQL server that both server have located in
> their local domain?
> Thanks a lot!|||Hi,
Please see the below article.
http://www.microsoft.com/India/msdn/articles/166.aspx
Thanks
Hari
MCDBA
"Alan Tang" <alantang@.netband.com.hk> wrote in message
news:3b4501c488b1$f0f19690$a301280a@.phx.gbl...
> Hello:
> Would you mind to tell me how can I setup the Link
> between 2 SQL server that both server have located in
> their local domain?
> Thanks a lot!
Friday, March 9, 2012
How to set report server
I have a requirment here. I create a report that works fine in my local machine. But I want to keep this in a server so that every body can access it. How do I do that any clues please.How to set that what are steps to do that ?Did you install SQL Server Reporting Services? This is a server component of SQL Server that does exactly what you are asking. Are you using SQL Server 2005?|||yes I install reporting services and when I run the report it works fine but I am wondering is there any walkthrough to how to see thw report in web services.|||If you have installed Reporting Services on your server, then go to http://localhost/reports and you can upload the report (.RDL file). From there others can access the report and enter the required parameters to view the report.|||Hi,
I want to upload an rdl file programmatically. Is there anyone who can help me?
Thanks.|||You need to call the SOAP API CreateReport|||thanks but I have another question.
now I need to create subscription for a report. there is a method called createsubscription. but I don't know the values of parameters. in msdn documents, it says
extensionParams[0] = new ParameterValue();
extensionParams[0].Name = "ReplyTo";
extensionParams[0].Value = "reporting@.microsoft.com";
for example.
but how do we know that the name should be "ReplyTo". Are these names discribed somewhere? if so, where? if not, what should we write for each parameter.
I should prepare aspx pages as same as the reporting server web interface. but I do not have enough info.is there a web page that has detailed info other than msdn?
thanks for your help.
Wednesday, March 7, 2012
how to set multiple local variable from single select statement
statement. For example assume a simple table 'E' with 3 columns 'empID',
'empName', 'empToken'. I can get their values with
declare @.ENAME as char(30), @.ETOKEN as int
SET @.ENAME = (SELECT empName FROM E WHERE empID = 1)
SET @.ETOKEN = (SELECT empToken FROM E WHERE empID = 1)
What I want to do is compine the two assignments into 1 single statement so
that the db never has to be looked up more than once. e.g.
SET @.ENAME, @.ETOKEN = (SELECT empName, empToken FROM E WHERE empID = 1)
is this possible and if it is, what is the synthax?try this.. hope this helps.
SELECT @.ENAME = empName,
@.ETOKEN = empToken
FROM E WHERE empID = 1
--|||HI,
sure:
SELECT @.ENAME = empName , @.ETOKEN = emptoken FROM E WHERE empID = 1
HTH, jens Suessmeyer.
http://www.sqlserver2005.de
--