Thursday, March 29, 2012
Getting a database on one server to match another
The second server is our disaster recovery server, so we
want our second server database to be as up to date as
possible with the production database.
ta
>--Original Message--
>Hello,
>We have two servers and want out production db on server
1
>to match the production server on server 2.
>Whats the best way of doing this?
>.
>Sarah,
Hari already answered this with:
1) Log Shipping
2) Transactional replication
If the disaster recovery server does not need to be operational, then log
shipping would be good.You may also want to consider Double-Take from NSI
Software. This replicates the SQL Server data files at the block level on
disk and ensures transactional consistency.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:4c5401c42c3a$23ff0f60$a001280a@.phx.gbl...[vbcol=seagreen]
> Sorry wasn't too clear was I.
> The second server is our disaster recovery server, so we
> want our second server database to be as up to date as
> possible with the production database.
> ta
>
> 1|||Thanks Mark,
I'll have a look at transactional replication as we backup
the Production db by log files and to be honest I'm not
too sure on what will happen if we change it so it updates
asap.
Thanks for your time
>--Original Message--
>Sarah,
>Hari already answered this with:
>1) Log Shipping
>2) Transactional replication
>If the disaster recovery server does not need to be
operational, then log
>shipping would be good.You may also want to consider
Double-Take from NSI
>Software. This replicates the SQL Server data files at
the block level on
>disk and ensures transactional consistency.
>--
>Mark Allison, SQL Server MVP
>http://www.markallison.co.uk
>
>
>"Sarah" <anonymous@.discussions.microsoft.com> wrote in
message
>news:4c5401c42c3a$23ff0f60$a001280a@.phx.gbl...
server[vbcol=seagreen]
>
>.
>|||There's a web site at MS called something like "Pattern and practices". Ther
e you find a two boos on SQL
Server and high availability. You really need to go through that if you inte
nd to use replication for fail
over. There are some issues you need to plan for.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message news:4ae801c42c41$337182f0$a4
01280a@.phx.gbl...[vbcol=seagreen]
> Thanks Mark,
> I'll have a look at transactional replication as we backup
> the Production db by log files and to be honest I'm not
> too sure on what will happen if we change it so it updates
> asap.
> Thanks for your time
>
>
> operational, then log
> Double-Take from NSI
> the block level on
> message
> server|||Sarah,
I really don't think transactional replication is a good high availability
solution. There are many drawbacks to using this. Do a search on the web for
high availability sql server and you should find some good information.
Kimberley Tripp did a great presentation on high availability, perhaps
search for that.
Log shipping might be a good way to go, you can have a latency of 5 minutes
with this solution.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:4ae801c42c41$337182f0$a401280a@.phx.gbl...[vbcol=seagreen]
> Thanks Mark,
> I'll have a look at transactional replication as we backup
> the Production db by log files and to be honest I'm not
> too sure on what will happen if we change it so it updates
> asap.
> Thanks for your time
>
>
> operational, then log
> Double-Take from NSI
> the block level on
> message
> server|||Thanks for your help guys
>--Original Message--
>Thanks Mark,
>I'll have a look at transactional replication as we
backup
>the Production db by log files and to be honest I'm not
>too sure on what will happen if we change it so it
updates
>asap.
>Thanks for your time
>
>
>operational, then log
>Double-Take from NSI
>the block level on
>message
we[vbcol=seagreen]
>server
>.
>
Tuesday, March 27, 2012
Getting a database on one server to match another
The second server is our disaster recovery server, so we
want our second server database to be as up to date as
possible with the production database.
ta
>--Original Message--
>Hello,
>We have two servers and want out production db on server
1
>to match the production server on server 2.
>Whats the best way of doing this?
>.
>
Sarah,
Hari already answered this with:
1) Log Shipping
2) Transactional replication
If the disaster recovery server does not need to be operational, then log
shipping would be good.You may also want to consider Double-Take from NSI
Software. This replicates the SQL Server data files at the block level on
disk and ensures transactional consistency.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:4c5401c42c3a$23ff0f60$a001280a@.phx.gbl...[vbcol=seagreen]
> Sorry wasn't too clear was I.
> The second server is our disaster recovery server, so we
> want our second server database to be as up to date as
> possible with the production database.
> ta
>
> 1
|||Thanks Mark,
I'll have a look at transactional replication as we backup
the Production db by log files and to be honest I'm not
too sure on what will happen if we change it so it updates
asap.
Thanks for your time
>--Original Message--
>Sarah,
>Hari already answered this with:
>1) Log Shipping
>2) Transactional replication
>If the disaster recovery server does not need to be
operational, then log
>shipping would be good.You may also want to consider
Double-Take from NSI
>Software. This replicates the SQL Server data files at
the block level on
>disk and ensures transactional consistency.
>--
>Mark Allison, SQL Server MVP
>http://www.markallison.co.uk
>
>
>"Sarah" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:4c5401c42c3a$23ff0f60$a001280a@.phx.gbl...
server
>
>.
>
|||There's a web site at MS called something like "Pattern and practices". There you find a two boos on SQL
Server and high availability. You really need to go through that if you intend to use replication for fail
over. There are some issues you need to plan for.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message news:4ae801c42c41$337182f0$a401280a@.phx.gbl...[vbcol=seagreen]
> Thanks Mark,
> I'll have a look at transactional replication as we backup
> the Production db by log files and to be honest I'm not
> too sure on what will happen if we change it so it updates
> asap.
> Thanks for your time
>
>
> operational, then log
> Double-Take from NSI
> the block level on
> message
> server
|||Sarah,
I really don't think transactional replication is a good high availability
solution. There are many drawbacks to using this. Do a search on the web for
high availability sql server and you should find some good information.
Kimberley Tripp did a great presentation on high availability, perhaps
search for that.
Log shipping might be a good way to go, you can have a latency of 5 minutes
with this solution.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:4ae801c42c41$337182f0$a401280a@.phx.gbl...[vbcol=seagreen]
> Thanks Mark,
> I'll have a look at transactional replication as we backup
> the Production db by log files and to be honest I'm not
> too sure on what will happen if we change it so it updates
> asap.
> Thanks for your time
>
>
> operational, then log
> Double-Take from NSI
> the block level on
> message
> server
|||Thanks for your help guys
>--Original Message--
>Thanks Mark,
>I'll have a look at transactional replication as we
backup
>the Production db by log files and to be honest I'm not
>too sure on what will happen if we change it so it
updates[vbcol=seagreen]
>asap.
>Thanks for your time
>
>
>operational, then log
>Double-Take from NSI
>the block level on
>message
we
>server
>.
>
sql
Monday, March 19, 2012
Get Value from CURSOR
My question is, how do I get the value out of the Cursor? There's only one field.
Declare @.Day as int
Declare @.Plant as varchar(30)
SET NOCOUNT ON
CREATE Table #Temp (Facility varchar(30), ProductCategory nvarchar(3), Target int, Quantity int, Percentage decimal(10,2), Production_Date smalldatetime,As_Of_Time smalldatetime)
Declare Facility_Cursor CURSOR
For Select Distinct(Facility) From ProductionHistory
OPEN Facility_CURSOR
Declare @.Facility_Cursor as sysname
FETCH NEXT From Facility_CURSOR into @.Facility_Cursor
WHILE @.@.FETCHSTATUS = 1
--YESTERDAY
Set @.Day = -2
Insert Into #Temp
exec sp_GetDailyProductionByPlantAndCategory @.Day, @.Facility, 'NAP'
--TODAY
SET @.Day = -1
Insert Into #Temp
exec sp_GetDailyProductionByPlantAndCategory @.Day, @.Facility, 'NAP'
FETCH NEXT FROM Facility_CURSOR into @.Facility_Cursor
CLOSE Facility_Cursor
DEALLOCATE Facility_CURSOR
SET NOCOUNT OFF
Select * From #Temp ORDER BY Production_Date, Facility, ProductCategory DESCI see that you are trying to pass a variable "@.Facility" to your sproc without defining it, and the results of the cursor are being placed into @.Facility_Cursor. If you change the variable declaration to @.Facility and then FETCH NEXT From Facility_CURSOR into @.Facility it just might work!|||That did the trick. I knew it was something simple. Thanks!
Monday, March 12, 2012
Get Toggle state at report runtime
I would like to find the toggle state of a textbox in the report to set an
expression according to that state. I need to navigate to a second report
with different parameters according to the toggle state of a particular row
in my report. How do I write the expression (something like iif(toggle state
= 'Collapsed', Parameter A, Parameter B))?
Thanks,
Ronen FidelHello Ronen,
Unfortunatly, you could not refer the visability state of an report item in
the expression.
I would like to know your business more detailed that I may provide a
solution instead of refer the visability.
Here is an example which have a conditional background color by the toggle
state.
Maybe this will be some help for you.
http://www.msbicentral.com/Downloads/tabid/96/Default.aspx
DrillDownSample.RDL
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Wei,
I'll add more details:
I created a matrix report. I created a group by on the row cell and added
navigation expression on the data cell. When the row cell is expanded the
drill through works fine since I send the row cell id as parameter to the
next report. When the row cell in collapsed, the data cell shows the sun of
all data correctly but the drill through is not working as it should since
the parameter value that it pass to the second report is the first value of
the grouped by data. I wanted to get the toggled state and then if it is
collapsed then send 'ALL' in the parameter and when it is expanded send the
row id.
Thanks,
Ronen Fidel
Unisfair
"Wei Lu [MSFT]" wrote:
> Hello Ronen,
> Unfortunatly, you could not refer the visability state of an report item in
> the expression.
> I would like to know your business more detailed that I may provide a
> solution instead of refer the visability.
> Here is an example which have a conditional background color by the toggle
> state.
> Maybe this will be some help for you.
> http://www.msbicentral.com/Downloads/tabid/96/Default.aspx
> DrillDownSample.RDL
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello Ronen,
To understand your issue better and try to reproduce this issue, I would
like to get some sample report from you.
You could send the report file to me. To get my email address, please
remove the ONLINE in my email.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Wei,
I sent you the reprt via email.
Thanks,
Ronen Fidel
Unisfair
"Wei Lu [MSFT]" wrote:
> Hello Ronen,
> To understand your issue better and try to reproduce this issue, I would
> like to get some sample report from you.
> You could send the report file to me. To get my email address, please
> remove the ONLINE in my email.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Sunday, February 26, 2012
get second dataset value
hi,
how do I get value from second dataset (in multi dataset report)
in some function it provide scope parameter like
Sum(Fields!amount.Value, "DS2")
but now I need to show the value without using function
thks,
Can you please let us know where you are using this expression and what was the exact requirement you are looking for.
Actually sometimes when we face the issues like this
we use to place
=First(Fields!amount.Value, "DS2")
Hope if you are grouping is correctly ,you should be able to write the expression with out function.
Thank you,
Raj Deep.A
|||ok I create 2 dataset and 2 table on a report . I just want to show list out the record . on table 1 it work find but on table 2 it give error that the field name is not in scope . I already set datasource on table 2 to dataset2 . on exepression window only show me field of dataset1 .
how do I resolve this
Get Results into one table
I have 2 tables. I want all the rows from one table and what is left from
the second table.
I.e. table 1.
ID value
1 10
2 20
3 30
i.e. table 2
ID value
1 15
2 25
3 35
4 444
i want my final table to have the following (everything from table 1 and
left over from table 2)
ID value
1 10
2 20
3 30
4 4444
ThanksTry:
select
*
from
Table1
union all
select
*
from
Table2 t2
where not exists
(
select
*
from
Table2 t2
where
t2.[ID] = t1.[ID]
)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Fab" <lazzaro@.rogers.com> wrote in message
news:ew4q9HKPGHA.3936@.TK2MSFTNGP10.phx.gbl...
What is the easiest way to do the follwoing.
I have 2 tables. I want all the rows from one table and what is left from
the second table.
I.e. table 1.
ID value
1 10
2 20
3 30
i.e. table 2
ID value
1 15
2 25
3 35
4 444
i want my final table to have the following (everything from table 1 and
left over from table 2)
ID value
1 10
2 20
3 30
4 4444
Thanks|||Here's another solution:
select table2.ID,
ISNULL(table1.value, table2.value) AS value
from table2
left outer join table1 on table2.ID = table1.ID
"Fab" <lazzaro@.rogers.com> wrote in message
news:ew4q9HKPGHA.3936@.TK2MSFTNGP10.phx.gbl...
> What is the easiest way to do the follwoing.
> I have 2 tables. I want all the rows from one table and what is left from
> the second table.
> I.e. table 1.
> ID value
> 1 10
> 2 20
> 3 30
> i.e. table 2
> ID value
> 1 15
> 2 25
> 3 35
> 4 444
> i want my final table to have the following (everything from table 1 and
> left over from table 2)
> ID value
> 1 10
> 2 20
> 3 30
> 4 4444
> Thanks|||Hi Tom.
Me thinks there's a problem with your query.
This should work.
select
*
from
Table1
union all
select
*
from
Table2 t1
where not exists
(
select
*
from
Table1 t2
where
t2.[ID] = t1.[ID]
)
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uueE$JKPGHA.2320@.TK2MSFTNGP11.phx.gbl...
> Try:
> select
> *
> from
> Table1
> union all
> select
> *
> from
> Table2 t2
> where not exists
> (
> select
> *
> from
> Table2 t2
> where
> t2.[ID] = t1.[ID]
> )
> --
> Tom|||On Tue, 28 Feb 2006 15:02:56 -0500, Fab wrote:
>What is the easiest way to do the follwoing.
>I have 2 tables. I want all the rows from one table and what is left from
>the second table.
>I.e. table 1.
>ID value
>1 10
>2 20
>3 30
>i.e. table 2
>ID value
>1 15
>2 25
>3 35
>4 444
>i want my final table to have the following (everything from table 1 and
>left over from table 2)
>ID value
>1 10
>2 20
>3 30
>4 4444
>Thanks
>
Hi Fab,
SELECT t2.ID, COALESCE(t1.value, t2.value)
FROM Table2 AS t2
LEFT OUTER JOIN Table1 AS t1
ON t1.ID = t2.ID
(untested - see www.aspfaq.com/5006 if you prefer a tested solution)
Hugo Kornelis, SQL Server MVP|||Another way is to use "full join".
"Raymond D'Anjou" <rdanjou@.canatradeNOSPAM.com> wrote in message
news:eJPO4mKPGHA.420@.tk2msftngp13.phx.gbl...
> Hi Tom.
> Me thinks there's a problem with your query.
> This should work.
> select
> *
> from
> Table1
> union all
> select
> *
> from
> Table2 t1
> where not exists
> (
> select
> *
> from
> Table1 t2
> where
> t2.[ID] = t1.[ID]
> )
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uueE$JKPGHA.2320@.TK2MSFTNGP11.phx.gbl...
>|||Ah, yes. Good catch.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Raymond D'Anjou" <rdanjou@.canatradeNOSPAM.com> wrote in message
news:eJPO4mKPGHA.420@.tk2msftngp13.phx.gbl...
Hi Tom.
Me thinks there's a problem with your query.
This should work.
select
*
from
Table1
union all
select
*
from
Table2 t1
where not exists
(
select
*
from
Table1 t2
where
t2.[ID] = t1.[ID]
)
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uueE$JKPGHA.2320@.TK2MSFTNGP11.phx.gbl...
> Try:
> select
> *
> from
> Table1
> union all
> select
> *
> from
> Table2 t2
> where not exists
> (
> select
> *
> from
> Table2 t2
> where
> t2.[ID] = t1.[ID]
> )
> --
> Tom|||--@.@.@. TESTED and works
Create Table #tbl1
([ID] int,
[Value]varchar(10))
INSERT #tbl1 ([ID],[VALUE])
VALUES (1,'10')
INSERT #tbl1 ([ID],[VALUE])
VALUES (2,'20')
INSERT #tbl1 ([ID],[VALUE])
VALUES (3,'30')
Create Table #tbl2
([ID] int,
[Value]varchar(10))
INSERT #tbl2 ([ID],[VALUE])
VALUES (1,'15')
INSERT #tbl2 ([ID],[VALUE])
VALUES (2,'25')
INSERT #tbl2 ([ID],[VALUE])
VALUES (3,'35')
INSERT #tbl2 ([ID],[VALUE])
VALUES (4,'444')
-- View both
SELECT *
FROM #tbl1
SELECT *
FROM #tbl2
-- Combine to make all display
SELECT *
FROM #tbl1
UNION ALL
SELECT *
from #tbl2
where not exists(select *
from #tbl1
where [ID] = #tbl2.[ID])
--@.@.@. TESTED and works
"Fab" wrote:
> What is the easiest way to do the follwoing.
> I have 2 tables. I want all the rows from one table and what is left from
> the second table.
> I.e. table 1.
> ID value
> 1 10
> 2 20
> 3 30
> i.e. table 2
> ID value
> 1 15
> 2 25
> 3 35
> 4 444
> i want my final table to have the following (everything from table 1 and
> left over from table 2)
> ID value
> 1 10
> 2 20
> 3 30
> 4 4444
> Thanks
>
>|||Thanks to everyone for your help...
The solution Joseph provided worked.
:-)
"JosephPruiett" <JosephPruiett@.discussions.microsoft.com> wrote in message
news:E841A384-DEE2-4CC7-A939-A5F6C13DD975@.microsoft.com...
> --@.@.@. TESTED and works
> Create Table #tbl1
> ([ID] int,
> [Value]varchar(10))
> INSERT #tbl1 ([ID],[VALUE])
> VALUES (1,'10')
>
> INSERT #tbl1 ([ID],[VALUE])
> VALUES (2,'20')
>
> INSERT #tbl1 ([ID],[VALUE])
> VALUES (3,'30')
>
>
> Create Table #tbl2
> ([ID] int,
> [Value]varchar(10))
>
> INSERT #tbl2 ([ID],[VALUE])
> VALUES (1,'15')
>
> INSERT #tbl2 ([ID],[VALUE])
> VALUES (2,'25')
>
> INSERT #tbl2 ([ID],[VALUE])
> VALUES (3,'35')
> INSERT #tbl2 ([ID],[VALUE])
> VALUES (4,'444')
>
> -- View both
> SELECT *
> FROM #tbl1
> SELECT *
> FROM #tbl2
>
> -- Combine to make all display
> SELECT *
> FROM #tbl1
> UNION ALL
> SELECT *
> from #tbl2
> where not exists(select *
> from #tbl1
> where [ID] = #tbl2.[ID])
>
>
> --@.@.@. TESTED and works
> "Fab" wrote:
>