sql-server

Skipped errored rows in bulk insert

Is there a way to do a bulk insert in Sql Server where rows with errors are skipped rather than the whole process failing? I don't mean just keeping those rows inserted prior to the error; I mean inserting all rows that aren't errored. ...

Can a SQL Server stored proc determine its parent proc's name?

If Proc A executes Proc B, is there a way for Proc B to look-up that it was called by A instead of having a parameter where A passes B its ID? Per request: The reason I'm interested in this is multi-fold 1) General knowledge, I'm sure if it can be done it would involve clever use of some system tables/variables that may help me do othe...

How to scan/search for active SQL Server instances with Java?

Is there an easy way, using Java, to scan/search the local network for SQL Server database instances? ...

Select Statement Gets byte[] and string but not XML

In a C# app I am pulling a message off of a SQL service broker queue with the below statement. When attempting to convert the message_body to SqlBytes and other types an exception is thrown. At runtime message_body always seems to begin as type byte[]. Leaving message_body as a byte[] works but I get an exception complaining of an erro...

SQL 2008 deadlocks on simple delete

We're running a very small delete against our events table in SQL 2008 and it randomly creates a deadlock. We cannot recreate it on demand however. The delete statement is good for 2-5 rows max. DELETE FROM Administration_NET.dbo.tblEvents Where EMSaccountID = 'DELE10A' Any ideas? ...

Full text search failing on words with no stop lists

Hi, I am working on MsSQL 2008 server, I disabled all the stoplists that exist SELECT * FROM sys.fulltext_stopwords does not returna nything SELECT * FROM sys.fulltext_stoplists does not return anything either SELECT DISTINCT u.ID, Name FROM University u INNER JOIN CONTAINSTABLE(University, (Name), '"University" AND "of" AND "Phoenix...

Execute SQL Server 7 DTS on SQL Server 2008

I believe its possible to run SQL 2000 DTS packages on 2008 with a compatability layer. But is it possible to do the same with DTS packages created on SQL 7? Is there any MS KB or note that points out if this is even a possibility. ...

how to use market basket analysis (apriori) sql server 2005

I want to finish my final project, my project is about market basket analysis with apriori algorthm. I use C# and SQL server 2005. Can you help me please. I have a saving mart datasets. I am newbie and I don't know step-step how to use market basket analysis on sql server 2005. Please help me. ...

JDBC Connection to SQL Server 2000 reset randomly on Solaris server

Hey all, I have the following method being called in a Java EE web application. public static void submitToPending() { Db db; ResultSet rs; try { db = new Db("Database.properties"); rs = db.issueQuery(getDescriptorList()); while (rs.next()) { db.insertApplicationData(rs.get...

SQL Server Reporting Services 2008 -- Open UNC File Link

Is there a way to open a create a link to a file using SSRS 2008? When I try to select anything other than any http address in the action of text box the "go to url" does not work. ...

Join-Free Table structure for Tags

I'm working on a little blog software, and I'd like to have tags attached to a post. Each Post can have between 0 and infinite Tags, and I wonder if it's possible to do that without having to join tables? As the number of tags is not limited, I can not just create n fields (Tag1 to TagN), so another approach (which is apparently the one...

Replace certain pattern in a long string in MS SQL using T-SQL

Hi all, I have a table in my MS SQL database where it has some incomplete data in a field. This field in question is a varchar field and has about 1000 characters in the field. This string consists of segmentations of words in the format of a forward slash followed by the segment and then ends with a forward slash (i.e. /p/). Each of...

Force @@Servername to return something else in SQL Server

DISCLAIMER: While I'm trying to do this to fool a license enforcement scheme, the company is out of business and I'm only setting up a test server. I don't consider this stealing (as a developer that sells software myself, I wouldn't do that) since I can't pay for another license if I wanted to. However, if the community disagrees, pleas...

Is it good practice to trim whitespace (leading and trailing) when selecting/inserting/updating table field data?

Presuming that the spaces are not important in a field's data, is it good practice to trim off the spaces when inserting, updating or selecting data from the table ? I imagine different databases implement handling of spaces differently, so to avoid that headache, I'm thinking I should disallow leading and trailing spaces in any field d...

SQL 2008: How do I change db schema to dbo

I imported a bunch of tables from an old sql server (2000) to my 2008 database. All the imported tables are prefixed with my username ex: jonathan.MovieData. In the table properties it lists 'jonathan' as the db schema. When I write stored procedures I now have to include 'jonathan.' in front of all the table names which is confusing...

Does an Interrupted UPDATE still manipulate data?

i have fired an 'update' query by mistake. But while processing i canceled the transaction. I want to know during that time of execution and cancellation has any data got manipulated. ...

Numeric comparisons on string column data

i need a help n query "totalexp" is a nvarchar field ... in a table and i need to select like below select EmpId,FirstName,totalexp from sample where totalexp > '6' empid firstname totalexp 1 Me 8.2 5 as 6 10 567 64 mon 11 leader 6+ yrs 12 admintest ...

SQL Server 2005: Need advice on handling multiple-language data in one table column

I'm running SQL Server 2005 and .Net 2.0. I have some tables that need to store data in multiple languages, in the same column. E.g. an Article table, with ArticleID (identity) and ArticleName (nvarchar 100) The data in ArticleName might be in various languages. My database is using the default collation of SQL_Latin1_General_CP1_CI_AS,...

Clustered index

Is this true that Update SQL Query is slow because of Clustered index?????? ...

How should I write my WHERE clause in SQL Server for the following case?

I have a SQL table with two columns Date and User and contains the following rows: **Date User** 2009-02-20 Danny 2009-02-20 Matthew 2009-02-15 William 2009-02-15 Abner 2009-12-14 Joseph 1900-01-01 Adam 1900-01-01 Eve Given a date, how should I write my WHERE clause to return a list of u...