Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Friday, March 23, 2012

running .sql script from command line

how do I run a file with an .sql extension from the command window in windows 2k server?
Hi,
Use OSQL utility from command prompt
OSQL -SSERVER_NAME -Uuser -Ppassword -d db_name -i file_name.sql -o
output.log
Thanks
Hari
MCDBA
"joel" <anonymous@.discussions.microsoft.com> wrote in message
news:0FB9BC49-83D4-416D-889C-00A024A07079@.microsoft.com...
> how do I run a file with an .sql extension from the command window in
windows 2k server?

Tuesday, March 20, 2012

Run sp_resyncmergesubscription to solve un-sync data problem between subscribers and Publisher

Hello,

I have set up a merge replication with 4 subscribers and a publisher on SS05 sp2 on 5 window servers. After running my application on the replication with big data for a while, the data in some of tables of subscriber are out of sync from the publisher. I tried to run sp_resyncmergesubscription to fix the problem according to http://doc.ddart.net/mssql/sql2000/html/replsql/replmon_9pwh.htm. The procedure run successfully. However, the problem is still exist.

Does anyone else have this problem. Please help!

Did you try @.resync_type = 0

When you ran sp_resyncmergesubscription procedure and @.resync_type = 0 is intense operation...

|||

I tried with @.resync_type = 2.

Here is the script I have run at the Publisher:

exec sp_resyncmergesubscription NULL, NULL, 'ds3263a', 'red-dalmssql103', 'ds3263c',2, '2007-04-06 10:00:00.000'

|||

What tables are out of sync?

Do you have filtering? Is the data same for all subscribers?

Do you have any user triggers on tables?

|||

It might have more than one table out of sync. However, I know for sure one user table is out of sync between subscribers. The data in the table, rn_schedule_task, is in sync status between publisher and owning subscriber. For example,

Table – rn_schedule_task:

TaskID

Status

1

succeeded

2

running

3

failed

The status of task 1 showing as “succeeded” on publisher and owning subscriber, but showing as “running” on other subscriber(s).

We do not have any user triggers on the table that I know.

|||

I am not sure how you have gotten into this situation.

But for the rows that are different, you could dummy update these rows.

You could do: update m_schedule_task set Status=Status where TaskID=<task ID of the row that is out of sync>

Then run the merge agent and hopefully it should converge this time.

Run sp_resyncmergesubscription to solve un-sync data problem between subscribers and Publisher

Hello,

I have set up a merge replication with 4 subscribers and a publisher on SS05 sp2 on 5 window servers. After running my application on the replication with big data for a while, the data in some of tables of subscriber are out of sync from the publisher. I tried to run sp_resyncmergesubscription to fix the problem according to http://doc.ddart.net/mssql/sql2000/html/replsql/replmon_9pwh.htm. The procedure run successfully. However, the problem is still exist.

Does anyone else have this problem. Please help!

Did you try @.resync_type = 0

When you ran sp_resyncmergesubscription procedure and @.resync_type = 0 is intense operation...

|||

I tried with @.resync_type = 2.

Here is the script I have run at the Publisher:

exec sp_resyncmergesubscription NULL, NULL, 'ds3263a', 'red-dalmssql103', 'ds3263c',2, '2007-04-06 10:00:00.000'

|||

What tables are out of sync?

Do you have filtering? Is the data same for all subscribers?

Do you have any user triggers on tables?

|||

It might have more than one table out of sync. However, I know for sure one user table is out of sync between subscribers. The data in the table, rn_schedule_task, is in sync status between publisher and owning subscriber. For example,

Table – rn_schedule_task:

TaskID

Status

1

succeeded

2

running

3

failed

The status of task 1 showing as “succeeded” on publisher and owning subscriber, but showing as “running” on other subscriber(s).

We do not have any user triggers on the table that I know.

|||

I am not sure how you have gotten into this situation.

But for the rows that are different, you could dummy update these rows.

You could do: update m_schedule_task set Status=Status where TaskID=<task ID of the row that is out of sync>

Then run the merge agent and hopefully it should converge this time.

Monday, March 12, 2012

Run in Query Window in Management Studio

I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by clicking on the SQLCMD mode
So for example I tried this
sqlcmd -d userdb -i test.sql
in the query editor and it failed. However it succeeds when I run it from
the command prompt
Thankssqlcmd is not a sqlcmd command. It is a command understood by the *Operating System* command
interpreter, which *starts* sqlcmd. SSMS does understand sqlcmd commands, like :r and :Connect
provided you set SSMS in that mode (check the Query menu).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hassan" <hassan@.test.com> wrote in message news:OTiUrmrOIHA.4712@.TK2MSFTNGP04.phx.gbl...
>I thought we could run sqlcmd commands directly in the Query Editor within Management Studio by
>clicking on the SQLCMD mode
> So for example I tried this
> sqlcmd -d userdb -i test.sql
> in the query editor and it failed. However it succeeds when I run it from the command prompt
> Thanks

Run in Query Window in Management Studio

I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by clicking on the SQLCMD mode
So for example I tried this
sqlcmd -d userdb -i test.sql
in the query editor and it failed. However it succeeds when I run it from
the command prompt
Thankssqlcmd is not a sqlcmd command. It is a command understood by the *Operating
System* command
interpreter, which *starts* sqlcmd. SSMS does understand sqlcmd commands, li
ke :r and :Connect
provided you set SSMS in that mode (check the Query menu).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hassan" <hassan@.test.com> wrote in message news:OTiUrmrOIHA.4712@.TK2MSFTNGP04.phx.gbl...[vb
col=seagreen]
>I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by
>clicking on the SQLCMD mode
> So for example I tried this
> sqlcmd -d userdb -i test.sql
> in the query editor and it failed. However it succeeds when I run it from
the command prompt
> Thanks[/vbcol]

Saturday, February 25, 2012

Run a DTS Win32 Process Task hidden

Anyone?
I have a picky client who does not want to see the command window open when a batch file is called from DTS.
Can anyone help me in running it hidden?If you are using a batch file, then the dos window will always open up, at least for a short instant, and there is no way that you can avoid that.

To avoid lookup of commands used then use @.ECHO OFF at the beginning of the batch file.|||That's what I was afrain of.

Originally posted by Satya
If you are using a batch file, then the dos window will always open up, at least for a short instant, and there is no way that you can avoid that.

To avoid lookup of commands used then use @.ECHO OFF at the beginning of the batch file.