sql-server

what is DTS/SSIS in SQLSERVER?

Hi what is DTS/SSIS in sqlserver.Can i need to separately Insatll these services. what is use of this DTS/SSIS in sqlserver.How to configure these DTS/SSIS ??? Help me in this regard plzzzz Thanks in advance. ...

Nested transactions in sql server

Does sql server allow nested transactions? If so then whats the priority of transactions? ...

Foreignkey constraint may cause cycles or multiple cascade paths?

I have a problem when i try to add constraints to my tables i get the error: Introducing FOREIGN KEY constraint 'FK74988DB24B3C886' on table 'Employee' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. My constraint is between a Code table and an empl...

How to use Union method or left outer join?

i can not join #Temp with scr_SecuristLog. How can i do it? CREATE TABLE #Temp (VisitingCount int, [Time] int ) DECLARE @DateNow DATETIME,@i int,@Time int set @DateNow='00:00' set @i=1; while(@i<48) begin set @DateNow = DATEADD(minute, 30, @DateNow) set @Time = (datepart(hour,@DateNow)*60+datepart(minute,@D...

Count distinct and Null value is eliminated by an aggregate

I'm using SQL Server 2005. With the query below (simplified from my real query): select a,count(distinct b),sum(a) from (select 1 a,1 b union all select 2,2 union all select 2,null union all select 3,3 union all select 3,null union all select 3,null) a group by a Is there any way to do a count distinct without getting "Warning: Null...

How to generate this sql query?

"0" is VisitingCount ---Numeric Value Datepart, For example: 00:00--1, 00:30--2, 01:00--2, 01:30--3 CREATE TABLE #Temp (VisitingCount int, [Time] int ) DECLARE @DateNow DATETIME,@i int,@Time int set @DateNow='00:00' set @i=1; while(@i<48) begin set @DateNow = DATEADD(minute, 30, @DateNow) set @Time = (datepart...

What indexes optimize this query with four joins?

I have an sql query with inner joins of four tables that takes more than 30 seconds with the current indexes and query structure. I would like to make it as fast as possible; at least faster than 5 seconds. I first thought about denormalizing, but read here that generally it should be possible to optimize via correct indexes etc. I cann...

How will adding DataSources to DatdGrids in my development version of an ASP.NET web application affect deployment?

Hello. I've recently inherited a database driven e-commerce site written in C# ASP.Net, with an MS SQL database. I have had little or no experience with this exact type of application up to this point, although I am comfortable exploring code, and am familiar with SQL query structure and C# (and web mark-up languages too). So far I've be...

whats the difference between a stored procedure and a table valued function?

whats the difference between a stored procedure and a table valued function? they seem to serve the same functions ...

change date Time String to Sql server DateTime data type

how to change these Date Time strings to sql server DateTime Type: "Thu May 07 19:19:27" "Thu May 07 19:19:33" "Thu May 07 19:19:34" "Thu May 07 19:19:34" "Thu May 07 19:19:35" ...

BULK insert error with UNC path and windows Authentication

Hi, I have two servers, One is application server which has webservice and other server is a DB server,which has SQL server 2005 DB. Webservice is a vb.net app and all the input files will be on app server. When my application calls(through webservice) DB server to execute BULK insert statement with UNC path(of app server) using Windows...

How can evaluate more than once data from a query?

CREATE TABLE #Temp (VisitingCount int, [Time] int ) DECLARE @DateNow DATETIME,@i int,@Time int set @DateNow='00:00' set @i=1; while(@i<48) begin set @DateNow = DATEADD(minute, 30, @DateNow) set @Time = (datepart(hour,@DateNow)*60+datepart(minute,@DateNow))/30 insert into #Temp(VisitingCount,[Time]) va...

Mapping a database value to a TimeSpan using dbml

I need to store a time offset in a database column (for example, 12:25 AM, just the time, no date). I would like to use the nice data visual modeling capabilities in Visual Studio 2008 to generate dbml and the code to go with it. The database is Sql Server 2005. Since a TimeSpan is essentially an Int64 (aka long) containing the number ...

how to install sqlserver2005 evaluation on xp sp2 machine

Duplicate http://serverfault.com/questions/7541/how-to-install-sqlserver2005-evaluation-on-xp Hi I am unable to instal SQLSERVER2005 evaluation version on winXp service pack2 machine. iam getting the error such that error 87: dotnet framework 2.0 installation and parameter incorrect. Before run the sqlserver 2005 setup i hav i...

Sum a subquery and group by customer info

I have three tables something like the following: Customer (CustomerID, AddressState) Account (AccountID, CustomerID, OpenedDate) Payment (AccountID, Amount) The Payment table can contain multiple payments for an Account and a Customer can have multiple accounts. What I would like to do is retrieve the total amount of all payments on...

Queue SQL implementation with a single query.

I have an SQL table that looks like: TABLE QUEUE ID DATA POSITION Field POSITION holds the potition of the record relative to a Queue. So, it can be: 0 not in any position (not queued). 1 first in the queue (next in line). > 1 the position in the queue. I need a (MS) SQL query that will move the queue up one position...

what is use of sqlserver analasys services in SQLSERVER2005

Hi What is the use of sqlserver analasys services in sqlserver2005??? where should we use analasys services? how to configure these analasys services?? Thanks in Advance ...

How to solve Conversion failed when converting the nvarchar value?

CREATE TABLE #Temp (VisitingCount int, [Time] int, [Date] nvarchar(50) ) DECLARE @DateNow DATETIME,@i int,@Time int, @Date nvarchar(50) set @DateNow='00:00' set @i=1; while(@i^60;48) begin set @DateNow = DATEADD(minute, 30, @DateNow) set @Time = (datepart(hour,@DateNow)*60+datepart(minute,@DateNow))/30 s...

Pulling database information from gridviews that is not displayed on the gridview

I've created a Gridview control that pulls some data from my database, but doesn't display all of the information I'm hoping it gathers. I choose not to display the primary key for user interface purposes, but require that key for basic operations on the grid. I'm currently attempting to add a "Delete" option to the table, but unfort...

How can i evaluate this table?

i need second table. CREATE TABLE #Temp (VisitingCount int, [Time] int, [Date] nvarchar(50) ) DECLARE @DateNow DATETIME,@i int,@Time int, @Date nvarchar(50) set @DateNow='00:00' set @i=1; while(@i<48) begin set @DateNow = DATEADD(minute, 30, @DateNow) set @Time = (datepart(hour,@DateNow)*60+datepart(minute,@...