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 > june 2006 > threads for tuesday june 27

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

What makes BCP out fast?
Posted by Jack at 6/27/2006 11:44:54 PM
Hi all, I have been doing some programming with VB.NET and SQL-DMO, specifically using BulkExport. What I noticed is that of the three methods I measured, OSQL with select *, BulkExport with DMO and CMD Line BCP - BCP still seems consistently faster than any other method to get data out of a...more >>


Scheduling of snapshot agent
Posted by perhiyar at 6/27/2006 11:13:42 PM
I have replicated a database as a snapshot replication. I have scheduled distribution agent to run at the interval of one hour daily from 9:00 AM to 5:30 PM. Do i also need to schedule snapshot agent accordingly? What will be optimal schedule depending on the scheduling of distribution agent? ...more >>

sp_adduser
Posted by NTuser_Man NO[at]SPAM msn.com at 6/27/2006 8:52:55 PM
I have come to find that for SQL2K the proc sp_adduser uses a security test is_member('dbo'), which is a different test than is_member('db_owner') I realize that being the member of dbo is different than being one of the members of db_owner. But I'm wondering why sp_adduser uses is_member('db...more >>

Error creating login - Incorrect syntax near 'LOGIN'.
Posted by Esha at 6/27/2006 8:30:35 PM
Hi, I am using Sql server 2005 and when I try to create a new login from the sql server mgmnt studio, I get this error. Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'LOGIN'. I have logged in as "sa" and the login statement that I am using is: CREATE LOGIN test W...more >>

Select Statement - Need Help with this
Posted by Mark Moss at 6/27/2006 6:12:10 PM
Ladies / Gentlemen I have the following select statement that works just fine, but I want to add in the DateTimeCreated data field but do not want it to be in the 'Group By'. Any help would be appreciated. Mark Moss SELECT TOP 100 PERCENT SiteID, CustomerID, COUNT...more >>

Division Calc in Column Returns 0's or 1's
Posted by Scott Buerkley at 6/27/2006 3:10:11 PM
I am dividing 2 numbers in a view (View2). The 2 numbers we sums of number calculated in a previous grouped view (View1). The column in View2 that devieds 1 of the numbers by the other, returns either a 0 or a 1 for each record... but they should be actual numbers instead. The divide colu...more >>

CLR performance
Posted by Neil W at 6/27/2006 3:04:25 PM
Does CLR suffer from the same serialization performance overhead that extended stored procedures do? Which is likely to execute faster? Thanks. ...more >>

Indexes - general question
Posted by Griff at 6/27/2006 2:38:14 PM
We have a database that has been in operation for several years now. Periodically, as the data has grown, we've performed index analyses and added new indexes to help boost performance. Is there a way of running some sort of trace on SQL Server to show which indexes were useful but are now ...more >>



How do I make xp_cmdshell transactions run on the client instead of the server
Posted by Randall Arnold at 6/27/2006 1:48:22 PM
Post title says it all. Any ideas? I asked this earlier but it seems to have gotten lost in the shuffle. Randall Arnold ...more >>

'field name' is not a recognized OPTIMIZER LOCK HINTS option
Posted by Dave Sundell at 6/27/2006 1:39:01 PM
I get 'field name' is not a recognized OPTIMIZER LOCK HINTS option when running the following query: select (SELECT listdate FROM DateList2(ejDateBeg, epDateBeg, eeDateBeg, euDateMod, HRTimeStamp) AS ChangeDate FROM tablea Emp INNER JOIN Tableb HR ON Emp.col1...more >>

INSERT
Posted by Kalyan at 6/27/2006 1:21:02 PM
I have a table about 96 million rows, I am trying to insert into another table for some condition, is there anyway to commit every 10000 rows to table. thanks kal...more >>

explanation of update statement
Posted by Vikram Vamshi at 6/27/2006 12:35:47 PM
--begin script if exists (select * from information_schema.tables where table_name = 't1') drop table t1 go create table t1(c1 int, c2 int) insert into t1(c1) values(1) insert into t1(c1) values(2) insert into t1(c1) values(3) insert into t1(c1) values(4) go declare @a int set @a ...more >>

ADO Connection, Enterprise Manager and table locks?
Posted by VMI at 6/27/2006 12:26:02 PM
Does it make sense that when I run a Select query in Enterprise Manager (not query analyzer) an application (using an ADO connection) may not be able to update that same table at the same time? Could it be that the Enterprise Manager locks that table at the moment the query's being run? The p...more >>

Export to text file
Posted by birdbyte NO[at]SPAM gmail.com at 6/27/2006 10:55:08 AM
I'm exporting data from one table (for now) to a fixed width text file. However, the first column of the text file doesn't come from the database. I figured using a constant would be the best way to deal with this, but being new (thrown in) to T-SQL, I'm not sure how to get there. The resulti...more >>

Cannot Trap Specific Errors
Posted by rmcompute at 6/27/2006 10:53:02 AM
I set up the following code to trap errors after each SQL command issued. In the Error_Handler section, I populate an error table which gets exported to Microsoft Access. Up until now it has been working, however, I got an error: "There is already an object named 'TempCalc010' in the databas...more >>

get byte site of a row?
Posted by Smokey Grindle at 6/27/2006 10:20:09 AM
Is it possible in SQL Server 2005 to get how many bytes a row takes up or the data size of a row? and return that as a number? thanks! ...more >>

group by qst
Posted by alto at 6/27/2006 9:43:48 AM
In the following query I want to return as a last column the aggregate max value of the OrderInList field. input >> select *, max(OrderInList) as MaxOrderInList from tbl_activities where Center_ID = 81 and Fiscal_Year = '2006-2007' group by * order by OrderInList output >> Column 'tbl...more >>

xp_sendmail
Posted by Bret at 6/27/2006 9:34:02 AM
When using xp_sendmail, how can the FROM address in Outlook be changed. The following is what my recipients are receiving when they receive email from me using xp_sendmail: (*)NDCO MS Apps Can this be modified? thank you....more >>

Results of SELECT into XML
Posted by Markgoldin at 6/27/2006 9:17:01 AM
Is there a way to get results of a select statement in an xml format? I am using SQL2005. Also what would a good book be to learn SQL2005 xml stuff? Thanks...more >>

Is there an SQL query that will show 1) All logins for a db and...
Posted by Warren at 6/27/2006 8:53:01 AM
The privledges each login has? I know this is all viewable in Enterprise Manager. But is there a query that will show me this? Thanks, Warren...more >>

Timestamp Debugging in SQL 2005
Posted by John Kurtis at 6/27/2006 8:51:02 AM
Im trying to step into a stored proc in Visual Studio 2005/SQL 2005. One of my input paramters is a timestamp datatype. No matter what value I put into that field i get the error: "This input parameter cannot be converted". What am i doing wrong? I've captured the timestamp value directly...more >>

IsNull() / Coalesce() Performance help
Posted by Mark at 6/27/2006 8:39:38 AM
Would the sql gurus out there please come to my rescue? I have an SP that returns all the "events" that are in a specific group. My problem is that I'm also returning how many events are related to a person as well as how many have been sold. The last 2 are left joins. When I use either isn...more >>

Using #s in MS Access Sql string problem
Posted by CW at 6/27/2006 8:29:21 AM
I'm trying to run an sql statement in my .asp page with MSAccess as my dbase, but when trying to run a query to bring up events that are scheduled for today and hereafter, I get a "Too few parameters. Expected 1 " error on my sql string with the following: dim mydate mydate = Date() SE...more >>

Sql 2005 and web services
Posted by raphael.cecchin NO[at]SPAM gmail.com at 6/27/2006 8:02:26 AM
Hi everybody, I would like to call a web service from my sql 2005 in the following way. I have a table, a soon that a new line is inserted into this table I would like that sql calls a the web service. It' this possible? do exist some articles about this? thank you very much ...more >>

DBCC LOG
Posted by Enric at 6/27/2006 8:00:01 AM
Dear all, I would like to do an application. As frontend VB6 and as backend, of course, Sql2k or sql25k. Anyway my main goal is that such application might look for information stored inside .LDF files. Searches and so on will be done by mean DBCC commands as dbcc log and all that sort o...more >>

CASE statement
Posted by RBurns6 NO[at]SPAM gmail.com at 6/27/2006 7:50:26 AM
Trying to calculate a value using a CASE statement - any thoughts? Thanks. SELECT CASE WHEN valuex= '1' THEN (cost * spot) where currency = curr_code as 'VAL' WHEN value1 = '0' THEN THEN (cost/spot) where currency = curr_code as 'VAL' FROM T1 JOIN T2 ON T2.TICKNUM = T1.TICKNUM JOIN ...more >>

Query execution time problem
Posted by pvv30 at 6/27/2006 7:46:03 AM
We are executing following query from query analyzer, SELECT PD_ID, PD_DATA FROM TBL_PROJECT_DETAILS [Table Strcuture => id int, data varchar(500)] This table contains 45000 records. When this query is executed from Query Analyzer locally on the database server, output is returned in 3...more >>

How to escape out single quotes from an T-SQL variable
Posted by David Bowles at 6/27/2006 7:36:02 AM
How do I escape out the single quotes in the T-SQL Variable Assignment appearing below around the comma for setting the FIELDTERMINATOR and the \n setting the ROWTERMINATOR? SET @sql = ' BULK INSERT sandbox.dbo.core_edi FROM ' + @full_filename + ' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR...more >>

Holiday schedule for scheduled DTS Packages
Posted by MartyNg at 6/27/2006 6:55:34 AM
I have scheduled DTS packages that I don't want to run on company holidays. What's an easy way to do this? I have the holidays listed in a table, but am unsure how to make the DTS fail if the current day is in that table. Thanks! ...more >>

Export to text file
Posted by John at 6/27/2006 6:53:02 AM
Is there any built in functions in sql server that allow you to export data from sql server to a flat file without using xp_cmdshell? I would like to do this through an application where the user login wouldn't need sysadmin rights and have the sql server actually create the file similar to...more >>

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
Posted by TG at 6/27/2006 6:27:50 AM
hi! I am using the following query: insert into test_adm_date([adm_date]) select SUBSTRING(LTRIM(RTRIM(a.[adm_date])),5,2) + '/' + RIGHT(LTRIM(RTRIM(a.[adm_date])),2) + '/' + LEFT(LTRIM(RTRIM(a.[adm_date])),4) from [ASES_MI60_Source].[dbo].[CLAIMS_SOURCE_CARRIER] a adm_date varchar (...more >>

Dynamic SQL Help
Posted by Mike Collins at 6/27/2006 6:23:02 AM
I am getting the following error when trying to use dynamic sql. I've tried several ways to fix it, but have not been able to figure it out. Can someone show me how to fix this? Thanks in advance for any help. Error for the following stored procedure: Invalid operator for data type. Operato...more >>

Populating the gaps in a data series
Posted by GAMBIT_UK at 6/27/2006 5:28:03 AM
I've spent ages trying to come up with an elegant solution to this problem, but the only partial solution I've found is slow and cumbersome. I wondered if you had done something similar in the past or could think of a simple and fast solution. Basically I need to create a fact table with the d...more >>

Help on a Query
Posted by Wayne Wengert at 6/27/2006 5:09:03 AM
I have a table (ResidentList) which includes the following fields - ID (autonumber) - Address2 (text) - Area (text) Address2 usually contains an apartment number like "122 GV" but is always blank when Area is "Duplex" Area contains a string like "Glen View", "Northwind", "Duplex", ec. ...more >>

stop SQL insert statement from inserting incorrect datestamp
Posted by Liam Mac at 6/27/2006 3:44:02 AM
Hi All, Can anyone direct me or provide advice on how I can stop my SQL insert or update statement from insert incorrect datestamp when my value is detected as blank? Basically what I'm doing is that I'm looping through a recordset in vb.net application where I have three date fields tha...more >>

Import Design Question
Posted by S Chapman at 6/27/2006 3:01:58 AM
I have at least three tables into which the user can import data. The three tables are 1) Portfolio 2) Account 3) Transactions. The user will provide us three files - one for each entity (in the file) related by a userdefined NUMBER field. These three tables are linked by foreign keys but the ...more >>

INNER JOIN with specific criteria
Posted by carolineh at 6/27/2006 2:24:23 AM
Guys, would appreciate some help here. I am trying to retrieve data, whilst joining to another table. But in this join, the matching on fields should only be done when a certain criteria is met (like in a case statement). Basically here's a sample of what I'm trying to do SELECT Tbl1.Fie...more >>

how do i delete or edit in the JScrollPane
Posted by Jun at 6/27/2006 1:55:07 AM
Hi every1...im new in netbeans so i hope u guys could help me out...tks! the programe tat i work with,the table is created during run-time as it is linked to database(MySQL).i do not know how to do the edit n delete button. -- Jun ------------------------------------------------------...more >>

creating procedures
Posted by meenal at 6/27/2006 12:48:47 AM
I have seen developers create procedures by declaring the variables and others declaring the variables and setting them to null like below. Is one way better that another? CREATE PROCEDURE [dbo].[testsp_InsertIssuerDetails] @issuerId int output, @companyId int = NULL, @issuerName var...more >>

SQL for columnized totals
Posted by Hussain at 6/27/2006 12:41:33 AM
This seems simple, but has me stumped for some time. I have a table that has 3 columns: (Actually lots more, but for illustrative purposes) Date of sale Category of item Amount I only have 4 categories; call them A,B,C & D I am trying to have a SP return montly totals that I can bind to...more >>

Using trigger to update preceding record
Posted by Tim P at 6/27/2006 12:03:02 AM
Hi all I have an asp page written in Dreamweaver 8 which inserts a record into a table tblCaption. On creating a new record I want a procedure - presumably a trigger - to update the preceding record to turn the one char field ClosedYN from F to T (the field's default is F). In other words w...more >>

looping through a recordset
Posted by ricky at 6/27/2006 12:00:00 AM
Hi I am a recordset which I would like to extract a field and make a string from it, by appending values to it. e.g PolicyRef Product C001 M C001 B C001 S C002 N C002 C C002 T Ideally, what I need is the product...more >>

Finding the first available number in a series.
Posted by Geir Holme at 6/27/2006 12:00:00 AM
Hi all. I just want to find the first available number in a serie in an efficient way. Any tips. E.g. I have the values (SeedNumber) in a table. 1, 2, 3, 4, 5, 6, 8, 9, 10........ What SELECT or logic gives me 7 as the answer back. Can this be done without a loop. My serie has ma...more >>

Transfer data
Posted by imtiaz at 6/27/2006 12:00:00 AM
Hi, Which is the best way to transfer data from different locations to head office either entire tables(max 10 tables) or only updated and newly inserted rows on a daily or weekly basis(only head office got fixed ip) Thnx in Advance Imtiaz ...more >>

Record locking? Well... not exactly...
Posted by master at 6/27/2006 12:00:00 AM
Hi... I have just read tons of articles on the (blessed optimistic and condemned pessimistic) record locking and... I feel like I know nothing ;-) Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database ...more >>

Can we connect to SQL server 2000 through Internet using a static IP?
Posted by Peri at 6/27/2006 12:00:00 AM
Dear All, Can we connect to SQL Server 2000 through internet using static ip? We have a static IP in our office and we would like one of our customer to connect to our database using this static IP. Is this possible? Regards, Peri ...more >>

Strange deadlocks
Posted by Erik Tamminga at 6/27/2006 12:00:00 AM
Hi, Environment: - SQL2005 with SP1 - Windows 2003 R2 - VS.NET 2005 We've developed an application consisting of a few background processes (windows services) and a web-based frontend. We are experiencing problems where the web-user is presented an exception informing us about a deadlo...more >>

Importing data from excel
Posted by Robert Bravery at 6/27/2006 12:00:00 AM
Hi all, I use the following to import data from Xl. SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]') This creates a new table. How could I alter this statement to update an existing table Thanks Robe...more >>

DayAdd
Posted by Ivan at 6/27/2006 12:00:00 AM
Dear all, I want to convert the day range from two variable into records. So, I use a While-loop to do so while @CountDate <= @TWorkDate begin .. .. .. -- CountDate = CountDate add one day select @CountDate = DATEADD(day, 1, @CountDate) END When I try to run, it shows the foll...more >>

Help In query
Posted by Shailesh at 6/27/2006 12:00:00 AM
Dear Friends, I have a table which give the following results. Employee_Name Detail_Date TimeSpend Empl1 01/06/2006 6.5 Empl2 01/06/2006 7.58 Empl1 02/06/2006 ...more >>

LIKE wildchars?
Posted by John Smith at 6/27/2006 12:00:00 AM
Which wildchars are allowed with LIKE command? Is question mark ("?") allowed? ...more >>

updating the rest of the rows from an inported XL file
Posted by Robert Bravery at 6/27/2006 12:00:00 AM
Hi all, Im working on inporting data from an XL file. The data however is not setup for databases, obviously. So they would have a value in a row, followed by many blank rows. This would indicate that all following said value is same as said value until another value is encountered, athen the...more >>


DevelopmentNow Blog