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 > december 2006 > threads for wednesday december 13

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

string more than 8000 char.
Posted by Manish Sukhija at 12/13/2006 11:31:00 PM
Hi Guys there is one filed in my table which can contain more than 8000 charactor so i defined it as text, it is storing now but when i use this filed into subquery it's giving error like text,ntext and image datatype can not be used in subquery or in aggrigate function... ...more >>


DATETIME from MSSQL
Posted by TBoon at 12/13/2006 10:17:14 PM
I have a vb.net program to read DATETIME column from MSSQL and write to a TXT file. And I notice that the DATETIME format in the TXT file changed according to my machine datetime setting in Regional And Language Option. Why is that so? How do I prevent that? Using vODBCConnection As New Syste...more >>

select the max date
Posted by snyper at 12/13/2006 10:11:12 PM
All, Sql 2000 sp3 Server 2003 sp4 I am having great difficulty selecting the all the columns with the max(projupdatedate). Below is an example of the query I am using. The keys for the table are initid, projid, metricsid. Any help would be greatly appreciated. InitiID projid metricsid p...more >>

select the max date
Posted by snypergva NO[at]SPAM hotmail.com at 12/13/2006 9:51:03 PM
All, Sql 2000 sp3 Server 2003 sp4 InitiativeID projectid metricsid projupdatedate MetricsPlan ------------ ----------- ----------- ------------------------------------------------------ -------------------- 5 15 2 2006-12-13 15:03:37.017 ...more >>

List SQL Instance Names.
Posted by hurricane_number_one NO[at]SPAM yahoo.com at 12/13/2006 9:23:54 PM
How can a get a list of all the named instances on a computer? I tried using: Set oNames = oSQLApp.ListAvailableSQLServers() To get all the servers and then just chop off the instance portion, but this function doesn't return every instance on every machine I've tried it on, sometimes ...more >>

Can you resolve this error?
Posted by pmohans at 12/13/2006 8:56:01 PM
Hi, I am doing bulk copy through Stored procedure from one server to another server Database. These servers are linked server. If i am copying 100 records then 85 records copied successfully, 15 records got the following error "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does no...more >>

Windows lazy write?
Posted by Colin Dawson at 12/13/2006 8:16:32 PM
Hi all. Here's a difficult question. I've reading up on the anatomy of a transaction and have a question about with the transaction log is written to disk. My question is, at the point when SQL Writes a completed command to disk (i.e. flush the Log Cache to disk) does it simply pass the ...more >>

Hierachical Relationships
Posted by JJ at 12/13/2006 7:01:54 PM
I am trying to set up a SQL table with associated stored procedures to be able to have nested 'categories' to any depth on my asp.net site. I need to then be able to retrieve (or move or delete) a particular category and its children (to a specified depth) and display it in a repeater (for exa...more >>



How to do a count within a select query with inner joins?
Posted by zwieback89 via SQLMonster.com at 12/13/2006 6:37:27 PM
Hi, I have a query which returns the subordinates for the ID I pass in the where clauses. SELECT Member_Manager, Member_Subordinate, Owner_DateOfPost, Employee.EmpID, Employee.FirstName + ' ' + dbo.Employee.LastName AS Emp_Name FROM AMP_AllMySubordinates_Postings INNER JOIN Employee O...more >>

Conditional T-SQL Problem
Posted by maxvalery NO[at]SPAM gmail.com at 12/13/2006 6:31:01 PM
Hi, Thanks in advance for any help. In a table tblCustomer (customerName VARCHAR(100), customerSchedule VARCHAR(7)) each customer has a schedule of related reporting tasks. The schedule is entered as 'NMTWRFS', where N stands for Sunday, M - Monday, T - Tuesday, W - Wednesday, R - Thursday,...more >>

Group returend data
Posted by Oren Levy at 12/13/2006 5:10:02 PM
Hi All I have a SQL statement that returns 3 values: ItemNumber, Product Line Number, Product Line Description. ( SELECT dbo.IM1_InventoryMasterfile.ItemNumber as ItemNumber, dbo.IM1_InventoryMasterfile.ProductLine as PL, dbo.IMA_ProductLine.ProductLineDescription as PLDescription ...more >>

Verify a SQL Server 2000 login
Posted by JayKon at 12/13/2006 5:08:02 PM
I have two apps (with two databases) that have user accounts that are identical to the base username in SQL Server (minus the domain) and I've written a procedure that combines them into one list. Then I tried to use sp_helpuser to verify that the user existed in SQL Server (and that the app ...more >>

vb.net app error when running in master..xp_cmdshell
Posted by mike at 12/13/2006 4:24:40 PM
I created a VB.NET app that uses Outlook's COM object. I get an error when I run master..xp_cmdshell 'myprogram.exe' in SQL query analyzer. The error occurs on this line "oOutlook = New Outlook.Application" Unhandled Exception: System.Runtime.InteropServices.COMException (0x8008...more >>

Appending from one column to another for every row in a table
Posted by Simon Harvey at 12/13/2006 4:20:40 PM
Hi there, I need to carry out a database cleaning/maintenance operation whereby I take the text in one column called ShortDescription and add it to the text in a column called AdditionalDetails. I know how to copy from one to the other but that would have the effect of overwriting the va...more >>

Using PIVOT
Posted by Msdn at 12/13/2006 3:53:05 PM
Im using SQL Server 2005 Express Edition and are trying to make a crosstab query, but SQL reports "The PIVOT SQL construct or statement is not supported.". Isnt Pivot supported in Express Editions ? Regards Keld Jakobsen ...more >>

Query works for SQL 2000, But not SQL 2005
Posted by adauti NO[at]SPAM gmail.com at 12/13/2006 2:11:47 PM
I noticed that some queries work in 2000, but not in 2005, for example SELECT columnA, columnB, case when columnC = 'BLAH' then dbo.fn_func(columnD) sum(columnE) FROM TableA GROUP BY columnA, columnB, ...more >>

simple... is this index duplicated?
Posted by Derek at 12/13/2006 1:47:06 PM
i am looking at some indices in a co worker's model and i noticed the following were created table: person_skill index_1 on (personid, skillid) index_2 on (personid) I think that the second index is largely not needed since the first one will cover select statements on personid..... ...more >>

SQL Query Question
Posted by Darobe9926 NO[at]SPAM gmail.com at 12/13/2006 1:26:37 PM
I am very new to writing SQL queries and I have one that has me stumped. The query I need to write is one where I can tell who has access to a building and then when was the last time they entered that building without also returning all of the times that they entered it before that. So kind ...more >>

How to email results from a nested cursor?
Posted by porsche911tt NO[at]SPAM hotmail.com at 12/13/2006 11:10:22 AM
Hi all, I am puzzled as to how to get my results from a nested cursor outputted to an email. I started with an example found in SQL help so using this example (below) will be easier. The cursor outputs exactly what I want; but I don't know how to get that output into the "exec @rc = master...more >>

Error message - cannot be opened. It is in the middle of a restore
Posted by gv at 12/13/2006 10:52:21 AM
Hello all, I keep getting this message on a database that was restored Database 'Mydatabase' cannot be opened. It is in the middle of a restore. It also show (loading next to the database in EM this was the restore command DECLARE @SQL VARCHAR (100) SET @SQL = 'ALTER DATABASE Mydatab...more >>

distinct query
Posted by tburk at 12/13/2006 10:43:26 AM
Why won't this query produce a result? What is the syntax error? SELECT d.ervID, (distinct d.erv_detail_MedicalRecNbr) FROM PSN.ERV.Detail d WHERE erv_fileid > 28 group BY d.erv_detail_MedicalRecNbr , d.ervID the error message states: Msg 156,...more >>

Best Practices -- User table
Posted by dev648237923 at 12/13/2006 10:24:45 AM
We have a simple asp.net application. The user logs in to it (the user logs in to the app only -- never to the sql server which is abstracted by the app and not exposed on the inernet). Is it best practice to have a user (name, password) and profile (other user info) table or can all the user ...more >>

Conceptual question on data import from external sources
Posted by G B at 12/13/2006 10:09:52 AM
I've a situation where we need to dump data from non SQL server sources into our SQL 2005 DB. At the moment there is a SQL server job that runs everynite and bring back the entire data from the external source. In this job the following happens: 1.) the target table/s are truncated 2.) the ...more >>

Create table with data on the fly
Posted by Mark Goldin at 12/13/2006 9:51:18 AM
How create a temp table and populate it with dates for a given period? Thanks ...more >>

Help with sub query
Posted by pxpilot at 12/13/2006 9:32:11 AM
Hi All, I am not a DBA so i was wondering can anyone fix my query... My data looks like this: id date type 1001 1/1/2006 0:00 new 1001 1/2/2006 0:00 update 1001 1/3/2006 0:00 delete 1002 1/5/2006 0:00 new 1002 1/6/2006 0:00 update 1002 1/7/2006 0:00 update 1002 1/8/2006 0...more >>

Multiple Rows from Single Row?
Posted by Orwell at 12/13/2006 8:56:47 AM
I'm hoping somebody can help me with this -- I have a graphics program that needs to have the elements for the graph delivered as individual elements in a result set. In my database, they are all in a single row. Is there anyway, in a single query, to have data from a single row be delivered...more >>

Help with Trigger
Posted by Aranginor at 12/13/2006 6:07:08 AM
I have this trigger that sometimes fires and sometimes does not. Can anyone help me with why? CREATE Trigger POBodyComm On dbo.POBody For Insert, Update As Declare @MyPO char(10) Declare @UPC char(13) Select @MyPO = PONumber From Inserted Select @UPC = UPC From Inserted Update POBody S...more >>

two concurrent insert that have where with "not exists"
Posted by mtczx232 NO[at]SPAM yahoo.com at 12/13/2006 5:58:49 AM
I have table with non unique column (Col1). I have insert query: insert into tbl1(Col1) select 44 from tbl2 where not exists(select Col1 from tbl1 where Col1=44) this Where make sure that two concurrent above queries not insert the set of value 44 simultaneous? ...more >>

run select query on another spID
Posted by mtczx232 NO[at]SPAM yahoo.com at 12/13/2006 4:32:31 AM
I have stored procedure that execute from another connection (by SQL Reporting). the App execute this SP from middle of transaction. I prefer to not use with read UNCOMMIT. Have a way to force this SP to be run on the same process connection (@@spID) that i got by SP parameters? ...more >>

this i dont know??
Posted by 3rk05 at 12/13/2006 1:46:54 AM
use kandidati declare @a as int set @a = 0 while @a < 7 begin select ime, prez from t_a where id_kontakt=@a if (@@rowcount = 1) begin update t_a set ime = rtrim(ime), * errors ??? set prez = rtrim(prez) * errors ??? where id_kontakt = @a end @a = @a + 1 e...more >>

getdate() as unique
Posted by mtczx232 NO[at]SPAM yahoo.com at 12/13/2006 12:58:37 AM
SQL 2005 can i consider to getdate() as unique over other concurrent queries and transactions? I try select top 1 getdate() from supp select top 1 getdate() from supp it's return different results, but I know that it not concurrent query, so this not prove any thing. but select to...more >>

The proper way to get a sort that is by customerID and most recent
Posted by AWIcurrent at 12/13/2006 12:01:01 AM
I have not found the syntax for getting the last visit of a client as the only selected record. I get a nice sort of all visits but then when i do an update, all visits get changed to the latest data. Not good. So I need to get only the last visit of the customer. The row with the requ...more >>

TABLOCK in insert statement
Posted by italic at 12/13/2006 12:00:00 AM
Hi All, I want to use TABLOCK while bulk inserting to the table. My query is INSERT INTO MY_TABLE1 WITH(TABLOCK) Select Col1,Col2,Col3 from MY_TABLE2. I'm receiving syntax error arorund WITH. Any Idea? Thanks ...more >>

How to find and get all Stored Procedures/Functions where a keyword is in?
Posted by Andreas Klemt at 12/13/2006 12:00:00 AM
Hello, how can I find and get all Stored Procedures/Functions where a Keyword is in it like this exec sp_findandget 'keyword' Thanks for any help in advance! Regards Andreas Klemt ...more >>

SUBQUERY PROBLEM WITH ORDER BY
Posted by at 12/13/2006 12:00:00 AM
I have a table for products. I want to get records from db ordered by their Rank if they entered. If they dont entered i want to show them starting from the latest product which i decide by looking at id (primary key) field which has bigger than others. The simple conclusion that If pr...more >>


DevelopmentNow Blog