sql-server-2005

Aggregating schedule data by start and end times

I have a tricky problem that has had me scratching my head for a little while. I have some data that represents the delivery of "widgets" over a variable number of days, broken down into half hourly slots. For example (apologies for formatting - haven't quite got to grips with it): Date Time NoOfUnits 01-Mar-2010 00:00...

Is there meta data I can read from SQL Server to know the last changed row/table?

We have a database with hundreds of tables. Is there some kind of meta data source in SQL Server that I can programatically query to get the name of the last changed table and row? Or do we need to implement this ourselves with fields in each table called LastChangedDateTime, etc.? ...

how to handle optional parameters in a update stored procedure

I need to write a generic procedure that set value for one column or no of a columns in a table depending on parameters. Any idea how to do it. ...

How can convert 15000000.00 to 15,000,000 in SQL server?

There is a one value 15000000.00 with Numeric datatype in SQL server. How can i get or convert the value 15000000.00 to 15,000,000? ...

TransactionScope works in some places and not in others

Using ASP.NET 3.5, Linq to SQL, SQL Server 2005 on Windows Server 2003. Running VS 2008 on XP SP3 locally. We need to be able to wrap inserts, updates, and deletes in a transaction. When we first tried this by wrapping code blocks with using(var trans = new TransactionScope()) { ...; trans.Complete(); }, we got an appropriate exception ...

Summarising (permanently) data in a SQL table

Geetings, Stackers. I have a huge number of data-points in a SQL table, and I want to summarise them in a way reminiscent of RRD. Assuming a table such as ID | ENTITY_ID | SCORE_DATE | SCORE | SOME_OTHER_DATA ----+-----------+------------+-------+----------------- 1 | A00000001 | 01/01/2010 | 100 | some data 2 | A00000002 | 01...

Sync Framework: Can I syncronise Stored Procedure

Does the sync framework allow me to synchronise (download only) the Store Procedures on a sql server 2008 server with the Stored procedures on the SQL Server 2008 client? i.e. overwrite the SP on the client when the server SP's have been modifed or new ones created? Thanks ...

SQL Server 2005 triggers

I created a trigger on a table for updates. If any update happens, I want to store the old value in separate table. I am trying to get the old value from "inserted" table, but this table is not populated with old values after update. Here is the sample code: CREATE TRIGGER [dbo].[Logs_Update] ON [dbo].[Logs] AFTER UPDATE AS DE...

Sql Server Management Studio Express

how do i convert my sql server management studio express to server authentication mode.. please help regarding this.. ...

Microsoft.ReportingServices.Interfaces.dll missing for SSRS 2005

Hello, I am missing this DLL reference in c:\program files\SQL Server\90\Tools\Binn. I'm assuming that this is because I didn't install the 2005 client. I installed all of the services for 2005, the database instance, reporting services instance, SSAS and SSIS. I installed the 2008 client though, not the 2005 client, and 2008 databas...

SQL to get list of dates as well as days before and after without duplicates

I need to display a list of dates, which I have in a table SELECT mydate AS MyDate, 1 AS DateType FROM myTable WHERE myTable.fkId = @MyFkId; Jan 1, 2010 - 1 Jan 2, 2010 - 1 Jan 10, 2010 - 1 No problem. However, I now need to display the date before and the date after as well with a different DateType. Dec 31, 2009 - 2...

Local Report vs Server report in ASP .Net Report viewer control.

Hello All, In one of the ASP .Net site we are currently working we have a bulk load of SSRS reports. We have forms authentication for the site and reports have already been created and deployed in the report server. We are having so many problems with authentication when we set the report viewer control to access the server report. I...

Is there a set based solution for this problem?

We have a table set up as follows: |ID|EmployeeID|Date |Category |Hours| |1 |1 |1/1/2010 |Vacation Earned|2.0 | |2 |2 |2/12/2010|Vacation Earned|3.0 | |3 |1 |2/4/2010 |Vacation Used |1.0 | |4 |2 |5/18/2010|Vacation Earned|2.0 | |5 |2 |7/23/2010|Vacation Used |4.0 | The business ...

SSRS 2005 giving me "Invalid URI: The format of the URI could not be determined" when trying to customize it

Hello, I'm getting the error "Invalid URI: The format of the URI could not be determined" when customizing it. I've made several changes to the configuration files and UI, but I keep getting this error. It isn't logging it too in the event log nor the log files, which makes it very annoying to debug. So how do I figure out where the ...

MS SQL Bridge Table Constraints

Greetings - I have a table of Articles and a table of Categories. An Article can be used in many Categories, so I have created a table of ArticleCategories like this: BridgeID int (PK) ArticleID int CategoryID int Now, I want to create constraints/relationships such that the ArticleID-CategoryID combinations are unique AND that th...

SQL Server - CAST AND DIVIDE

DECLARE @table table(XYZ VARCHAR(8) , id int) INSERT INTO @table SELECT '4000', 1 UNION ALL SELECT '3.123', 2 UNION ALL SELECT '7.0', 3 UNION ALL SELECT '80000', 4 UNION ALL SELECT NULL, 5 Query: SELECT CASE WHEN PATINDEX('^[0-9]{1,5}[\.][0-9]{1,3}$', XYZ) = 0 THEN XYZ WHEN PATINDEX('^[0-9]{1,8}$',XYZ) = 0 THEN CAS...

String or binary data would be truncated -- Heisenberg problem

When you get this error, the first thing you ask is, which column? Unfortunately, SQL Server is no help here. So you start doing trial and error. Well, right now I have a statement like: INSERT tbl (A, B, C, D, E, F, G) SELECT A, B * 2, C, D, E, q.F, G FROM tbl ,othertable q WHERE etc etc Note that Some values are modifi...

Is Lucene.net good choice for website search of 1M item product database? (giving up on SQL Server 2005 Full Text Search)

We currently have in production SQL Server 2005 and we use it's full text search for a eCommerce site search of a million product database. I've optimized it as much as possible (I think) and we're still seeing search times of five seconds. (We don't need site scrawl or PDF (etc.) document indexing features... JUST "Google" speed for s...

Copy SQL 2005 view result column headers?

Is there a way to copy View output column headers along with the data? There is a setting in Options to include column headers with query results, but that only works with "New Query" and Stored Procedure output. Looks like SSMS 2008 has this functionality built in to the contextual menu when you right click on results, but I only have...

Can we write subquery in between SELECT and FROM

i want to know, how to write subquery in between SELECT and FROM as SELECT Col_Name,(Subquery) From Table_Name Where Some_condition ...