sql-server-2005 Questions

8

Solved

I've got a strange situation with some tables in my database starting its IDs from 0, even though TABLE CREATE has IDENTITY(1,1). This is so for some tables, but not for others. It has worked until...

6

Solved

Let's say I have a stored procedure which returns a large set of data. Can I write another query to filter the result of stored procedure? For example: select * from EXEC xp_readerrorlog where L...
Policy asked 21/2, 2012 at 13:35

9

Solved

My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the ...
Sirois asked 19/10, 2008 at 4:27

7

Solved

First I want to thank everyone for helping me, It gave me a lot of ideas on how I should do this and I came up with my own method I just need help putting it into a query I want the user to input a...
Confront asked 22/11, 2010 at 15:33

8

Solved

I currently have a SQL query that returns a number of fields. I need one f the fields to be effectively a sub query sub that. The Problem in detail: If I have a table X with two columns, Module...

16

Solved

I am trying to compare two tables, SQL Server, to verify some data. I want to return all the rows from both tables where data is either in one or the other. In essence, I want to show all the discr...
Splashy asked 16/1, 2010 at 15:22

17

I have a column named sequence. The data in this column looks like 1, 2, 3, 4, 5, 7, 9, 10, 15. I need to find the missing sequence numbers from the table. What SQL query will find the missing seq...
Incorruptible asked 29/6, 2009 at 9:27

7

Solved

I'm writing stored procs that are being called by a legacy system. One of the constraints of the legacy system is that there must be at least one row in the single result set returned from the stor...
Copperplate asked 29/7, 2010 at 18:13

11

Solved

Given a table with a datetime column, how do I query for rows where the date matches the value I specify but ignores the time portion? For example, select * from sales where salesDate = '11/11/201...
Sochor asked 11/11, 2010 at 15:24

32

Solved

Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)? I know that I can either Use a ...
Health asked 31/10, 2008 at 15:6

26

Solved

I know this is almost a duplicate of : The error "Login failed for user 'NT AUTHORITY\IUSR'" in ASP.NET and SQL Server 2008 and Login failed for user 'username' - System.D...

5

Solved

I have a table with INT id and DATETIME date, amongst other fields. Rows are inserted into this table each weekday (not guaranteed), and several other tables use this id as a foreign key. My quest...
Stuck asked 23/11, 2009 at 22:38

2

Solved

If I have an insert statement such as: INSERT INTO MyTable ( Name, Address, PhoneNo ) VALUES ( 'Yatrix', '1234 Address Stuff', '1112223333' ) How do I set @var INT to the new row's identi...
Jevons asked 12/6, 2012 at 15:3

11

Solved

I have been having an issue with using the following: Column_Name BETWEEN @StartDate AND @EndDate. This is because the @EndDate = 00:00:00.000 for the time, which doesn't pick up all the values...
Brahma asked 7/10, 2011 at 19:3

34

Solved

I can't seem to connect to my database from a site. I get this error: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server I tried using the local IP address to connect ...
Lucielucien asked 30/3, 2012 at 14:56

8

Solved

I have two t-sql queries using SqlServer 2005. How can I measure how long it takes for each one to run? Using my stopwatch doesn't cut it.
Pattison asked 26/7, 2012 at 17:49

6

Solved

I have a SQL Server Agent Job that previously had two steps. Today, I've had to integrate the third step, and soon I'll need to integrate a fourth. I want to be sure that the step will execute prop...
Nazi asked 20/6, 2011 at 14:39

9

Solved

I have many .sql files with lots of empty lines, for example, WITH cteTotalSales (SalesPersonID, NetSales) AS ( SELECT SalesPersonID, ROUND(SUM(SubTotal), 2) FROM Sales.SalesOrderHeader ...
Ordway asked 30/4, 2010 at 5:51

7

Solved

Does anyone know the command to check if there is an un-committed transaction in SQL Server 2005?
Moreau asked 11/6, 2009 at 9:22

19

Solved

I've seen similar errors on SO, but I don't find a solution for my problem. I have a SQL query like: SELECT DISTINCT a.maxa , b.mahuyen , a.tenxa , b.tenhuyen , ISNULL(dkcd.tong, 0) AS tongdk...
Disembogue asked 6/9, 2011 at 1:29

9

Solved

How can rows with non-ASCII characters be returned using SQL Server? If you can show how to do it for one column would be great. I am doing something like this now, but it is not working select ...
Larena asked 8/10, 2010 at 14:4

7

How to drop all extended properties on SQL Server in a scriptable way?

10

Solved

My sample query is SELECT D30.SPGD30_LAST_TOUCH_Y from CSPGD30_TRACKING D30 My given date format is like "2013-01-01 00:00:00.000". I need to convert this date format to "mm/dd/yyyy hh:mm AM/P...

6

Solved

Some context: one of the systems I'm working on is a .net 2.0 web application. VB.net for the front end, and SQL Server 2005 for the backend. For a variety of reasons that have been lost to time, t...
Oldenburg asked 23/1, 2009 at 18:18

35

How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp table]? Select all data from BusinessLine into tmpBusLine works fine. select * into t...
Ingenerate asked 17/3, 2009 at 10:45

© 2022 - 2024 — McMap. All rights reserved.