Skip to main content

Questions tagged [sql-server-2005]

Use this tag for questions specific to the 2005 version of Microsoft's SQL Server.

sql-server-2005
388 votes
24 answers
191k views

Are there any disadvantages to always using nvarchar(MAX)?

In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX) rather than specifying a length explicitly, e.g. nvarchar(255)? (Apart from the obvious one that you aren't ...
42 votes
7 answers
64k views

SQL Server: How to list all CLR functions/procedures/objects for assembly

Question: In SQL Server 2005, how can I list all SQL CLR-functions/procedures that use assembly xy (e.g. MyFirstUdp) ? For example a function that lists HelloWorld for query parameter MyFirstUdp ...
1 vote
3 answers
9k views

Improving the SELECT query performance on a large table in SQL Server

Q: How can I improve the performance of my queries? Details: I have one table with 200k records (Sales) and one function getView_sls(@TON_orNPS) Below query takes 10-12 seconds SELECT * FROM Sales ...
11 votes
3 answers
24k views

SSIS 2005 how to resolve the error "input column has lineage id that was not previously used in the data flow task" programmatically

I'm trying to write a program that automatically add columns from the OLE DB Sources in all of the components in a .dtsx file (the target is SSIS 2005). When I process the .dtsx with my program seems ...
7 votes
5 answers
50k views

Divide in SQL Server

In SQL Server 2005 Express, the result is below SELECT 100 / 15 --Result 6 But I wanna get approximate value 7 (like using calculator) 100 / 15 = 6.6666.. How to make it in SQL Server?
2 votes
4 answers
5k views

Delphi - Either BOF or EOF is True, or the current record has been deleted

This error showed when I tried to select on an empty table in MS SQL Server 2005: "either BOF or EOF is True, or the current record has been deleted". I have used TADOConnection and TADODataSet in ...
115 votes
2 answers
251k views

How do I fetch multiple columns for use in a cursor loop?

When I try to run the following SQL snippet inside a cursor loop, set @cmd = N'exec sp_rename ' + @test + N',' + RIGHT(@test,LEN(@test)-3) + '_Pct' + N',''COLUMN''' I get the following ...
182 votes
8 answers
444k views

Alter table add multiple columns ms sql

Can anyone tell me where is the mistake in the following query ALTER TABLE Countries ADD ( HasPhotoInReadyStorage bit, HasPhotoInWorkStorage bit, HasPhotoInMaterialStorage bit, HasText bit); ...
262 votes
6 answers
153k views

How important is the order of columns in indexes?

I've heard that you should put columns that will be the most selective at the beginning of the index declaration. Example: CREATE NONCLUSTERED INDEX MyINDX on Table1 ( MostSelective, ...
2 votes
3 answers
2k views

Two datagridviews in one windows form = not possible to save data to the second datagridview

I create a winform I´m adding a datagridview by dragging a table from data sources the result: I´ve got a winform with a datagridview and a bindingnavigator I´m adding a second datagridview to the ...
111 votes
5 answers
114k views

How can you tell what Tables are taking up the most space in a SQL Server 2005 Database?

How can you tell what Tables are taking up the most space in a SQL Server 2005 Database? I am sure there is some System Stored Procedure that shows this information. I have a TEST database that grew ...
0 votes
1 answer
6k views

update statement in a stored procedure using temp table and real table

I've found many other posts here on how to do this but unsure how to write the initial select statement which checks for the system name and the update statement since there is a temp table involved. ...
389 votes
9 answers
501k views

What represents a double in sql server?

I have a couple of properties in C# which are double and I want to store these in a table in SQL Server, but noticed there is no double type, so what is best to use, decimal or float? This will store ...
0 votes
0 answers
22 views

Locked out of SQL Server 2005 .... User number set to "1" in Enterprise manager? [migrated]

Whilst trying to restore a "master" backup file (on my Windows Server 2003 / SQL Server 2005) machine I've dropped a clanger and re set the number of users from "0" (unlimited) to &...
132 votes
7 answers
122k views

How do I query if a database schema exists

As part of our build process we run a database update script as we deploy code to 4 different environments. Further, since the same query will get added to until we drop a release into production it ...

15 30 50 per page
1
2 3 4 5
1224