SQL Query: Subtract data from consecutive rows uptil non zero value reached.
I need to write a query to subtract data from consecutive rows uptil a non zero value is reached.For Current Line 8659: it should return 25000-15000Current Line 12328: it should return...
View ArticleMigration from SQL Server 2005 to SQL Server 2008 R2 question
Hi,We will be migrating from SQL Server 2005 to SQL Server 2008 R2 (different physical server), and I'm wondering if I have to migrate the databases via Restore or if I can detach from SQL 2005 copy...
View ArticleIgnore fields with Commas
Hi all,I have a dataflow task that makes an initial connection to a flatfile csv. There are 4 columns ie: | Ref Date | Geo | Comm | Value |Within some of the fields in the Geo and Comm columns there...
View ArticleMAX behavior difference with nvarchar and varchar column types
Hi All, We are getting different results for MAX function with nvarchar and varchar columns.create table my_table(id1 nvarchar(10), id2 varchar(10);insert into my_table('-1','-1);insert into...
View Articledatabase relationships
i have master tables in one database and child table in one database, but no relationship between them, need to check all the changes done in child table through master table??????
View Articledirectional based search
sql 2008 r2 setup, full-text is enabled if required here.Would anybody be able to share some implementation steps for seaching whole phrases in any direction one column at a time?e.g.Product001 | small...
View Articlehow to handle "timestamp" datatype value in sql server
Hi, I am getting trouble to pass the value of column2 to of my table in SQL stored procedure from .net application (vb.net) and same to compare the input variable's value in the stored procedure,...
View ArticleScript failed for StoredProcedure "dbo.XXX"
Hi,I am getting below error while trying to read stored procedure script from database using SMO.Script failed for StoredProcedure at...
View ArticleChanging Column Data type
HiWe need to change int column to bigint data type on a primary key column.So we generate script from managment studio. it changed data type by using temp table. My question why they did not use alter...
View ArticleHow to check mirrored database
Dear,I have implemented database mirroring with automatic failover option. My principal database is a busy one. Now I am not sure that whether the mirror database is receiving data from principal.How...
View ArticleScript to get list of databases for which a user has db_owner database role ?
What is the command to get list of databases for which a user has db_owner database role ?
View ArticleCapacity Planning
Hi All,I was asked to do capacity planning of SQL 2005 & 2008 servers. What are some of the things you need to look into.If you guys have any scripts which can capture the necessary...
View ArticleNeed stored procedure in sql 2008 which scripts all the database
We used the below procedure to script all the Databases in sql server 2000CREATE Procedure dbObjectBackup as DECLARE @name VARCHAR(50) -- database name DECLARE @path VARCHAR(256), @path1 varchar(256)...
View ArticleSQL Trace causes application to hang
Hi,We've recently upgraded to Windows 2008 R2, SQL Server 2008 R2 SP + CU4, multi-instance cluster. 32 cores (64 with h/t), 384GB per node. Maxdop 4 server wide, 320GB max server memory. It used to be...
View Articlewhat is new method in create a script in (scptxfr.exe') for 2008
what is new method in create a script in (scptxfr.exe') for 2008
View ArticleHow to find which are all databases are in use in sql server 2008
Hi,I have a SQL Server 2000 box that houses several databases, some of which are probably no longer in use. I'd like to clean things up by first taking them offline, and then later removing them all...
View ArticleDTS Error
Hi Experts,Need your help in fixing this issue.I installed SQL server 2008 [b](Microsoft SQL Server 2008 (SP3) - 10.0.5768.0 (X64) Nov 4 2011 11:32:40 Copyright (c) 1988-2008 Microsoft Corporation...
View Articlehow to store perfmon data(.csv) into sql table.create a schedule job
how to store perfmon data(.csv) into sql table.create a schedule job
View ArticlePerformance issue while fetching 20000000 records
I have some 20000000 rows in my database. While fetching records on some criteria it take too much time. I created all possible indexing also but still it took more than 3 min. How can i improve...
View Article