sql-server-2005

SSIS package deployment on SQL server 2005

I followed steps for package deployment on SQL given in MSDN and it was successful. But on deployment where I can see my package and I can schedule it? ...

notepad sql Unicode and Non Unicode

Hi, I have a Microsoft Notepad flate file with data and Vertical Bar as column delimiter. I get following message: cannot convert between unicode and non-unicode string data types It seems it is my nvarchar(max) that creates my problem. I changed to varchar(max); but still the same problem. How do I insert my flate file into my SQL ...

SQL Server Profiler Implementation Using C#/VB.net

I wish to implement Sql Server Profiler in a C#/VB.net application. Does anyone have a good example of how to do this? I have searched on Google but didn't find a good working example. I don't have Sql Server Profiler on my system and also don't have Sql Server (it is on a different system). How do I create Profiler for my self? ...

Linq to Entities : using ToLower() on NText fields

I'm using SQL Server 2005, with a case sensitive database.. In a search function, I need to create a Linq To Entities (L2E) query with a "where" clause that compare several strings with the data in the database with these rules : The comparison is a "Contains" mode, not strict compare : easy as the string's Contains() method is allow...

selecting number of rows from resultset

Suppose a query "select * from employee" returns 80 rows. I need to display middle rows that is from 20th row to 50th row. I know, like to display first 20 rows we have option like "select top 20 * from employee" but if we need middle rows how to get it in MS SQL specifically. I m new to this SQL queries...Can anybody answer to this qu...

Display part of entry

Suppose a query "select streetAdr from Address" returns "236 a1 road" "333 a2 road" and 444 a4 road" as 3 rows. How i can display only "236" "333" and "444" in SQL Server. ...

How can I query the database culture (SQL Server 2005) ?

How can I query the database culture (SQL Server 2005) ? I have problems inserting and getting dates, because the client's servers don't run on the same culture as my developer server. I can adjust the date, but I need to know the server's culture... ...

SQL and multiple statements in stored procedure

I'm working on SQL server 2005 and I have a very simple stored procedure: create PROCEDURE [dbo].[tblTabel_Insert] @ID int, @Code nvarchar(50) = null AS SET NOCOUNT ON; IF EXISTS (SELECT ID, code FROM tblTabel WHERE ID = @ID and code = @Code) UPDATE tblTabel SET ID = @ID,code = @Code WHERE ID = @ID ELSE BEGIN INSERT INTO...

Can not connect to SSIS access denied

I am facing an issue while connecting to SSIS thru Mangament studio. I'm able to connect to SQL engine, Analysis services but not able to connect to SSIS. I use windows authentication. I tried steps given at http://msdn.microsoft.com/en-us/library/aa337083(SQL.90).aspx but no help. On one of the forum I saw that one needs to restart the ...

How to make awkward pivot of sql table in SQL Server 2005?

I have to rotate a given table from an SQL Server but a normal pivot just doesn't work (as far as i tried). So has anybody an idea how to rotate the table into the desired format? Just to make the problem more complicated, the list of given labels can vary and it is possible that a new label name can come into at any given time. Given ...

SQL Server 2005: Why would a delete from a temp table hang forever?

DELETE FROM #tItem_ID WHERE #tItem_ID.Item_ID NOT IN (SELECT DISTINCT Item_ID FROM Item_Keyword JOIN Keyword ON Item_Keyword.Keyword_ID = Keyword.Record_ID WHERE Keyword LIKE @tmpKW) The Keyword is %macaroni%. Both temp tables are 3300...

SQL Server 2005 Blocking Problem (ASYNC_NETWORK_IO)

I am responsible for a third-party application (no access to source) running on IIS and SQL Server 2005 (500 concurrent users, 1TB data, 8 IIS servers). We have recently started to see significant blocking on the database (after months of running this application in production with no problems). This occurs at random intervals during t...

can i expose SSMS 2005 Schema Change Report in sharepoint?

a schema change was made on a production server that generates feeds to our parters, removing two bytes from a field, which clobbered our partner's jobs. my boss wants a notification mechanism to propagate schema changes to everyone, but instead of writing something, id like to get the schema change history report exposed on sharepoint ...

Profiling statements inside a User-Defined Function

I'm trying to use SQL Server Profiler (2005) to track down some application performance problems. One of the calls being made is to a table-valued user-defined function. This function wraps a select that joins several tables together. In SQL Server Profiler, the call to the UDF is logged. However, the select that underlies the UDF isn't...

How do I insert into a unique key into a table?

I want to insert data into a table where I don't know the next unique key that I need. I'm not sure how to format my INSERT query so that the value of the Key field is 1 greater than the maximum value for the key in the table. I know this is a hack, but I'm just running a quick test against a database and need to make sure I always sen...

SQL Server - Multi-Column substring matching

One of my clients is hooked on multi-column substring matching. I understand that Contains and FreeText search for words (and at least in the case of Contains, word prefixes). However, based upon my understanding of this MSDN book, neither of these nor their variants are capable of searching substrings. I have used LIKE rather extensi...

Validate a string in a table in SQL Server - CLR function or T-SQL (Question updated)

I need to check If a column value (string) in SQL server table starts with a small letter and can only contain '_', '-', numbers and alphabets. I know I can use a SQL server CLR function for that. However, I am trying to implement that validation using a scalar UDF and could make very little here...I can use 'NOT LIKE', but I am not sure...

Create a table without columns

Can I create a table without any columns in SQL Server by t-sql? ...

sql server 2000 error, error trying to connect to sql server 2005

i am connecting to sql server 2000 on a remote computer with a dotnet application, but when i try to open the connection it gives the following error: When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections What is this? ...

Query optimization

Hi Team, I am trying to learn SQL query optimization using SQL Server 2005. However, I did not find any practical example where I can improve performance by tweaking query alone. Can you please list some example queries - prior and after optimization? It has to be query tuning – not adding index, not making covering index, not making a...