Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > august 2006 > threads for monday august 14

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Ntext optimization!
Posted by SqlBeginner at 8/14/2006 8:12:02 PM
Hi All, I have created a DB design for implementing WIKI in one of my project. I have created a column of data type NText to store the content of the wiki page. Normally ppl would store the wiki pages as flat files but since my project work on a web farm scenario I need to save the contents...more >>


Comparing current year and previous year data
Posted by Robert Bravery at 8/14/2006 7:29:57 PM
HI all I have a table that holds reporting data, there is a value field and a report year field. I would like to have the values of current year and previous year and the difference of a particular product on one line. BAsically similar to a pivot I gues where the sumamry is on the value colum...more >>

complicated loop query
Posted by ashley.sql NO[at]SPAM gmail.com at 8/14/2006 7:01:23 PM
I have some data like this create table sample_data (id int identity (1, 1), transaction_type int, profit_loss int ) insert into sample_data values (10, 200) insert into sample_data values (11, -20) insert into sample_data values (12, 100) insert into sample_data values ...more >>

Scheduled execution of batch SQL statements
Posted by panda at 8/14/2006 6:57:01 PM
Hi, Is it possible to store a set of SQL statements (generated on the fly through server side scripting) to be executed at a certain time? I was thinking of storing a series of statments in a table to be executed at a later time using SQL server agent. Is there a function in SQL server ...more >>

creating table with correlations ........
Posted by ashley.sql NO[at]SPAM gmail.com at 8/14/2006 6:13:36 PM
I want to create a table which has co-relation among one column ID Say I have values in a column A, B, C, D, E, and F there is this relation between them A B C D E F A 1 3 4 5 2 7 B 1 C 1 D 1 E 1 F 1 This means co-relation between A, B is ...more >>

Very Slow Results using a Table Variable with "WHERE IN" statement
Posted by Mike at 8/14/2006 6:04:32 PM
I have a stored proc that I need to pass in a comma delimited string. In the sp I am calling a function (ParseString) to create a table variable with the comma delimited values. I need to then use this table variable in my select statements. I must return a single row back to the applicatio...more >>

transaction question MSSQL2005
Posted by V T at 8/14/2006 4:26:43 PM
Hello, Is it possible to create a mechanism where stored procedure is automatically called by the event of ending/committing of any transaction regardless to it's source (something like a trigger ON_ANY_TRANSACTION_END) ? Thank you, VT ...more >>

Disallowed implicit conversion from data type varchar to data type money
Posted by gv at 8/14/2006 4:18:37 PM
Hi all, I keep getting this error, and the problem is the Minutes column? Disallowed implicit conversion from data type varchar to data type money, table 'tempdb.dbo.##tmp, column 'Minutes'. Use the CONVERT function to run this query. I'm basically adding the Column names of a table to ...more >>



Alter Stored Procedure?
Posted by xezo at 8/14/2006 3:11:11 PM
Hi, when I modify (do some changes and save) stored procedure from SQL Server Enterprise Manager does server keep any trace about this changes? In table dbo.sysobjects there is field 'crdate' with date of creation of stored procedure but I'm wondering is there anywhere date of modification o...more >>

INSERT only 1 using SELECT
Posted by David at 8/14/2006 3:11:06 PM
I have the following INSERT command but I only want to insert 1 record when I run it. Can anyone help me with the WHERE clause or? Thanks. -David INSERT INTO product ([prod_seq_nbr]) SELECT MAX([prod_seq_nbr])+1 As NextID FROM product ...more >>

sql 2005 Q:How to create script of all Stored Procedures
Posted by Merdaad at 8/14/2006 3:03:02 PM
Since we can't backup sql2005 to sql2000, I need to copy all objects from 2005 to 2000. I have already exported all data successfully, but how do you export Stored procedures/functions/ triggers etc. Normally I would creat a script of SPs and FUNCs and run the script file in SQL2000 QA, bu...more >>

Gather DB growth stats for all DBs on all servers, centrally
Posted by Rob at 8/14/2006 2:32:01 PM
Hi, My apologies in advance for this lengthy message. But I've tried to include as much information as possible here incase the scenario needs to be recreated. Our previous DBA had created a stored procedure to gather stats on the data and allocated file sizes for all DBs on a few server...more >>

Tricky SELECT problem with WHERE and HAVING
Posted by Stephane at 8/14/2006 2:19:02 PM
Hi, I'm having problem bulding the right SQL select with tricky conditions. For example, let's say I want the number of objets by date where (object name is 'something' and the number of command with this object greater than 5) OR (object name is 'something else' and the number of command ...more >>

Can you restore a SQL2005 backup on SQL2000 Database?
Posted by Merdaad at 8/14/2006 2:09:01 PM
I am having trouble restore a backup of a 2005 SQL database to a 2000 SQL database? Any ideas? The error I get is: "The backed-up database has on-disk structure version 611. The server supports version 539 and can not restore or upgrade this database. RESTORE FILELIST is terminating ab...more >>

recovery from rougue update question
Posted by Rus at 8/14/2006 1:32:02 PM
Inadvertently issued an update against an entire table instead of a single row. Anyone have any ideas on a method for rolling back that transaction from the log - to keep me from having to restore of the .bak? ...more >>

Problem inserting Chinese Yuan character
Posted by eric.goforth NO[at]SPAM gmail.com at 8/14/2006 1:13:55 PM
Hello, I'm running SQL 8.0 on my local box and I'm having problems inserting a Chinese Yuan character into a record in a table: If I do the following in query analyzer: INSERT INTO MYTable ('=E5=85=83', 'CNY', 1, 'Chinese Yuan') And run an VB6/ASP application that uses the field it doe...more >>

Error in recordset
Posted by DarkHades at 8/14/2006 12:28:19 PM
Greetings everyone, I'm having a lil problem with a stored procedure. It always returns twice the same results and I can't figure out why. If anyone have spare time and can have a look, I would be very grateful. Here's the proc : =============================================== SET QUOT...more >>

cursor within a cursor
Posted by Rob at 8/14/2006 11:34:02 AM
Can a cursor be declared within a cursor? If yes, then is there anything one need to be aware of when implementing it. Essentially, I'd like to use a cursor to go through each row of one table (containing server names) and then for each server, open another cursor to execute commands to run...more >>

Using #Temp Tables?
Posted by Steve, Putman at 8/14/2006 11:31:12 AM
Hi SQL gurus, We have a very complecated query using many tables. To keep it simple we are doing query and puting the result to a #temp table. Then use the #temp table to another query and puting it to #temp2. Then again do the same process until we get the result. It is very difficuult t...more >>

Leading Zeros
Posted by Bryan Hughes at 8/14/2006 11:06:47 AM
Hello, I need to do a rowcount (this part is no problem) but on the retrun value, I need it to always be four digits long (0001 > 9999), this will then be part of a varchar. What is the best way to do this? Thanks for the help Bryan ...more >>

Case Statement help
Posted by Sudha at 8/14/2006 11:06:03 AM
Hi, I have a table which has doc_id and presc_type_code.presc_type_code can be 'B' or 'G' I want the count of prescriptions by docid and by type code.I know this can be done using case statements rather than subqueries but I am stuck. The output should be docid,noofgenerics,noofbrands. ...more >>

"Login failed" for non-domain machine??
Posted by Crash at 8/14/2006 10:50:43 AM
Windows 2000 ..NET 2.0 SQL Server 2005 ADO.NET We have a database on one of our domain servers. When I try to connect to the database via a SQL Server login from any machine in our domain everything works fine... However when I try to connect to the database from a non-domain machine ...more >>

select statement question
Posted by philip at 8/14/2006 10:30:05 AM
hello, i have a following table with image data type CREATE TABLE Pictures ( picture_id INT PRIMARY KEY, picture_name VARCHAR(20), picture IMAGE ) some of a rows may have picture data and some are not. my question is, how can i use a select statement to retreive the output of the foll...more >>

basic question
Posted by CSharpguy at 8/14/2006 10:14:02 AM
I'm not sure if this is the correct forum or not, but I have a basic question. Currently we have are doing calculations via stored procedures and then returning the results back to the client in either a web page or a winForm style application. There are times that the stored procedure takes ...more >>

sql update query
Posted by amjad at 8/14/2006 8:32:02 AM
Hi i am using slq server 2000 i want to create update query like that update A set A.col1=B.Col1 where a.col2=b.col2 i used in access like that update A,B set A.col1=B.Col1 where a.col2=b.col2 works fine but with sql server its not working when i use above query its gave me error....more >>

BETWEEN operator - cursed to be slow?
Posted by Fredrik Johansson at 8/14/2006 8:18:02 AM
Hello! I have a table (tblBlocks) that looks something like this: startIpNum endIpNum locId 1 3 1 4 424 2 425 424 3 ..... startIpNum and endIpNum represents a range that needs to be looked up in order to fi...more >>

Wht are brackets () so important?
Posted by Jon at 8/14/2006 7:37:02 AM
Hello all, Having finally getting a query to run, I discovered it was down to some () around an AND. This is the particular line: ([ExpireDate] is null or [ExpireDate] > @TheDateToday) Without the (), the query will not run. Why is that please? Please not, that the above is 1 of a...more >>

Query comparison
Posted by kidders at 8/14/2006 7:33:45 AM
Guys, Been working on a search function, after testing had a few results that didn't quite add up so wandered if you would have a look. The result that doesn't seem to add up is when you try the the below. I've put two examples in there (it says how to comment each out to run them), one wit...more >>

trees and hierarchies
Posted by dave NO[at]SPAM bigcompany.com at 8/14/2006 7:05:02 AM
i have read, and think i understand, some of the stuff on traversing and sorting trees and hierarchies using sql. The CTE seems the cleanest method, but a while loop like this one: http://www.sqlteam.com/item.asp?ItemID=8866 is also interesting... however, i have to do something like this on ...more >>

New to SQL prog
Posted by hades5k NO[at]SPAM gmail.com at 8/14/2006 6:49:00 AM
Hello, I need help for the following task and I'm new to this. At first, I made it using C# and doing like 3 recordsets, then parse them to build new recordsets and filter to build the final result. But it's too long and I decided to make a stored procedure which could return the result. If s...more >>

local variable in select stmt
Posted by Rob at 8/14/2006 6:45:02 AM
Hi, I'm trying to run the following stmt... declare @server_name nvarchar(50) set @server_name='ABC' declare c1 cursor for select name from @server_name.master.dbo.sysdatabases ::::::::::::::::: ....where in the select stmt of my cursor, the server_name is ref. by its local variable....more >>

Multiple items in one where clause
Posted by jamesharrop2000 NO[at]SPAM yahoo.co.uk at 8/14/2006 5:16:34 AM
Hi, I'm having a little trouble with this query select * from tblv10lcustomer cu inner join tblv10laccount ca on cacustomer.id = cu.customer.id where surname = ('Capper','Jones','Webb') and (groupid = '45') the error that i get is: Server: Msg 170, level 15, State 1, Line 4 Incorre...more >>

xp_sendmail Missing Header Info
Posted by Ahsen Shah at 8/14/2006 2:37:01 AM
Hi All, I am at the end for plausable reasons as to why Running XP_SendMail in a Scheduled Job should miss out the header information Code is a s follows ... Exec master..xp_sendmail @recipients = 'ashah@phonesforall.co.uk', @subject = 'Agent No Sale Reason Report', @message = 'Please See...more >>

Parameterized Cursor
Posted by JP at 8/14/2006 2:13:02 AM
Hi, How do we pass a parameter to the cursor ? cursor cursor1(p_sid number) select * from table_1 where ssid = p_sid; open cursor1(10); In the above psuedo example the parameter is passed to the cursor at the time of opening the cursor. p_sid is the parameter passed to the cursor ...more >>

Get first row from group by
Posted by Delorean at 8/14/2006 1:02:29 AM
Hi I need a hint for getting <Interfaces> <Properties> identity from table, that have the highest <Priority>, <Group level> and <Role level>. like SELECT TOP 1 (for each interface) .... ORDER BY <Priority> (DESC), <Group level> (DESC), <Role level> (DESC) Interface Properties Priority...more >>

DUPLICATE PROBLEM
Posted by Savas Ates at 8/14/2006 12:00:00 AM
I have some records like that Name email age John a@b.com 12 Veli a@b.com 15 Merry x@y.com 12 Kent d@a.com 10 I want to eliminate duplicate records in email column.. However I also want to have other records which i...more >>

Unique ID
Posted by John at 8/14/2006 12:00:00 AM
Not sure if this is a mental block or i'm just thick lol I have a query SQL MAX(Revision) as Revision, ln, Version FROM VP WHERE (ln='L0016885') AND (Status <> 'Deleted') GROUP BY lv, Version This return an expected slection set like Revision ln Version 0 ...more >>

Connection options
Posted by simonZ at 8/14/2006 12:00:00 AM
When I create some stored procedure in enterprise manager and then edit the syntax in sql query analyzer, I always get the folloewing 2 lines in front of procedure: SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO ALTER PROCEDURE ..... Why? Because this 2 options are set to OFF...more >>


DevelopmentNow Blog