Friday, June 7, 2013

[SQL Server 2008 issues] How to copy new records and updated records from a database table in local server to database table of remote server

[SQL Server 2008 issues] How to copy new records and updated records from a database table in local server to database table of remote server


How to copy new records and updated records from a database table in local server to database table of remote server

Posted: 06 Jun 2013 04:25 PM PDT

HiI am having locla server and remote server.In the local server ,i have database table which is inserted,updated regularly.There is no primary key in the table .Once in a week i want to copy the differential data to be updated in table of remote server.Both table structures are same.Please help me to find the solution.Thanks Chandran.

Calculate Page number

Posted: 06 Jun 2013 08:30 AM PDT

I have a table that I need to return with a dynamically calculated page number. The number of items on a page are not the same but I do know where each page break is based on a column value being 0.It would look something like thisID, SomeTextValue, SomeOtherId, SortOrder1, Hello, 98, 19, World, 4, 210, GoodBye, 5, 311, '', 0, 6 (This would be the page break)12, It's a 98, 113, great day, 4, 2I then would want to have a column with the page number of 1 for the first 3 rows and a page number of 2 for the last two rows, I really don't need the actual page break record to return in the dataset but I just need it to know where the page breaks are.Right now I am using a loop to figure out what the page numbers are but I would like to speed this up if possible.Thanks for any suggestions.

read registry w/o sysadmin, is it possible?

Posted: 05 Jan 2012 11:34 PM PST

Hi, in my SQL Server 2008 EE SP1 environment, one of the application needs to use xp_instance_regread for reading registry values (values like TCPPort in registry), I couldn't find a documentation but by experimenting I saw that only sysadmin role can use this xp. Is there any way to your knowledge, to grant read registry without making the login sysadmin? (something like using Certificate, credential..??) I just want to grant "read registry", is this possible? Thanks..

How can we find the Null values on indexed columns from all tables in SQL Server.

Posted: 06 Jun 2013 07:16 AM PDT

Hi,Please help me on finding the Null values on indexed columns from all tables in SQL Server.I need a SQL query to find all the indexed columns which is having null values.Please do me needful.

SSIS Derived Columns

Posted: 06 Jun 2013 06:49 AM PDT

I am new to SSIS. There is a data flow task for a derived column. I want to have a Derived Column that only looks at the characters after a hypen, and then eliminates any leading or ending spaces.For example: Some Descriptive Text - charactersI would like it to just return: characters(with no leading or ending spaces)Not sure how to accomplish this in a SSIS drived column expression. Any help will be greatly appreciated. Thank you.

Looking for good article with example for Encryption at database level, table level and field level in SQL SERVER 2008R2 and Also durig the transmission of data between two different server(e.g. Oracle and SQL Server)

Posted: 06 Jun 2013 07:30 AM PDT

Hi firends..I got some example on msdn website regarding this, but I guess I need more practice..If you have any idea about any article, please let me know.thanks.

Transaction replication has many undistributed commands, but tracer token arrives immediately.

Posted: 06 Jun 2013 06:36 AM PDT

hi i have sql server 2008 R2 with transactional replication. In general this replicated database that normally performs very well, only today after reinitializing I saw a large command buildup in the distributor.However, when I insert a tracer token to measure the latency, this arrives at the subscriber within 3 seconds. When I look inside the subscriber db and compare the data to that of the publisher I can see even the most updated tables are up to date. Has anyone had a similar experience for this?

reporting services and analysis services

Posted: 06 Jun 2013 12:14 AM PDT

How do i know reporting services and analysis services are installed or not in my sql server.

NEWSEQUENTIALID() with EC2

Posted: 06 Jun 2013 02:14 AM PDT

HelloI have a db running on an EC2 (Amazon AWS) instance. I have a table that has a uniqueidentifier column as the primary key. There is also a clustered index on that column. To create the uniqueidentifier I use NEWSEQUENTIALID().This has been working great. However I just noticed that now new rows are not getting added at the end. They're getting inserted in the middle. Not good for a clustered index. After looking into it I found that the reason this is happening is because the underlying network interface has changed. When an EC2 instance gets rebooted, it will get a new network interface. Which affects NEWSEQUENTIALID().The reason uniqueidentifier is the primary key and not an int (and use identity) is because there are multiple dbs with the same structure that will need to be copied to a master db. SoI could create my own version of NEWSEQUENTIALID(). Or I could take the clustered index off the primary key, make it a non clustered index and put the clustered index on something else. There's a column that has the timestamp of when the row was created, that may be were I'd put the clustered index.Has anyone run into something similar? Thoughts? Suggestions?Thanks!

sql server transactional Replication

Posted: 06 Jun 2013 03:02 AM PDT

We are running SQL Server Transactional Replication and we selected a few tables to be replicated. One of the tables has 3 triggers defined on it an d when we run the snapshot, this table is not created . It is selected to be replicated and it has a Primary Key . Any ideas ? I am a bit desperate .

Migrating to Virtual Deployment - Long query times

Posted: 06 Jun 2013 02:25 AM PDT

Have a production physical server running SQL 2005 and reporting services. The server is about 6 years OLD (yikes) with dual/dual procs and 4GB RAM. It's been doing the job perfectly fine, but we need to move on from EOL hardware. The database is 6GB in size.I've created a virtual machine in Hyper-V with Windows 2008 R2, 4 procs, 8GB RAM - I've also moved up to SQL 2008 R2 Standard (had some CALs from a previous project) and migrated the data over. As far as functionality, I'm not really seeing any issues (nor is the testing user group complaining of anything) HOWEVER, the reports in reporting services are extremely slow.Just as an example, one of the reports in the old environment is instantaneous. In the virtual environment, it takes 20 seconds to render. That time is very consistent.I have the data on one LUN and System Databases on another LUN and SQL/OS on another LUN in the virtual environment. The current production is actually all on a single LUN attached to the same SAN.I know it's something related to the VM, as I created the same environment my local machine and everything is instant. I guess I'm confused as I've read over the years the advancement of SQL running in a virtual environment. I'm pulling my hair out on this. I even isolated the virtual machine on a host (32 procs, 256GB RAM) with nothing else on it. Same results.Other information I gathered on the VM while running the report:Disk Queue Length (on data LUN) - .2Disk Reads/Sec (on data LUN) - 48avg (136max)Disk Writes/Sec (on data LUN) - 48avg (148max)Proc Queue Length - 2 (the CPU max during report is 20% - which I'm questioning why it's that high)When I run a profiler - I see on the production box, Reads of 691 and the VM Reads of 1,572,147. The same query.What else can I check to pinpoint the bottleneck?

Issue while joining two tables with no unique columns

Posted: 05 Jun 2013 11:11 PM PDT

I have two tables with no common columns: Graph_Range Start_Range End_Range 0.10 0.20 0.20 0.30 0.30 0.40 Graph_data Asset_Value factor Case 500 0.12 1 270 0.13 2 300 0.27 3 240 0.23 4 200 0.13 5 100 0.12 6 I need results as Lower Limit Upper Limit Sum_Asset 0.10 0.20 1,070 i.e. 500 + 270 + 200 + 100 0.20 0.30 540 i.e. 300 + 240 0.30 0.40 0 i.e. the Sum_Asset should give sum of all asset values for which factor falls between Start and end range in the other 2 columns. I am not sure how can I get results in such data set as UNION, CROSS JOIN,INNER JOIN are not working. Either I am getting repaeted entires or error messages. Please help. I have used this query SELECT A.Start_Range, A.End_Range, SUM(B.asset) AS Sum_Asset FROM dbo.Graph_Range AS A , dbo.Graph_Data AS B GROUP BY A.Start_Range, A.End_Range , b.Factor HAVING (B.Factor < A.End_Range) AND (B.Factor > A.Start_Range)

Query help

Posted: 06 Jun 2013 12:58 AM PDT

hi guys need help with a query please. i have a tablethat looks like this;id name aim startdate 1 kev maths 31/10/20101 kev english 01/11/20102 trev science 01/09/20102 hev maths 31/10/20103 nev history 20/3/20104 mev maths 12/12/20105 brad english 31/ 5/20105 brad maths 31/10/2010i need to find out which people have an aim at the start date 31/10/2010 as there earliest start date for their aims. resultid name aim startdate1 kev maths 31/10/20102 hev maths 31/10/2010note how brad is not in result as he has english 31/5/2010 as his earliest start date for one of his aims.please help !!!!!

Please help i have a big probleme my database is empty and i need to go back!

Posted: 05 Jun 2013 09:11 PM PDT

Hi everyonethis morning i start my database and everything is gone insideall my tables are emptyi have no backupis there any way i can restore it as it was the day before?please help

No comments:

Post a Comment

Search This Blog