sql-server-2005

Creating and publishing excel file in MOSS 2007 using data from SQL Serer

Hello, I need help in this matter: We have a template of Excel file in which all calculations are already set. User can request a 'report'. Idea is to create a button on our site (SharePoint portal). After clicking on it a new Excel file is generated. This means to get actual data from database (SQL Server 2005 SP2), import them into te...

Why can we not execute a stored procedure inside a function in sql server 2005?

Why can we not execute a stored procedure inside a function when the opposite is possible? ...

how to use shared variable using stored procedure in crystal reports

i have a parent report and it contains a two sub report. * subreport: item which get all fields from store procedure named spGetReportItem. like ItemName ItemQuantity TotalItemCost ab 4 45 dd 6 98 *subreport: Labour which get all fields from store procedure named spGet...

Date difference in SQL Server 2005

Hi, I have two dates of the form Start Date: 2007-03-24, End Date: 2009-06-26 Now I need to find the difference between these two in the below form: 2 years, 3 months and 2 days Can someone please … in SQL Server 2005 ...

SSIS - Can I get the column schema for a flat file source from a database?

We receive a nightly data export from a vendor in the form of about 10 tab-delimited flat file without column headers. In addition, the vendor provides us with the SQL scripts for the database tables so that we can import the files into our system. Unfortunately, the vendor recently changed the schema for the flat files. Each file has ...

Is there any natural join replacement in SQL Server 2005?

Hi, I have two tables which I would like to join by ID field. I was trying to use for this "INNER JOIN". Everything would be good but there are two issues: As a result I receive twice column ID. I have to omit specifying columns which should be displayed under select statement. I would like to use there a *. I red that other sql-s ha...

Remote sql server usage?

I've a user account on a development SQL express on a remote server. This account has all privileges granted to it but when I use SQL express remotely then I'm not able to make changes to tables. If I log into the virtual machine and sign in with same user I can make changes. It says I'm not database owner or system administrator. I thi...

SSIS - Upgrade from 2005 to 2008 - How to set a project property when I don't have a project

I have about 160 SSIS packages that I'm trying to upgrade from 2005 to 2008. When I run SSISUpgrade.exe on them, I get the following error messages on many of the packages: Error 0xc0209303: ...: SSIS Error Code DTS_E_OLEDB_NOPROVIDER_64BIT_ERROR. The requested OLE DB provider MICROSOFT.JET.OLEDB.4.0 is not registered -- perhaps no 64...

SqlBulkCopy From CSV to SQL Datatable

I'm using SQL Server 2005, VB.NET 2005. I want to be able to import a very large excel file into a SQL table called "XYZ" I've done this by doing the following: 1. Save the excel file as csv.(Using SaveAs XLCSV option) 2. Build a datatable "ABC" From CSV.(using ODBC Connection and Select * from '*'.csv command) 3. copy the datatable"...

Need to use query column value in nested subquery

EDIT Sorry for the half post :( It seems I cannot use a column from the parent query in a sub query. How can I refactor this query to get what I need? dbo.func_getRelatedAcnts returns a table of related accounts (all children from a given account). It goes up to the top level parent account of a given account and then selects all ch...

SQL 05 full-text query fails "Specified module could not be found."

I'm running SQL 2005 on Windows XP. I have a database table that has full text searching enabled. I was able to build and even re-build the index. However, when I try to query it like this: Select * from fulltext_english WHERE CONTAINS(page_data, 'causes') I get this error: Msg 7619, Level 16, State 1, Line 1 The execution of a full-...

Do non-clustered indexes slow down inserts?

I'm working in Sql Server 2005. I have an event log table that tracks user actions, and I want to make sure that inserts into the table are as fast as possible. Currently the table doesn't have any indexes. Does adding a single non-clustered index slow down inserts at all? Or is it only clustered indexes that slow down inserts? Or should...

SQL Server add primary key

I have a table that needs to be given a new primary key, as my predecesor used a varchar(8) row as the primary key, and we are having problems with it now. I know how to add the primary key, but am not sure of the correct way to add this new primary key to other tables that have the foreign key. Here is what I have: users table: old...

Help needed in pivoting (SQL Server 2005)

I have a table like ID Grps Vals --- ---- ----- 1 1 1 1 1 3 1 1 45 1 2 23 1 2 34 1 2 66 1 3 10 1 3 17 1 3 77 2 1 144 2 1 344 2 1 555 2 2 11 2 2 22 2 2 33 2 3 55 2 3 67 2 3 77 The desired output being ID Record1 Record2 Record3 --- ------- ----...

How can I make exception handling for all existing SQL server 2005 Stored Procedures, view and functions ?

we have a portal that have SQL server 2005 database that contain about 1750 stored procedures , 250 view and 200 function and 95% of them not have handling exception in their code .. we search about any way that allow us making such a global exception handling in SQL that receive any exception happen in any SP,view or function and stored...

Sub reports find the sub total and grand total of each sub report in the main report

i want to find the grand total from sub report subtotal. i have three subreports. 1. itemreport 2.laborreport 3. machine report. i have find total of that reports using shared variable. like using formula: shared numbervar totalitem=sum({storedprocedrename.columnname}) i have done dis in all the sbreports. now i m want the grand total of...

find the grand total from sub report subtotal

want to find the grand total from sub report subtotal. i have three subreports. 1. itemreport 2.laborreport 3. machine report. i have find total of that reports using shared variable. like using formula: shared numbervar totalitem=sum({storedprocedrename.columnname}) i have done dis in all the sbreports. now i m want the grand total of a...

using delete or update command in a function

can we use delete or update command inside a function in sql server 2005 database or any other database? ...

Calculating age based on date of birth in SQL and C#?

Possible Duplicates: How to calculate age (in years) based on Date of Birth and getDate() How do I calculate someones age in C#? How to calculate the customer age automatically by using their Date of Birth using c# and SQL Server 2005 ...

How can I get all the database names in a sql server instance using tsql?

Hi guys, How can I get all the database names in a sql server instance using tsql? Great thanks. ...