Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Tuesday, March 20, 2012

Reinitialize subscription thru DOS

Hey All,
Is there a way thru which I can reinitialize a subscription using a
batch/ script file. Or force the generation of a snapshot and force
apply the snapshot using a batch/ script file.
Thanks a lot for your help.
Jatin
*** Sent via Developersdex http://www.codecomments.com ***
Jatin,
you need to call the relevant sp_reinit... stored procedure (eg
sp_reinitsubscription), followed by running the snapshot and
distribution/merge agents (sp_start_job). You could have all these as a TSQL
batch file and use OSQL to run the batch file if you need to do it through
DOS (also the OSQL commands could be in a DOS batch file).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul...that is exactly what I ended up doing.
*** Sent via Developersdex http://www.codecomments.com ***

Friday, March 9, 2012

Re-Index Script

I would like to re-index two tables (t1 and t2) if the logical scan
fragmentation is greater 80% on these tables.
Please help me create a t-sql script to create this task.
Thank You,Have a look at the samples in BooksOnLine under DBCC SHOWCONTIG.
Andrew J. Kelly SQL MVP
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:E1AF96CD-2AC5-4BDB-AF79-43CAD668A773@.microsoft.com...
>I would like to re-index two tables (t1 and t2) if the logical scan
> fragmentation is greater 80% on these tables.
> Please help me create a t-sql script to create this task.
> Thank You,
>|||DBCC Showcontig will give you the information on how fragmented etc. is your
table.
You can use DBCC Reindex to Reindex your tables(TABLES WILL BE OFFLINE).
You can also use DBCC Defrag to defrag your tables(It's an online process).
Also, it'll grow your logfile like anything if your tables are huge. So,
Beware.

regular expression

Hi all,
I m able to use regular expression in a Vbs script, but how can I use them
(if it's possible ) in reporting service code ?
I havent found any subjects like this in the my books (even in "MRS in
action" by Téo Lachev :) )
ThanksFirst, add a function to do your Regular expression in the report level
Code (Report --> Properties --> Code) . Here's an example:
----
Public Function RegExTest () as Object
Dim Str As String = "<expressiontext>the text the returned by
the regular expression</expressiontext>"
Dim expressiontext As String
Dim regexexpressiontext As System.Text.RegularExpressions.Regex
= New
System.Text.RegularExpressions.Regex("<expressiontext>(?<expressiontext>[^<]+)</expressiontext>",
System.Text.RegularExpressions.RegexOptions.IgnoreCase)
expressiontext =regexexpressiontext.Match(Str).Groups("expressiontext").Value
RegExTest = expressiontext
End Function
----
Now your text box will refer to the code in a fashion similar to this:
=Code.RegExTest
And low and behold, regular expressions in Reporting Services.
Andy Potter|||OK.
Thanks a lot !
"Potter" wrote:
> First, add a function to do your Regular expression in the report level
> Code (Report --> Properties --> Code) . Here's an example:
> ----
> Public Function RegExTest () as Object
> Dim Str As String = "<expressiontext>the text the returned by
> the regular expression</expressiontext>"
> Dim expressiontext As String
> Dim regexexpressiontext As System.Text.RegularExpressions.Regex
> = New
> System.Text.RegularExpressions.Regex("<expressiontext>(?<expressiontext>[^<]+)</expressiontext>",
> System.Text.RegularExpressions.RegexOptions.IgnoreCase)
> expressiontext => regexexpressiontext.Match(Str).Groups("expressiontext").Value
> RegExTest = expressiontext
> End Function
> ----
> Now your text box will refer to the code in a fashion similar to this:
> =Code.RegExTest
> And low and behold, regular expressions in Reporting Services.
> Andy Potter
>