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 > january 2007 > threads for wednesday january 10

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

Bizarre slow query problem (again)
Posted by wizofaus NO[at]SPAM hotmail.com at 1/10/2007 9:44:57 PM
I previously posted about a problem where it seemed that changing the case of the word "BY" in a SELECT query was causing it to run much much faster. Now I've hit the same thing again, where basically almost any change I make to how the query is executed (so that it still performs the same fu...more >>


Columns in table of Object Browser of Query Analyzer
Posted by hon123456 at 1/10/2007 9:00:27 PM
Dear all, In object browser of Query Analyzer, When I right click a table and open it, some columns are displayed as (.....), I think the column is too long for displaying,can I set something to let the Object browser display this too long columns. Thanks. ...more >>

Comparing horizontal and vertical data
Posted by Larry Killen at 1/10/2007 8:37:28 PM
I am working with data from two tables. The first table is the individual weights of product at each station in a food processing process. There may be 3 to 4000 records in a shift and are comprised of 24 stations. The second table is the sums of all the weighs at the scale. There is only ...more >>

How to write this complex update statement?
Posted by Stephane at 1/10/2007 8:15:00 PM
Hi, I'm trying to do something tricky and I was wondering if it's possible to do it in a single update statement without using cursors. Here's the thing: Let's say we have this table date userId TimeSpan -------------------------- 1:00 1 1:01 2 1:03 1 1:10 2 1...more >>

Auditing and IP addresses
Posted by PBsoft at 1/10/2007 8:10:59 PM
In a database I created an audit table in which, e.g., I insert one record for each INSERT statement made on another table (via a trigger). My problem is to recover remote IP address of the connected client which does the INSERT. I tried to use DMV sys.dm_exec_connections because it contai...more >>

HOW TO: Use Parameters with DATEADD
Posted by Edmund at 1/10/2007 6:30:01 PM
Hello all, In SQL2005 I would like to call DATEADD() using parameters for datepart and number. Actually, the number part is easy but the datepart part will not take VARCHAR(2) or CHAR(2) with the 2 character code. Does anyone know how to do this? Thanks ...more >>

Execute a stored procedure from a command line
Posted by research_stuff at 1/10/2007 5:45:37 PM
Is there a way to execute a stored procedure from a command line? Note: I cannot use xp_cmdshell due to security issues. Thanks in advance ...more >>

newbie question on profiler
Posted by John at 1/10/2007 4:41:30 PM
Hi, Is there a way to use SQL Profiler to catpure execution of a specific SP? SQL profiler is giving me too much data while I am only interested in one SP. Thanks, Brian ...more >>



Suppress Repeating Data in SQL Query
Posted by pmarisole at 1/10/2007 4:09:51 PM
I am trying to write a report that displays a hierarchy such as: Director, Manager, Employee I want to suppress the repeating Director, Manager for the employees. This is my code: sSQL = "SELECT FY99Info.MDName, FY99Info.MgrName, FY99Info.firstname, FY99Info.lastname, FY99Info.grade FROM FY9...more >>

bulk insert and openrowset
Posted by JTL at 1/10/2007 3:49:19 PM
i'm having the strangest problem right now and can't seem to figure out what's going on- here's the deal: i'm trying to use the openrowset command, in combination with the bulk insert command to load data from a text file into sql server. the text file im using has a field that can have a ...more >>

Call User Defined Function in WHERE clause
Posted by sa at 1/10/2007 2:40:18 PM
Hi, When I set a variable for a function in sql statement I get error: Here my select statement. SELECT dbo.fGetProductCount as ProductCount FROM Orders WHERE ProductCount > 0 aAnd the error which I get is: Invalid column name 'ProductCount'. If I use function directly in WHE...more >>

Audit Trail
Posted by Robert Bravery at 1/10/2007 2:23:26 PM
Hi all, I need to create some audit trails for out database. The audit trails woll probably be recorded in a single audit table. Can some one point me in the right direction as to how to create this script/trigger Thanks Robert ...more >>

Trigger Issue
Posted by yoshi at 1/10/2007 1:21:42 PM
We have this very strange problem. We've created this trigger that has been running in production for a good while now. We have a .net application on 6 pc's that insert rows into a table which runs the trigger. 5 out of the 6 pc's run great. The application inserts the row and the trigger runs...more >>

Need help in joining a db2 table to sql server
Posted by rk2008 NO[at]SPAM gmail.com at 1/10/2007 1:13:22 PM
I need to join a db2 table to a sql server table and execute the query in sql server. Can anyone suggest any solutions? Thanks, ...more >>

Print Formatting
Posted by Goofy at 1/10/2007 12:17:00 PM
The following print statement as part of a loop, generates the date table as shown below in the messages window of Query Analyser. However, I want the ISOYear date to be close to the date which I am representing the ISO year from like 12/25/08 - 2008 12/26/08 - 2008 How can I acheive th...more >>

Does SQL server read in the whole row then select the columns?
Posted by Someone Else at 1/10/2007 11:41:00 AM
Hi, I've got a really simple question, but no concrete way to test this myself. When I do a select such as "select ColA, ColB, ColC from tblA where PKCol=@filter" will SQL server read the entirity of the row into memory and then pick out the relevant columns, or will it just read the ones I'm...more >>

Incremental Backup?
Posted by Leila at 1/10/2007 11:39:17 AM
Hi, I saw in description of RESTORE HEADERONLY that BackupType column can indicate an incremental backup! Is that different from Differential Backup or Log Backup? Is it new in SQL Server 2005? Thanks in advance, Leila ...more >>

use variable in a view
Posted by Geo at 1/10/2007 11:26:34 AM
Hi guys, SQL server 2000 I have a view which returns info based on amongst other things a week number. Now it appears that the app which inserts the data into the table uses a 1 to 52 week number but sql uses a 1 to 53. my problem is I was using datepart(week,getdate()) to compare the week n...more >>

Must declare scalar variable
Posted by Lasse Edsvik at 1/10/2007 11:08:02 AM
Hello I'm having serious problems with my procedures. For some reason now that we've moved to sql 2005, it complains about variables being scalar. such as this one CREATE FUNCTION [dbo].[MolTest](@MolID int) RETURNS varchar(500) AS BEGIN DECLARE @Molpath varchar(500), @X0 int, @X1...more >>

Rotate a table without hardcoding column names
Posted by sdwebguy at 1/10/2007 11:01:36 AM
My searches for a solution have all led me to the same basic articles and answers with the same examples -- hoping someone can chime in and provide an example that seems more relevant to my case. I have a table that has one column ("isOpen"). It can have anywhere from 1 to 100 rows. isOpen ...more >>

Sql Server 2005 Installation
Posted by S Chapman at 1/10/2007 10:59:44 AM
I have a windows application (written in .Net) that connects to a SqlServer 2005 database. I need to install this application on a user's PC. What components of Sql Server 2005 should I install on the user's computer? The user is not allowed to have query analyser on the machine and the data...more >>

Is it possible to save characters of dfferent encoding into a single database
Posted by Webdiyer at 1/10/2007 10:07:06 AM
Hi,all: I want to build a multi language website, one language is simplified Chinese (gb2312 encoding) and the other is tranditional Chinese (big5 encoding), because they are using different encoding, I'm wondering if it is possible to save both of these characters in a single database? I...more >>

Select statement with UDF
Posted by Mark Goldin at 1/10/2007 9:49:53 AM
I am using SQL 2005. Is there a difference between INNER JOIN with an UDF or CROSS APPLY? Thanks ...more >>

Query
Posted by at 1/10/2007 9:06:31 AM
I am trying to get all backup jobs on a server using the following query but I am getting error. can some one help select sysjobs.name,sysjobschedules.active_start_time ,sysjobschedules.active_end_time from sysjobschedules Join sysjobs on job_id.sysjobs=job_id.sysjobschedules Thanks! ...more >>

how to split row in 2?
Posted by Pawe³ Zalewski at 1/10/2007 8:44:46 AM
Hi, help needed :) i have a row: ex. amount text account in account out 100,00 test 120 230 but i need amount text account 100,00 test 120 100 test -230 Guys please help Paul ...more >>

How to hide connection string details
Posted by Diego at 1/10/2007 6:23:12 AM
Hi, I have developed a .Net Windows application that has to connect a SQL Server database. Currently i am using the following connection string for connecting this database: server=3Dmyserver;database=3Dmydatabase;uid=3Dmyuser;pwd=3Dmypassword Unfortunately this way is actually unsecur...more >>

Issue with Upper case conversion
Posted by rittyta NO[at]SPAM gmail.com at 1/10/2007 5:21:40 AM
Hi everyone, In one of my procedure i want all the data to be entered in upper case to the table. I used UPPER function for that .But still I gets data in lowercase to the table in some cases.....!!! It will be of much help for me if someone can put some suggestions on this Thanks in Adv...more >>

Adding a Column to a RecordSet
Posted by Kirk at 1/10/2007 4:30:08 AM
Hello, I have a stored procedure that gets it's data from a View in SQL server: Select "WO Number", "Part Number", "Complete Date", "WO Quantity" >From [AWO_VIEW] --Select the View Where [Work Center] Like @WorkCenter Order By [Complete Date] ASC I have code in my client app that retur...more >>

List column that the partition scheme uses
Posted by niklas.arbin NO[at]SPAM nordicstation.com at 1/10/2007 1:03:09 AM
Hi, I need some help finding out how to list the column that I have used for the partition scheme when creating my table. as in : create table columns ON MyPartitionScheme(ColumnName) I know how to get the function name, the scheme name but i don't know how to get what column i used...more >>

Array in T-SQL
Posted by ciupaz at 1/10/2007 12:24:09 AM
Hi all, I have a variable like this one: DECLARE @array varchar(1000) SET @array = 'aa-bb-cc-dd-ee-ff-gg' and I'd like to put the values in as many variables, like so: @1 = 'aa' @2 = 'bb' @3 = 'cc' @4 = 'dd' @5 = 'ee' @6 = 'ff' @7 = 'gg' My problem is that I don't know the exact ...more >>


DevelopmentNow Blog