Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Thursday, March 29, 2012

Can I have replication between two completely different schemas?

Hi SQL guys,

I have 2 different databases and an import tool that reads from one and fills the other one and then whenever we run it, it should synch the two databases and its kind of a heavy task. I was wondering if i can replace it with replication between these databases. I defined publisher and subscriber, but i cannot find anywhere that i can say which field in source maps to which field in destination.

Is it possible at all to have a replication between 2 databases with totally different schemas? If so, please let me know how.

Thanks,

Sina

No, the schemas should match. Aleast they should be compatible.|||

yes, you can, but only if the subscriber is not updating the data.

if you are only importing data from the publisher, then you can , what you need is create a transformable subscription, you use dts in that subscription to make all matching or convertions you need between source and destination.

Thank you

Armando Marrero

|||

hi Armando...

can you please brief the steps of making the matches between source and destination for transformable subscription.

Thanks in advance

Can I have replication between two completely different schemas?

Hi SQL guys,

I have 2 different databases and an import tool that reads from one and fills the other one and then whenever we run it, it should synch the two databases and its kind of a heavy task. I was wondering if i can replace it with replication between these databases. I defined publisher and subscriber, but i cannot find anywhere that i can say which field in source maps to which field in destination.

Is it possible at all to have a replication between 2 databases with totally different schemas? If so, please let me know how.

Thanks,

Sina

No, the schemas should match. Aleast they should be compatible.|||

yes, you can, but only if the subscriber is not updating the data.

if you are only importing data from the publisher, then you can , what you need is create a transformable subscription, you use dts in that subscription to make all matching or convertions you need between source and destination.

Thank you

Armando Marrero

|||

hi Armando...

can you please brief the steps of making the matches between source and destination for transformable subscription.

Thanks in advance

Can I have replication between two completely different schemas?

Hi SQL guys,

I have 2 different databases and an import tool that reads from one and fills the other one and then whenever we run it, it should synch the two databases and its kind of a heavy task. I was wondering if i can replace it with replication between these databases. I defined publisher and subscriber, but i cannot find anywhere that i can say which field in source maps to which field in destination.

Is it possible at all to have a replication between 2 databases with totally different schemas? If so, please let me know how.

Thanks,

Sina

No, the schemas should match. Aleast they should be compatible.|||

yes, you can, but only if the subscriber is not updating the data.

if you are only importing data from the publisher, then you can , what you need is create a transformable subscription, you use dts in that subscription to make all matching or convertions you need between source and destination.

Thank you

Armando Marrero

|||

hi Armando...

can you please brief the steps of making the matches between source and destination for transformable subscription.

Thanks in advance

sql

Can I have multiple tables to gather event data

Hi Guys,

Wondering if I could have two tables with parent child relationship to gather event data. Does NS support such scenario while defining schema in ADF.xml.

Please advice.

Thanks,

Shamir

You can use just about any T-SQL code in the EventRule Action node to

identify and insert new events for the SSNS application, as long as it

produces the appropriate fields as defined in the associated

eventclass.

HTH...

--

Joe Webb

SQL Server MVP

http://www.sqlns.com

~~~

Get up to speed quickly with SQLNS

http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.

(www.sqlpass.org)

On Sun, 23 Jul 2006 03:10:01 -0700,

wrote:

>Hi Guys,

>

>Wondering if I could have two tables with parent child relationship to

>gather event data. Does NS support such scenario while defining schema

>in ADF.xml.

>

>Please advice.

>

>Thanks,

>

>Shamir|||

[again, reposting since my prior attempt didn't seem to render appropriately]

You can use just about any T-SQL code in the EventRule Action node to
identify and insert new events for the SSNS application, as long as it
produces the appropriate fields as defined in the associated
eventclass.

HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

|||

Hi Joe,

Thanks for your reply.

Let me give you a clear picture of what I am trying to do ..

I have event data of following structure,

Table 1:

<Transactions>

<Transaction id=1>

<Transaction id=2>

<Transaction id=3>

<Transactions>

Table 2:

<TransactionDetail>

<TId></TId>

<Info></Info>

<TransactionDetail>

"TId" in table 2 references id of transaction element in table 1. Idea is to support unlimited number of rows in table2. How can i go about this.

Thanks,

Shamir

|||

Ahhh...gotcha.

A couple of options come to mind. First you can flatten out the rows into multiple events. In this scenario, you'd have one event row per transaction detail and that row would include information from table 1 and table 2. You'd want to then use the digest delivery to pull it all together into one notification. However, under certain circumstances, I could see how this may lead to an occassional mishap where a user would receive more than one notification, each being somewhat incomplete.

You could also look at submitting only the master events, table 1, and then retrieving the detail information later on in the process - in either the match rule or perhaps in a custom delivery protocol.

HTH...

Joe

Sunday, March 25, 2012

Can I duplicate data?

Hello guys! Is it possible to duplicate a primary key?

I would like my database to accept data with the same primary key.

Is it possible?

How do you declare ON DUPLICATE KEY UPDATE?

Please help me. Thanks in advance. Wink

Hello.

That is not possible nor suggestedSmile

If you want to use that particular field for something else (and it is obvous, because you want duplicate values in it):

- add new field of type int

- make it autoincrement (identity)

- make it primary key for table and remove old field from primary key

sql

Thursday, March 22, 2012

Can I create table with constrains in SMO?

Hello Guys,
I m new to SMO thing. Just wonder if we can define data constrains in SMO for tables?
Cheers,
Elton

The simple answer is yes, anything you can do in SSMS you can do using SMO. Can you offer any specifics regarding what you want to do?

|||

I wrote a tutorial on how to create a table in SQL Server using SMO. This may get you started:

Create Table in SQL Server 2005 Using C# and SQL Server Management Objects (SMO) - Code Generation

Regards,

Dave

Can I create table with constrains in SMO?

Hello Guys,

I m new to SMO thing. Just wonder if we can define data constrains in SMO for tables?

Cheers,

Elton

The simple answer is yes, anything you can do in SSMS you can do using SMO. Can you offer any specifics regarding what you want to do?

|||

I wrote a tutorial on how to create a table in SQL Server using SMO. This may get you started:

Create Table in SQL Server 2005 Using C# and SQL Server Management Objects (SMO) - Code Generation

Regards,

Dave

Friday, February 24, 2012

Can any one help me wid this Problem

Hello Guys,

I have developed some projects in VB. And now wanted to develop some reports. As i have gone through Data Report, i am facing a **** lot of problem in Page Breaking. I am not able to do the Page Break.

I want per record per page. viz. Employee Name, Salary and Photo per page/employee.

Some one told me to use Crystal Report as it give feature of Conditionall Page Breaking as well as Grouping and it also has Looping Functionality.

Guys, please suggest and help me to develop the Reports.

ThanksIf you want to print only one record per page then goto section expert of the report and in the New Page After option there is button labled x-2. Click that and write this

recordnumber mod 1=0

Tuesday, February 14, 2012

can a database be made full after 15 entry's

Hello guys I was wondering if it would be possible to make a database full after 15 entry's and how would I go about doing that if it is possible

Hi Warren,

Just to clarify: are you talking about simulating a "full"data file in a database, or some form of constraint which enforces a rule that only 15 rows can exist in given table(s)?

If the former, you'd simulate this by sizing your database very small (2MB for instance), and creating a table in which each column's data size equates to the db size / 15...

If the latter, you would do this with a check constraint and perhaps trigger.

Cheers,

Rob

|||

the check constraint sounds like the way I want to go if you happen to have a sample of how i could code that and set me in the right direction I would be very grateful

thanks again Rob

|||

I was given the following code but it seems to be giving me a bit of trouble

Dim theSqlCommand as new SqlCommand("SELECT COUNT(columnName) FROM tableName")
theSqlCommand.Connection = new SqlConnection(connString)
Dim theNumberOfEntries as new object
theNumberOfEntries = 0
theSqlCommand.Connection.Open()
SqlDataReader theDataReader = theSqlCommand.ExecuteReader(CommandBehaviour.CloseConnection)
if theDataReader.HasRows Then
theNumberOfEntries = theDataReader.GetValue(0)
End If
theSqlCommand.Connection.Close()
'We have retrieved and stored the value of the query into theNumberOfEntries
if Convert.ToInt32(theNumberOfEntries) = 15 Then
'No more records allowed to be inserted
End if

I am not sure where to place it either

|||

Hi Warren,

The (VB) code you've been given above won't really help you as it doesn't really provide any mechanism to enforce your rule if the application is bypassed for data operations.

As an example, say your table you want to limit the number of rows for is called t15:

create table t15>

(

col int not null

)

go

create function fn_t15 ()

returns int

as

begin

return (select count(*) from t15)

end

go

ALTER TABLE t15

ADD CONSTRAINT chkRowCount CHECK (dbo.fn_t15() <= 5 );

GO

In this scenario, you can only insert 5 rows into the table t15. Attempting to insert a sixth with result in an error:

insert into t15 values (123)

Cheers,

Rob

|||

Thanks Again Rob I really appriciate your help

I was messing around with the code you gave me today but I am confused on where to put it/Implement it I went into the table and tried to add a check constaraint but I couldn't get the exception accepted ;-( Sorry to be a pain in the arse

|||

Hi Warren,

No worries at all :)

It's probably easiest to paste the code in a query window in Management Studio. You won't be able to create the constraint in the table design view as the function that the constraint will use needs to be created first anyway.

Cheers,

Rob

Can a Data Flow Task mimic Bulk Insert?

Hi Guys,

The way I understand a Data Flow Task is that it inserts the rows from the source to destination one by one. Is there a way to make it act like a bulk insert task? We have been experiencing performance issues when inserting a lot of rows from one table to another. If there's no way to actually do it, can a bulk insert task functionality be scripted? Coz what I need is a table to table insert, and the bulk insert task only accepts data files as sources.

Thanks!

Kervy

What destination object are you using? The OLEDB Destination and the SQL Server destination both enable bulk insert options for SQL Server.

How many rows are you inserting?

Donald

|||

Oh you mean to say, by default, an OLEDB source inserts to an OLEDB Destination in bulk? We are only inserting a couple of hundred thousand rows, but the source table is in the US. destinations are in Europe and Asia Pacific, so we need to optimize this as much as we can given the proximity of the servers.

We are using OLEDB source and OLEDB Destination

Thanks

|||

If you need to performance tune your data-flow then you should read a whitepaper that I have mentioned here: http://blogs.conchango.com/jamiethomson/archive/2006/04/09/3594.aspx

There's also more useful information here: http://blogs.conchango.com/jamiethomson/archive/2005/04/20/1319.aspx

Note that SSIS does not insert records one at a time - that would be a performance killer. The SSIS pipeline processes data in buffers and the contents of each buffer is inserted at the same time! A large part of performance tuning your application is finding the optimum buffer size.

Note that in your scenario the bottleneck is likely to be the georgraphic disparity of the source and destination, not how fast SSIS can process it. Try and reduce the amount of data that is coming over the wire if possible - i.e. Filter the data at source and only select columns that you require.

-Jamie

|||

hi Jamie,

Thanks for that response. I will read more on how to performance tune my data flow. One accepted cause for the horrible execution time is the distance between servers (destinations are in 2 different continents!), that is why we are trying to figure out if there are other ways to improve on this. We tried testing with a destination server in the same area, and it took about 9 minutes.. compared to the 16 hours it took when the target was Asia Pacific.. we may have to accept that performance issue for now..

total number of rows to be inserted = 200,000

total number of columns = 167

|||

KervyChoa wrote:

hi Jamie,

Thanks for that response. I will read more on how to performance tune my data flow. One accepted cause for the horrible execution time is the distance between servers (destinations are in 2 different continents!), that is why we are trying to figure out if there are other ways to improve on this. We tried testing with a destination server in the same area, and it took about 9 minutes.. compared to the 16 hours it took when the target was Asia Pacific.. we may have to accept that performance issue for now..

total number of rows to be inserted = 200,000

total number of columns = 167

Exactly, hence my previous comment "Try and reduce the amount of data that is coming over the wire if possible - i.e. Filter the data at source and only select columns that you require."

The point here is to reduce the amount of data coming over the wire because that is quite obviously the bottleneck in your scenario.

-Jamie

|||I tried using perfmon to see what can be done, but I can't find the SQL Server: SSIS Pipeline Performance object in perfmon.. Am I missing something here?|||

KervyChoa wrote:

I tried using perfmon to see what can be done, but I can't find the SQL Server: SSIS Pipeline Performance object in perfmon.. Am I missing something here?

As we have already determined (twice) the bottleneck is not within the SSIS pipeline so looking at this perf counter is not going to help you.

Unless you pick one of the machines up and move it to a different continent, or improve the speed of the link between them, you're not going to see any eprformance improvement.

-Jamie