sql-server

Create SQL Server job automatically

Hello everyone, I am writing SQL Server deployment scripts which create SQL Server job automatically on a specific SQL Server server/instance. I have found that I can extract the sql statement which can be used to create SQL Server job automatically by using script job as => Create To. My confusion is that, I find the database name and...

.net non ascii username passwords

Hi, in my web site (c# & sql server) i am trying to enable non ascii username and passwords, (username and password columns are set to NvarChar ) what would be the best aproach to achive this? ...

SQL Queries failing with: The execution of a full-text query failed. "The content index is corrupt."

Suddenly many queries to my SQL Server 2005 database are failing with this SQL error: The execution of a full-text query failed. "The content index is corrupt. Anyone know of a fix? ...

dynamic interval creation in SQL

I have the following problem, that I would like to solve with transact-sql. I have something like this Start | End | Item 1 | 5 | A 3 | 8 | B and I want to create something like Start |End | Item-Combination 1 | 2 | A 3 | 5 | A-B 6 | 8 | B For the Item-Combination concatenation I already thought of...

Transaction log back up when recovery of data is not important.

Hi We have a database that has configuration data in. When the applications are run against it, they basically do lots of calculations and then write some data to file. Unlike normal installations, we do not really need the transaction log. What I mean here is that we could take a backup of the database and use it without applying trans...

Subsonic 3.0.0.5 Migration Row Update

Hi, I want to update a table row and I have a following Code void updatePrimaryPaymentAndSecondaryPaymentSourceTypes() { LookUpDetails lookUpDetail = new LookUpDetails(); var repo = new SimpleRepository("E2Lending", SimpleRepositoryOptions.RunMigrations); lookUpDetail = repo.Single(80); lookUpDetail.Col1Value = "My Checking Account...

Efficient data conversion using .Net

I am working on an application that will need to read tons of records (close to 500,000) from one table and insert them into another set of tables in the same database. I though about using SSIS package for this but our DBAs don't want to use that. Now, I am thinking of a multi-threaded approach. I am thinking that I can have a few th...

How do I join 4+ tables in Access with a combination inner/outer?

I have not been able to find a way to join 4 or more tables using outer join in MSAccess. It works in SQL Server, but not Access. I don't believe it is possible. I have tables A, B, C, D and E. I need to join the tables like so: A left outer join B A left outer join C A inner join D B inner join E Access won't let you use conventiona...

Best Way to Port a SQL Server DB Schema to MySQL

What is the best, simplest way to transfer a SQL Server db to MYSQL? ...

SQL 2005 - Search stored procedures for text (Not all text is being searched)

The following bits of code do not seem to be searching the entire routine definition. Code block 1: select top 50 * from information_schema.routines where routine_definition like '%09/01/2008%' and specific_Name like '%NET' Code Block 2: SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINI...

Mysql migration tool, source parameter string | connection string for sql server

Hi all, I always got failed to "fetching of list failed error" this is my connection string in asp.NET "Data Source=maywood\XSQLSERVER;Initial Catalog=maywood_test;Integrated Security=SSPI" What exactly i should input at Mysql migration tool for source parameter string FYI,'maywood' is my conputer name and i am using sql sevrer 2000. ...

Sql exists copy

Hi, I have a mssql stored procedure question for you experts: I have two tables [table1] which retrieves new entries all the time. I then have another table [table2] which I need to copy the content of [table1] into. I need to check if some of the the rows already exists in [table2], if it do, just update the Update-timestamp of [table...

strange scripts generated by SQL Server when exporting a job

Hello everyone, I am using SQL Server 2008 Enterprise. I am using Management Studio -> Jobs -> Script Job as -> Drop and Create TO feature to generate related sql statement so that from another computer I can import the job. My question is, from the generated sql scripts, from the beginning there is output like this, there is a hard co...

Looking for T-SQL scripts to delete a SQL Job

Hello everyone, If I know the database server name, instance name and the SQL Server job name, how to delete a SQL Server job by its name in a simple way? I am writing scripts which will be called by sqlcmd to delete SQL jobs. Appreciate if anyone could show me a sample? :-) thanks in advance, George ...

T-SQL: Selecting top n characters from a text or ntext column

Consider a scenario where you'd like to pull the last x entries from a table. The column we want contains testimonials about a product. For performance reasons, we only want to grab the first 50 characters from the testimonial. The column is named TestimonialText and is of type text. Consider this condensed snippet of T-SQL: SELECT TOP...

WinForm fat client: Architecture decisions: Did I make the wrong ones?

I have a .NET Winform Click-Once-deployed fat client that talks to three databases, 2 SQL Server databases and a Oracle one. The first SQL Server database, I will call the Master. I wanted add more tables and columns to the Master database but I was told I would not be given rights to do so, that it was non negotiable. So, I decided to ...

Problem setting a computed-column

I am trying to set this col but I get an error: FirstName + (CASE WHEN LEN(FirstName + LastName) > 0 THEN ' ' ELSE '') + LastName ...

How do I UPDATE TOP 5, using a subselect?

Hello: I was surprised to see that the following updated 34 rows...not 5: UPDATE Message SET StatusRawCode = 25 WHERE StatusRawCode in ( Select TOP 5 M2.StatusRawCode From Message as M2 Where M2.StatusRawCode = 5 ) Any ideas on how to pound this into the right shape? Thank you! ...

Select query takes 3 seconds to pull 330 records. Need Optimization

Hi all, I have and normal select query that take nearly 3 seconds to execute (Select * from users). There are only 310 records in the user table. The configuration of the my production server is SQl Server Express Editon Server Configuration : Pentium 4 HT, 3 ghz , 2 GB ram Column Nam Type NULL COMMENTS Column Nam Type NULL...

MSDTC - Error while attempting to establish a secure connection (Standalone)

First off, I don't know if this is possible, but let me describe my scenario. I have a set of WCF services, a SQL Server 2008 Database all running on Windows Server 2008. All of this works fine when I am connected to my LAN, however I am going to be using this box for a demo, and I would like to make it work in standalone mode (ie, not ...