sql-server-2005

Is there any way to view whitespace in the query editor for SQL Server Management Studio Express 2005?

I have it enabled in Visual Studio 2008, but I'd really like to enable this feature in SQL Server Management Studio 2005 Express. Does anyone know if its possible? Maybe in a later version? EDIT: Sorry, I meant specifically in the text/query editor. ...

Native XML WebService Without Authentication

So this my first question here, let's look how it works. I'm working on a project, which has to to provide a "Native XML WebService" on a SQL Server 2005. The web service and the WSDL generation works fine. But there are troubles with the authentication. Is it possible to turn the authentication off? And if so how? ...

Native XML WebService With Authentication Basic and SSL

I'm using SQL Server 2005 and the Native XML WebServices. The integrated authentication via HTTP:80 works fine. But i need the basic authentication which requires SSL. So if i change the web service to ssl i always get a connection reset (101). I tried several ports 80,443,9999 with the same outcome. What is the error? --EXEC sp_delete...

what is the diffrence between truncate and delete in sql server?

can anybody provide me list of all diffrences between truncate and delete in SQL server? ...

can we have a stored procedure with output parameters and return statement?

Hi,Can a stored procedure have output parameters and return statement? If so can anybody give me a simple example.thank you all. ...

Sqldatareader and rowcount

Hi, I have a query: declare @Code nvarchar(100) select @Code="BMW" select name from NewCars where code=@Code if @@rowcount = 0 Select name from OldCars where code=@Code In Sql managment studio first part give me 0 resuklts, and second 1 one result, and that is ok, but in sqldatareader I use the same query ofcource without: declare @...

Is there any page blocking system in reports preview?

In report preview, if i want see the data only in even pages or odd pages or if i want check the even pages only. Is it possible or not? If it's possible could u plz tell me how to do that? ...

problem adding a where clause to a T-sql LEFT OUTER JOIN query

SELECT TOP (100) PERCENT dbo.EmployeeInfo.id, MIN(dbo.EmployeeInfo.EmpNo) AS EmpNo, SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken FROM dbo.EmployeeInfo LEFT OUTER JOIN dbo.LeaveApplications ON dbo.EmployeeInfo.id = dbo.LeaveApplications.EmployeeID WHERE (YEAR(dbo.LeaveApplications.ApplicationDate) = YEA...

How do you unit test your T-SQL

How do you unit test your T-SQL? Which libraries/tools do you use? What percentage of your code is covered by unit tests and how do you measure it? How do you decide which modules to unit test first? Do you think the time and effort which you invested in your unit testing harness has paid off or not? If you do not use unit testing, ca...

Convert query with system objects from SQL 2000 to 2005/2008

I have some SQL I need to get working on SQL 2005/2008. The SQL is from SQL 2000 and uses some system objects to make it work. master.dbo.spt_provider_types master.dbo.syscharsets systypes syscolumns sysobjects I know SQL 2005 does no longer use system tables and I can get the same information from views, but I am looking for a solut...

More efficient left join of big table

Hello, I have the following (simplified) query select P.peopleID, P.peopleName, ED.DataNumber from peopleTable P left outer join ( select PE.peopleID, PE.DataNumber from formElements FE inner join peopleExtra PE on PE.ElementID = FE.FormElementID where FE.FormComponentID = 42 ) ED on ED....

View all functions from the Sql Database?

How can i view all the functions (build in) in sql database using sql management studio? ...

SSRS 2005: How do I make available varbinary data for download in a report?

Hi, SSRS newbie question here... I have a table where one column is varbinary(max) data. I would like to make a report that makes this data available for download as a hyperlink so the user can just click on the item and get a file download dialog for the binary data. In this particular case, the binary data happens to be the content o...

populate object graph from database

Hi, I would like to know the best way to populate an object that has a collection of child objects and each child object may inturn have a collection of objects, from database without making multiple calls to the database to get child objects for each object. basically in hierarchical format something like for example a customer has o...

How to parse a date from an SSIS Excel filename

I want to use the foreach container to iterate through a folder matching something like: "Filename_MMYYYY.xls". That's easy enough to do; but I can't seem to find a way to parse the MMYYYY from the filename and add it to a variable (or something) that i can use as a lookup field for my DimDate table. It seems possible with a flat file ...

How to install SQL Server 2005 Express with pre-existing SQL Server 2008

I have a 32-bit XP with VS 2008 and SQL Server 2008, both Full and Express databases. I am trying to install SS 2005 Express and I get errors when I do saying that 2008 Express is a newer version. How do I uninstall 2008 Express? ...

SQL Server union selects built dynamically from list of words

I need to count occurrence of a list of words across all records in a given table. If I only had 1 word, I could do this: select count(id) as NumRecs where essay like '%word%' But my list could be hundreds or thousands of words, and I don't want to create hundreds or thousands of sql requests serially; that seems silly. I had a though...

Is there a way to select nth column in a SELECT clause from a table/view

I've this GIGANTIC view with several hundred columns and I need to select 114th column something like: SELECT "144" FROM MyView; PS: Obviously, I don't know the name of the column. I just copied the results row into an Excel file, searched for a particular value that is in EJ column so I want to select all rows showing only nth column...

How does DateTime.Now affect query plan caching in SQL Server?

Question: Does passing DateTime.Now as a parameter to a proc prevent SQL Server from caching the query plan? If so, then is the web app missing out on huge performance gains? Possible Solution: I thought DateTime.Today.AddDays(1) would be a possible solution. It would pass the same end-date to the sql proc (per day). And the user wou...

SQL Server 2008 update one column with a value based on number words in other

Columns Words, WordsCount For each value of Words "x y z" update wordscount with 3 , "a b" with 2, "a b c d" with 4 and etc... How can I do it with/without .Net program ? ...