sql-server

Book/resource recommendation for learning charting with Reporting Services

What books or online resource would you recommend for learning how to do advanced charts and dashboard design with Reporting Services? ...

MS-SQL Server 2005: Initializing a merge subscription with alternate snapshot location

We started some overseas merge replication 1 year ago and everything is going fine till now. My problem is that we have now so much data in our system that any crash on one of the subscriber's servers will be a disaster: reinitialising a subscription the standard way will take days (our connexions are definitely slow, but already very ve...

How to tell using T-SQL whether a SQL server database has the TRUSTWORTHY property set to on or off

The title says it all. ...

View Temporary Table Created from Stored Procedure

I have a stored procedure in SQL 2005. The Stored Procedure is actually creating temporary tables in the beginning of SP and deleting it in the end. I am now debugging the SP in VS 2005. In between the SP i would want to know the contents into the temporary table. Can anybody help in in viewing the contents of the temporary table at run ...

SQL Server and Oracle, which one is better in terms of scalability?

MS SQL Server and Oracle, which one is better in terms of scalability? For example, if the data size reach 500 TB etc. ...

Where can I get some good tutorials about views?

I want to design a view in sql server 2005. Where can I get some good reading materials on this? ...

How to secure MS SSAS 2005 for HTTP remote access via Internet?

We are building an hosted application that uses MS SQL Server Analysis Services 2005 for some of the reporting, specifically OLAP cube browsing. Since it is designed to be used by very large global organizations, security is important. It seems that Microsoft's preferred client tool for browsing OLAP cubes is Excel 2007 and the whole i...

SQL server 2005 numeric precision loss

Hello, Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision. Running the following query on your MSSQL you would get A + B * C expression result to be 0.123457 SELECT A, B, C, A + B * C FROM ( SELECT CAST(0.12345678 AS NUMERIC(24,8)) AS A, CAST(0 AS NUMERIC(...

How do I attach a MSSQL 2000 database with only an MDF file.

I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two databases which were sitting on it. For some unknown reason, the LDF log files are missing. Presumed deleted. I have the mdf files (and in one case an ndf file too) for the databases which used to exist on that server, and I am trying to get t...

Find two consecutive rows

I'm trying to write a query that will pull back the two most recent rows from the Bill table where the Estimated flag is true. The catch is that these need to be consecutive bills. To put it shortly, I need to enter a row in another table if a Bill has been estimated for the last two bill cycles. I'd like to do this without a cursor, ...

How to solve "An attempt to attach an auto-named database for file..." SQL error?

I've got a local .mdf SQL database file that I am using for an integration testing project. Everything works fine on the initial machine I created the project, database, etc. on, but when I try to run the project on another machine I get the following: System.Data.SqlClient.SqlException : A connection was successfully established with t...

Compute Users average weight

I have two tables, Users and DoctorVisit User - UserID - Name DoctorsVisit - UserID - Weight - Date The doctorVisit table contains all the visits a particular user did to the doctor. The user's weight is recorded per visit. Query: Sum up all the Users weight, using the last doctor's visit's numbers. (then divide by number of users ...

Data Comparison

We have a SQL Server table containing Company Name, Address, and Contact name (among others). We regularly receive data files from outside sources that require us to match up against this table. Unfortunately, the data is slightly different since it is coming from a completely different system. For example, we have "123 E. Main St." a...

SQL Server Convert integer to binary string

I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar. For example 5 would be converted to "101" and stored as a varchar. ...

SQL Server Management Studio won't start

A coworker of mine has this problem, apparently after installing Re#, which seems totally irrelevant. But perhaps it isn't. Could not load file or assembly "SqlManagerUi, Version=9.0.242.0..." or one of its dependencies. The module was expected to contain an assembly manifest. (mscorlib). Why is this? Thanks ...

SSIS: How to progmatically direct work flow in dtsx package

I have a SSIS package, which depending on a boolean variable, should either go to a Script Task or an Email task.(Note: the paths are coming from a Script Task) I recall in the old dts designer there was a way to do this via code. What is the proper way to accomplish this in SSIS? ...

Nested SELECT Statement

SQL is not my forte, but I'm working on it - thank you for the replies. I am working on a report that will return the completion percent of services for indiviudals in our contracts. There is a master table "Contracts," each individual Contract can have multiple services from the "services" table, each service has multiple standards fo...

What does "Create Statistics" do in SQL Server 2005?

The Database Tuning Advisor is recommending that I create a bunch of statistics in my Database. I'm something of a SQL n00b, so this was the first time I'd ever come across such a creature. The entry in MSDN was a little obtuse - could someone explain what exactly this does, and why it's a good idea? ...

Retrieve Error text from SQL Server 2000 error

I need help logging errors from T-SQL in SQL Server 2000. We need to log errors that we trap, but are having trouble getting the same information we would have had sitting in front of SQL Server Management Studio. I can get a message without any argument substitution like this: SELECT MSG.description from master.dbo.sysmessages MSG IN...

SQL Query Question - Select * from view or Select col1,col2.....from view

We are using SQL2005 but this question can be for any rdbms. Which is more efficient, when selecting all columns from a view Select * from view or Select col1,col2.....from view ...