Tuesday, October 15, 2013

Efficiently Reuse Gaps in an Identity Column[SQL Server]


Efficiently Reuse Gaps in an Identity Column




Weekly SQL Server newsletter with articles, forum posts, and blog posts via email. Subscribers receive our white paper with performance tips for developers.



SQLTeam.com Articles via RSS


SQLTeam.com Weblog via RSS



Read more

sqlteam.com



Using REPLACE in an UPDATE statement[SQL Server]


Using REPLACE in an UPDATE statement




Weekly SQL Server newsletter with articles, forum posts, and blog posts via email. Subscribers receive our white paper with performance tips for developers.



SQLTeam.com Articles via RSS


SQLTeam.com Weblog via RSS



Read more

sqlteam.com



Handling SQL Server Errors[SQL Server]


Handling SQL Server Errors




Weekly SQL Server newsletter with articles, forum posts, and blog posts via email. Subscribers receive our white paper with performance tips for developers.



SQLTeam.com Articles via RSS


SQLTeam.com Weblog via RSS



Read more

sqlteam.com



[MS SQL Server] Copy data between 2 networks

[MS SQL Server] Copy data between 2 networks


Copy data between 2 networks

Posted: 15 Oct 2013 12:40 AM PDT

Hi Friends,I have around 100 tables to copy from one server to another. The problem is that these 2 servers are not in the same network. Is there any way in which I can achieve this. May be copy data in a disc and and then copy it to the other servers.Please could you suggest few ways of doing this. Thanks

Intangible updates at the publisher database

Posted: 14 Oct 2013 11:32 PM PDT

Good day, colleagues . I encountered with a problem and need advice. SQL Server 2008R2. I have a merge replication with publisher and N subscribers.Periodically an update conflict occurs in replication. It is not a problem, it's okay if both sides have updated record, but in my case the record is updated with only one side.Why so adamantly. First, all user stored procedures which updates a values in record has a script that logs the date and time of renewal in special columns, secondly - the application-layer forbids updating records when current user did not create them, and thirdly, today I created the triggers on the table at the publisher who write all DML operations in the log table.So in the log-table I see the event of creating new record, it was created at the Subscriber and come with replication on the publisher – ok! Then user updates a record on subscriber and I see the update conflict for this record, but I do not see any fact of update that record in the log-tables on publisher. Conflict viewer says to me that both the Publisher and Subscriber data is changed but I do not see a time of renewal in special columns, and all other values are identical. The question is: how Publisher can update records in the table, so that the triggers do not fire? Or which process and why, for some reason generates updates system tables ("genhistory" or "contents"), which leads to conflict?Sorry my poor English, did not have enough practice last time.

Triggers

Posted: 14 Oct 2013 12:59 PM PDT

Hi,I have a table simple nothing to complicatedCREATE TABLE [dbo].[RHH] ([UNIQUE_ID] varchar(50) NULL,[First_Name] varchar(50) NULL,[Last_Name] nvarchar(50) NULL,[email] nvarchar(50) NULL)ON [PRIMARY]with this table all the data gets inserted via an application except the UNIQUE_ID. This I am looking to increment as the data is inserted. Also it has to be in the format of say RHH100100 +1.Im thinking an on insert trigger to update the column but not sure how to get the last value and increment that. ?

[Articles] The Cloud of Destiny

[Articles] The Cloud of Destiny


The Cloud of Destiny

Posted: 14 Oct 2013 11:00 PM PDT

Is SQL Server going to move to the "cloud?" Steve Jones thinks it is and has a few thoughts as he starts off with "cloud week" here at SQLServerCentral.

[SQL 2012] copying data tables between database and keeping indexes and identity columns

[SQL 2012] copying data tables between database and keeping indexes and identity columns


copying data tables between database and keeping indexes and identity columns

Posted: 15 Oct 2013 03:26 AM PDT

Is there a way to copy tables between databases (ssis?) and keep the identity columns and indexes other than tsql scripts. Wondering if SSIS ever got any better at this

Can a server be added to two different clusters?

Posted: 14 Oct 2013 10:04 AM PDT

As part of a re-design of our disaster recovery and high availability environment we are considering several designs. One design would mean trying to setup a server in one location that is part of a local 2 mode cluster so that a SQL instance would remain up if there was a hardware failure (the instance would failover to the other node). Let's say the location is New York.Let's say then we also have a datacenter in Los Angeles. It also has a SQL instance clustered on it's own two nodes located in Los Angeles.So the instance SqlLA\InstanceOne would be a clustered instance on the nodes LA01 and LA02 in LA. The instance SqlNY\InstanceTwo would be a clustered instance on nodes NY01 and NY02 in NY.Then I would want to setup an HA group between SqlLA\InstanceOne and SqlNY\InstanceTwo. Although that would mean the nodes would need to be a resource in two different Microsoft clusters. I would have to add NY01 and NY02 as nodes to the LA cluster even though they are already a part of the NY cluster.The idea is that if there was a real distaster event for say LA then the nodes in NY would take over the availability group. Then if there was a hardware failure on one of the nodes in NY, then the SQL instance in NY is still up.My gut reaction is that this seems like a really bad idea technically as the two clusters would not coordinate well. Although I'm not sure at all, maybe this would work.Does anybody know?

Flat File Input Field Lengths

Posted: 14 Oct 2013 07:57 AM PDT

I have a tab-separated-value (TSV) input file for my SSIS package. When I point to the file to create the Flat File Source, SSIS uses a string data type (OK, I can deal with that...) and a length of 50. Well, some of the columns are bigger than 50 characters. In my data conversion step, I ignore truncation, but I'd rather the input file allow up to 255 characters. I went to the advanced edit for the flat file source component of the Data Flow step and changed the properties of one field I know violates the 50-character limit to 255 characters. It worked, but I got a warning that the metadata didn't match the properties sheet. Did I do this wrong? I don't want silly warnings....

SSDT & TFS

Posted: 14 Oct 2013 08:12 AM PDT

I'm having trouble accessing TFS using the 2012 SQL Server Data Tools. What's odd is that in Visual Studio 2012 under the Source Control Options, TFS is listed, but in SSDT in the same location there is only a None option. SSDT is basically a shell of VS 2012. I don't get it! Anyone successfully use TFS with SSDT for 2012?

Using Dynamic SQL in Stored Procedures[SQL Server]


Using Dynamic SQL in Stored Procedures




Weekly SQL Server newsletter with articles, forum posts, and blog posts via email. Subscribers receive our white paper with performance tips for developers.



SQLTeam.com Articles via RSS


SQLTeam.com Weblog via RSS



Read more

sqlteam.com



Search This Blog