sql-server

Problem using SQL Agent to run SSIS Packages - fails with "DTSER_FAILURE(1)"

I have an SSIS Package stored in the MSDB database which works fine when I execute it. It will run under SA account or will use Windows security. I want to schedule this job to run with SQL Agent, but when I do I get a strange error and whatever configuration I try it fails with the following error: Executed as user: SERVER\SYSTEM. on ...

SQL Server - To get all connected server names

In SQL Server 2000/2005, I want to get the names of all connected servers. How do I do this? ...

Delete the 'first' record from a table in MS SQL Server, without a WHERE condition

Is it possible to delete the 'first' record from a table in MS SQL Server, without using any WHERE condition and without using a cursor? ...

FREETEXTTABLE Returning Incorrect Rank Result

Hi there, I'm trying to fix a bug with a site search function and have isolated it down to an issue with the FREETEXTTABLE function. I have a the following query: SELECT * FROM dbo.SiteContentForSearch INNER JOIN FREETEXTTABLE(SiteContentForSearch, sSearchText, 'NFC' ) AS SearchResultTable ON dbo.SiteContentForSearch.liSearchID = ...

MySQL vs SQL Server 2005/2008 performance

I intend to start developing an ASP.NET application and I am wondering which database to use. Performance is very important and the database should be able to handle without issues a database of about 50GB. I am wondering however, if a SQL Server license is worth paying for. I have looked for performance and scalability comparisons betwe...

Run Sharepoint 2003 on VMWare?

Our production Sharepoint server serves around 800 users and runs together with its SQL Server on a physical dual-core machine. The network guys now to put as much as possible on VMWare. The Sharepoint server and the SQL Server will be put on different servers. Does anyone have experience of running a production-level Sharepoint serve...

Use "<>" or "!=", or does it really even matter

Duplicate of: Should I use != or <> for not equal in TSQL Within SQL Server's T-SQL should I use "<>" or "!=", or does it really even matter? ...

Trim first two characters from year of GETDATE()

Hello group, I am trying to create a WHERE clause that says WHERE column_1 = TRIM(LEADING '20' FROM(DATEPART(year, GETDATE()))) Basically column_1 contains the fiscal year but the fiscal year is in the database as 8 or 9 not 2008 or 2009. So I need to figure a way to trim off at least the '20' so that the query will run correctly.....

Dynamic SQL Server question

I want to create dymamic SQL code to automatically create a table-replication. I'm stuck on how to make the following code dynamic, so that it's possible to pass in SQL variables and use them in the code. I help myself at the moment with search and replacing the 'TODO:' parts, which is not very nice... Here is the code: DECLARE @sql VA...

question on deploy package to production server

I have etl task that will extract data from Mysql database and load into sqlserver. I created ssis package to perform this job on my local machine. In the source, i used ADO.net with mysql driver. everything works perfectly. but when i move the package file,the dtsx file, to the server which is a 64bit windows 2008 box and execute it, I ...

Using stored procedures results in update statement

I've got a table with two columns(among others): id and created_in_variant and a stored procedure that calculates the created_in_variant value basing on the id. I'd like to do something like this: UPDATE [dbo].[alerts] SET [created_in_variant] = find_root [id] Is there a nice way to do it? ...

Pull Sybase data into SQL Server

I have an ASP.NET app that uses a SQL Server database. I now need to pull data from Sybase ASE into that SQL Server database for my app to consume, and I'm not having any success with my ideas. Has anyone done this? Any ideas/suggestions/tips? ...

SQL Server COMPILE locks?

SQL Server 2000 here. I'm trying to be an interim DBA, but don't know much about the mechanics of a database server, so I'm getting a little stuck. There's a client process that hits three views simultaneously. These three views query a remote server to pull back data. What it looks like is that one of these queries will work, but the...

What role does XML play in modern nTier architectures?

I have seen a lot of job postings for ASP.NET and server engineer positions, and they always seem to list XML and XSLT as one of the skills that is valuable to them. I am wondering what role XML plays in modern systems. How are people using XSLT with XML in nTier systems? ...

What is the fastest way to update many rows of data with different values in sql server

My company recently had a problem where we needed to update 64,000+ rows of data fairly regularly, where each row would be update with unique values. I have come up with a good answer, which I am posting here for others' reference, but also to find feedback if there are other solutions. Clarification : Each row has unique values that a...

SQL Server 2005 stored procedure performance problem

I have the following issue: when a stored proc is called from my application, every now and then (like 1 time out of 1000 calls), it takes 10-30 seconds to finish. Typically, the sproc runs in under a second. It's a fairly simply proc with a single select that ties together a couple of tables. All the table names are set with a (NOLOC...

What is the fastest way to query from a historical EAV database

Standard EAV schema : One column for Entity ID, one for Attribute ID, one for Value ID. Historical EAV schema : Add an additional column(s) for times/date-ranges At run time, certain rows will be excluded. There may be 0, 1, or many rows returned per entity, per attribute. We only want the most recent value for each attribute remainin...

How can I use sp_xml_preparedocument on result of NTEXT query in SQL 2000?

I know NTEXT is going away and that there are larger best-practices issues here (like storing XML in an NTEXT column), but I have a table containing XML from which I need to pluck a attribute value. This should be easy to do using sp_xml_preparedocument but is made more tricky by the fact that you cannot declare a local variable of type ...

How can I search for special characters using Freetext in SQL Server

I have a web page that allows users to search a Question & Answer database table (no its not StackOverflow). The web page accepts the search term from the user and passes it to a stored procedure as a parameter on a SQL Server 2005 database. That sproc does a SELECT on the table in question, using FREETEXT in the WHERE clause to search...

Log shipping

Hi Can any one please, tell me that when we configure log shipping do we have to open a firewall from the destination server to the source server too. Thanks ...