sql-server

Search Query - SQL Server 2005 - Ideas - Knowledge Sharing

Currently I am designing a database schema where one table will contains details about all students of a university. I am thinking the way how can I create the search engine query for administrators where they will search for students. (Some properties are Age, Location, Name, Surname etc etc) (approx 20 properties - 1 table) My idea i...

Using .Net 3.5 assemblies SQL 2005 CLR?

I have a CLR stored procedure that references an assembly created in VS 2008 that uses Linq. Lets call this assembly 'MyLib'. I can't seem to get 'MyLib' into my SQL 2005 database. I do the following: CREATE ASSEMBLY [MyLib] FROM 'C:\MyLib\bin\Release\MyLib.dll' WITH PERMISSION_SET = UNSAFE GO But I get the error: Assembly 'My...

Do any ORM frameworks support cross-database/cross-server joins?

I have two servers: Server A: MySql Table A key-a foreign-key-b Server B: MsSql Table B key-b foreign-key-a Presumably I have two objects with methods that handle the relationships: TableA->getRelatedTableB(); TableB->getRelatedTableA(); This is easy to implement in most ORMs. But what if I want to get a large set of objec...

Oracle Proc to SQL Reporting Services: character set name is not recognized

A few months ago Oracle queries stopped working on our reporting services server after a service pack on the reporting server. I ended up having to grant permissions on Oracle directories to eliminate the first error and then renamed the NLS_LANG registry entry (effectively deleting it) to get rid of the second error. The old value was...

T-SQL Syntax, What are all usages of the @ sign?

What are all of the different usages of the @ sign in T-SQL? btw, this was an interview question. @var (variable) @@identity (system variable) What are others? ...

Sql Server Migration tool not quite working

I was finally able to get the schema correct on both sides. Im ready to run the final step and.... Data migration started.... Data migration failed... System.Data.OracleClient requires Oracle client software version 8.1.7 se I have done ever suggestion on google known to man 1) install oracle client 10.2 and remove 10.1 2) add "authent...

Adding a column to excel table

Hi All, I am trying to add a New column to my exisitng excel sheet programatically(From SSIS- SQL Server Integration Services). can some one tell me how to do it.. thanks ...

LINQ deletion - Can delete one way, can't using Single enumerable

This works: var i = (from x in db.Test where x.Id == 1 select x).First(); db.Test.DeleteOnSubmit(i); db.SubmitChanges(); I get a cast error for this (int/string): var i = db.Test.Single(x => x.Id == 1); db.Test.DeleteOnSubmit(i); db.SubmitChanges(); I was also able to make an update using Single sucesssfully on the same ta...

SQL 2005 Merge Replication and Transaction Logs

Hello, I have multiple databases using merge replication with , @publication_compatibility_level = N'90RTM', @replicate_ddl = 1. I have a backup job on the publisher database that does a full backup nightly. I have another job that backs up the transaction log every 3 hours and runs DBCC SHRINKFILE (N'TheDatabaseName_Log' ) on the publ...

Linq To Sql: Exception "String must be exactly one character long"

Consider a SQL Server table defined with a varchar(1) NULL field. It's being used to store a gender character. Some rows have data, some not: either null or blank. Granted the blanks SHOULD be nulls, but consider that blank is a valid value here. I'd much prefer the value to be null. ID Gender 1 'M' 4 'M' 3 '' 4 ...

Selecting multiple tables from single table by distinct column value in stored procedure

I have a bit of a conundrum I need to deal with, and I'm trying to find a good solution to it. I'm using MS SQL server 2005, and given a table where a uniqueidentifier column contains a data key to other information on the server. What I need to do is select every row in this datatable (sproc from ASP.NET), but separated into tables ba...

Does column order matter when creating statistics for Microsoft SQL Server?

The Database Engine Tuning Advisor has recommended the creation of some statistics for several of our queries. Turns out that some of these are the same just the column order is different in the CREATE STATISTICS command. For example: CREATE STATISTICS [StatName1] ON [dbo].table1 CREATE STATISTICS [StatName2] ON [dbo].table1 are the...

ASP.NET/SQL Server hosting

I'm looking for an ASP.NET and SQL Server host for a site I'm developing. Here's the important caveat though: I have a backup of a SQL database (.bak file) and need to be able to restore this database on the host. Can someone refer me to a host where I have enough control over SQL Server that I can restore a database .bak file? ...

How to use EzAPI to save a SSIS Cache Transformation to a file for later use

I am attempting to use EzAPI to develop packages for Microsoft SQL Server Integration Services. In almost all cases, things work very well. However I am having trouble developing a package and data flow that reads from a SQL Server data source, passes the data to a Cache Tranform for caching and routes in into a Cache Connection manage...

Why does the order of join clauses affect the query plan in SQL Server?

I am building a view in SQL Server 2000 (and 2005) and I've noticed that the order of the join statements greatly affects the execution plan and speed of the query. select sr.WTSASessionRangeID, -- bunch of other columns from WTSAVW_UserSessionRange us inner join WTSA_SessionRange sr on sr.WTSASessionRangeID = us.WTSASessionRang...

How do I do nested transactions in NHibernate?

Can I do nested transactions in NHibernate, and how do I implement them? I'm using SQL Server 2008, so support is definitely in the DBMS. I find that if I try something like this: using (var outerTX = UnitOfWork.Current.BeginTransaction()) { using (var nestedTX = UnitOfWork.Current.BeginTransaction()) { ... do stuff ...

Lookup Value - Persistant storage

Our application has 200+ screens. Each screen displays 2 to 10+ lists. List data are static information and are not subjected to change often. List types across screens are categorically similar with few specific lists. Such specific list contains more than 1000 entries. Intended dev. environment : win app. using .net 2005, ms sql ...

Mapping XML data type with NHibernate

I have some columns in my database (MS SQL Server 2005) which use the data type XML. Can these be mapped as XML objects in NHibernate? My app is .NET 3.5 so I have access to both XDocument and XmlDocument which I can use but I don't know whether NHibernate will support it. If it doesn't does anyone have a good suggestion on how to supp...

Help Needed in SQL Query

Dear Friend, Below is my SQL Query which run against 30000000 rows and its takes 6 minutes to run indexes are defiened to the all columns used in the where clause as wll as inner join Please help me SELECT auditData.id,nstmp.ProviderMaster_ID as CDRComment,Auditdata.Calltypetag from Auditdata AuditData inner join NoSeriesMaster_t...

SQL Server 2005 recursive query with loops in data - is it possible?

I've got a standard boss/subordinate employee table. I need to select a boss (specified by ID) and all his subordinates (and their subrodinates, etc). Unfortunately the real world data has some loops in it (for example, both company owners have each other set as their boss). The simple recursive query with a CTE chokes on this (maximum r...