Tag: sql-server-2005

How should I go about transferring data from an ODBC app to SQL on an hourly basis?

I’m trying to pull data from an ODBC app to SQL2005(dev ed) DB on an hourly basis. When I run SSIS the option to import all tables and views is grayed out and forces your to write a query. How would I go about setting up a SSIS integration service to update ALL 250 some […]

select query by range

Hi I want to select values from tables by passing two parameters like start and end ranges How can i get it? Ex: sid sname s001 name1 s002 name2 s003 name3 s004 name4 s005 name5 s006 name6 s007 name7 s008 name8 s009 name9 s0010 name10 here i want to pass two values like 3 and […]

Does the 'Enable Advanced Performance' override FILE_FLAG_WRITETHROUGH on Win 2k3/SQL Server 2005

SQL Server opens files with FILE_FLAG_WRITETHROUGH, which appears to force writes to the physical disk. In SQL Server-speak this is called ‘Forced Unit Access (FUA)’; a white paper discussing this can be found here. Many SANs appear to honour this and this might explain slow performance of an ETL process I am developing on a […]

SQL Group By One Field and Order By Another Field

The Table: declare @Table table ( id int, ticketid int, sponsor int, dev int, qa int, savedate datetime ) insert into @Table values (1,100,22,0, 0, ‘2008-10-29 11:17:59.527’) insert into @Table values (2,100,5,0, 0, ‘2008-10-29 11:00:37.030’) insert into @Table values (3,101,22,0, 0, ‘2009-10-29 11:10:27.687’) insert into @Table values (5,101,44,0, 0, ‘2008-10-31 12:07:52.917’) insert into @Table values […]

Unable to connect to SQL2005 using VBScript

I have the following VBScript, which is supposed to connect to a SQL Server 2005 database. But, my connection is failing. Why? Set dbConnection = CreateObject(“ADODB.Connection”) dbConnString = “Provider=SQLOLEDB.1;Data Source=srv\test1;” & _ “Initial Catalog=tset_DB;user id =’abc’;password=’abc'” ‘Open the connection dbConnection.Open dbConnString


Here’s the situation I’m in. I have a table containing peoples’ information. Some of them are imported from another system while some are imported manually. What I would like to do is pull everyone in, but if there is a record entered manually and a record that was imported, I want to select only the […]

“infinite” sql statement?

I’ve got a very strange sql-related problem. I’m accessing a MSSQL Server 2005 with PHP (odbc), when I profile the sql statement the following is executed: declare @p1 int set @p1=180150003 declare @p3 int set @p3=2 declare @p4 int set @p4=1 declare @p5 int set @p5=-1 exec sp_cursoropen @p1 output,N’SELECT fieldA, fieldB, fieldC, fieldD, fieldE […]

How can I get installed sql server instances?

How can I get installed sql server instances from registry? How I can determine default instance?? Thanks Rajesh

partition function in SQL Server 2005

In MSDN about partition function from here, $PARTITION(Transact-SQL). I am confused about what the below sample is doing underlying. My understanding is, this SQL statement will iterate all rows in table Production.TransactionHistory, and since for all the rows which will mapping to the same partition, $PARTITION.TransactionRangePF1(TransactionDate) will return the same value, i.e. the partition number […]

Why do I have duplicate rows for the same subscriber in my MSmerge_identity_range table?

I have a database with merge replication set up on a SQL 2005 server with 1 subscriber. I am having some identity range issues an I started to look at the MSmerge_identity_range table. I have one subscriber but 2 rows for each. For Example(I shortend the guids but for arguments sake they are the same […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.