sql-server-2005

Job running ssis package gets error : 'The system cannot find the path specified'

Hi I have an ssis package that uses excel files. I am using the Run As with an admin account. when I call it from a batch file it runs fine "C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\DTExec.exe" /SQL "\SOME_SSIS_PACKAGE" /SERVER "MYSERVER,PORT" /DECRYPT "Password" /VALIDATE /REPORTING E when I schedule it as a job, it...

How to get slowest queries on SQL 2005, without requiring compability change?

I was reading this fabulous list of sql dba scripts at http://www.sqldbtools.com/Scripts.aspx, not affiliated with them. And I want to run this query... select top 10 qs.execution_count, st.dbid, DB_NAME(st.dbid) as DbName, st.text from sys.dm_exec_query_stats as qs cross apply sys.dm_exec_sql_text(sql_handle) st order b...

Hide <TR> tag based on Recordset NULL value

I am using a Microsoft SQL Server 2005 stored procedure to post records in an HTML table. In the HTML table, I have rows for the following fields: entry #, open date, description, and owner. Sometimes, the owner field in the db table will be NULL. When this happens, I have ASP response.write "N/A" in the HTML table row correspondin...

Web services and SQL Server 2005

Is it possible to set up SQL Server with a web service to receive and store data bypassing the IIS/ASP.NET layer altogether? I know it's possible to set up a web service via HTTP End Points and such to return requested data but I can't seem to find examples to show the opposite process. ...

Backup DB on Remote SQL Server Express

I need to create a TSQL script to backup a db on a remote SQL Server Express (2005). I have a SQL Server 2005 on another box. Not sure how I can run the script from this SQL Server 2005 to do the backup job. The script is something like this: RESTORE DATABASE [myDB] FROM DISK = N'C:\Tmp\myDB.bak' WITH FILE = 1, NOUNLOAD, STATS =...

Is there an easy way to remove all default values for a SQL database?

I'd like to remove all default values that have been setup in a particular database, is there a script that I can run to do this for all tables in database? Could be a bit time consuming without ... any help would be appreciated! ...

Help understanding SQL Server 2005 execution plan

One of my stored procedure has long execution time (average around 4 to 7 minutes). Now I trying to tweak it an make it run faster. I am looking at execution plan and two things I see that using most of percentage. First is 68% of "Clustered Index Scan" of one main tables for reporting, This table has primary key of two columns and 200...

Attempt at database localization using table-valued functions

Hi ! I'm looking for opinions on the following localization technique: We start with 2 tables: tblProducts : ProductID, Name,Description,SomeAttribute tblProductsLocalization : ProductID,Language,Name,Description and a table-valued function: CREATE FUNCTION [dbo].[LocalizedProducts](@locale nvarchar(50)) RETURNS TABLE AS (SELECT a.P...

Is there a special sp on SQL server 2008 to get a table change script?

Hi there, I wonder how management studio generates the change table scripts each time i change a table, especially when i change the datatype from 'text' to 'varchar(max)'. Peace, Ice Update: Concerning the already given Answers i want to precise my question, after say thank you for your posts. Now, it is like already said, ssms ge...

Can you SELECT WHERE something's LIKE and IN at the same time?

I need to write what I'd like to call a Valley Girl-query. I need to SELECT something that's LIKE IN - something like this: SELECT * FROM Table1 WHERE Name LIKE IN ( SELECT Name FROM Table2 ) The reason for this is I've got a table full of company names, but they're not exactly the same - f.ex. in Table1 it might say "Chrysler Gr...

enable profiler / Traceon after SQL server restart automatically

hi, My client is facing some deadlocks while using our application. I want to track all the deadlocks for my research and to solve the deadlocks. i am currently run the SQL profiler for the event deadlock graph to capture the deadlock scenario. the actual problem is that the SQL server gets restarted every day at 2 am, and the profil...

SQL Server 2005 - Cannot rollback nested transaction

Hi everybody, Sometimes I get the following from SQL Server 2005 when executing a stored procedure: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot roll back T1. No transaction or savepoint of that name was found. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source) at com...

SQL Server 2005 Instance memory allocation and SSIS DTSExec performance

We have multi GB files coming every day to be loaded to SQL Server 2005 instance via SSIS packages. To load those large data files to SQL Server asynchronously, we built multi threaded .NET application. This application uses DTSExec command line executable to invoke SSIS packages. It also instantiate 5 queues and 5 streams for each queue...

SQL reordering Priority row-by-row

I posted an earlier version of this question last week, but after further consideration I realized the situation is a bit more complicated than first described, and I could use some further help: My SQL table has 3 fields that impact my problem: "Priority" as real, Start_Date as datetime, and Furnace_Name as varchar(10). As the user add...

Using MS Access 2003 to connect to SQL Server 2005

My dad built an MS Access Database to do property management. Now he wants to share it with other users over the internet. So I got a hosted SQL Server account at Network Solutions. Now I'm trying to connect the Access 2003 client to a test SQL database using these guidelines from MS: http://office.microsoft.com/en-us/access/HP05274586...

SQL Server select primary key from table where the key contains multiple columns

I am working on a legacy database. I am not able to change the schema :( in a couple of tables the primary key uses multiple columns. In the app I read the data in each row into a table the user then updates the data and I write the data back into the table. Currently I concatenate the various PK columns and store them as a unique id f...

the backup directory registry key is not configured

hi guys, system.data.sqlclient.sqlerror:the backup directory registry key is not configured correctly....i got this error when i try to restore a database in sqlserver 2005....post answer for this.... ...

incorrect syntax near the keyword 'AS'

Why do i receive a syntax error as such: Incorrect syntax near the keyword 'AS' I am using microsoft visual studio 2005 and sql server 2005 string strSql = "SELECT a.MCode, a.NameOfModule, a.Mod_Abbreviation, dt.ModuleCode, dt.Course, dt.Stage, dt.ModuleGrpFrom, dt.ModuleGrpTo, dt.GrpName, dt.GrpType, dt.StaffID, dt.AcadYear, dt.A...

Nhibernate filtering by user defined function output

I'm reasonably new to NHibernate and everything has been going pretty well so far but I've come across a problem I'm not exactly sure of how to go about solving. Basically I need to filter by the output of a User Defined function. If I was writing in SQL this is what I'd write: declare @Latitude decimal declare @Longitude decimal declar...

multiple rows into a multiple columms

Hi , I have one problem, displaying data in columns. I have EX: emptable emp id 1 2 3 4 5 6 7 8 9 10 i want this change in multiple differnt columms, in select query or in store procedure any way 1 2 3 4 5 6 7 8 9 10 Please help in how slove this problem Thanks Raja ...