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 > april 2007 > threads for wednesday april 4

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

how to call a function in stored procedure
Posted by surendra kavali at 4/4/2007 11:10:42 PM
Hi i am new to sql, any body please help me here i am explaining where i am getting the problem Creating table: CREATE TABLE OBF_COMPANYNAME ( ROW_NUM INT IDENTITY(1,1) NOT NULL, NAME VARCHAR(255) NOT NULL, ISUSED NUMERIC(1) DEF...more >>

create table primary key clustered Asc
Posted by arhunprhaasath.a NO[at]SPAM gmail.com at 4/4/2007 9:34:37 PM
sqlerver 2005 In create table command Specifies the order in which the column or columns participating in table constraints are sorted. The default is ASC. ex: constraint [pic_company_staff_contacts_ref] primary key clustered ( [ staffcontactID]Asc ) In sql server 2005 cre...more >>

create table primary key clustered asc
Posted by arhunprhaasath.a NO[at]SPAM gmail.com at 4/4/2007 9:22:23 PM
Specifies the order in which the column or columns participating in table constraints are sorted. The default is ASC. ex: create table... constraint [field name] primary key clustered ( [field name] asc ) what's the meaning ? ...more >>

User vs Role Permissions
Posted by Lontae Jones at 4/4/2007 9:08:05 PM
I have altered the Select, Insert, Update, Delete permissions on all objects for my various roles in SQL 2000. The roles are members of Domain groups. Since the Domain groups are users as well do I need to alter there permissions as well or is altering the roles permissions enough. Example ...more >>

Retrieving top row of multiple values
Posted by Ant at 4/4/2007 7:52:03 PM
Hi, I have a recordset of rows. I need to return only the top row for each pair of rows that share the same OpportunityID. I'm using a correlated query to do this but it still returns two rows, even though I'm attempting to return only the top row of each 'double' set. It has a composit...more >>

Capture NT User ID
Posted by bubbles at 4/4/2007 6:41:18 PM
Access front-end, SQL Server 2005 backend. I have users connected to SQL Server via a Microsoft Access user- interface. Connection is via NT login. I want to log users' activities to the database with their userid. How can I capture their NT User ID (via VBA in Access)? Thanks, Bubble...more >>

Problema con encoding en script de SqlServer
Posted by Mario Vázquez at 4/4/2007 5:42:24 PM
Hola, Tengo un problema curioso, que no sé como resolver. Tengo una base de datos en Sql-Server2000. Desde el administrador corporativo genero un script de la base de datos. Guardo el script con la codificaión por defecto (unicode). Desde un programa C# intento ejecutar el script generado d...more >>

Help for an SQL Server 2000 Beginner - DTS Question
Posted by BigO at 4/4/2007 5:10:30 PM
is it possible to create a DTS package to perform the following: 1. Detect the existance of a text file located on a server drive/path 2. When the text file existance is detected, drop a SQL Server 2000 table, then re-create it 3. Load the text file to the table 4 Execute a stored procedure t...more >>



SQL Insert Into Statement
Posted by Doctorjones_md at 4/4/2007 4:08:11 PM
I have an Excel workbook with VBA coded Insert Into statment to upload data to SQL Server. I'm having a problem with the syntax for creating a line continuation in my SQL Insert Into statement. I need to add some Field Names to the statement, but I've reached the max length of the statemen...more >>

SQL 2005 vs. Express
Posted by Al Franz at 4/4/2007 3:46:11 PM
Comparing SQL Server 2005 with SQL Express, are the full SQL Reporting Services included in the Express edition? Is the only limitation of Express the size of the data base you can create? ...more >>

Create table from file
Posted by Mark Goldin at 4/4/2007 2:23:08 PM
Is it possible to create a table with columns described in a text file? Thanks ...more >>

xp_cmdshell
Posted by gv at 4/4/2007 1:54:50 PM
Hi All, Using sql 2000 sp4 The below code returns all files in directory. How do I filter out Null at the end? Why am I getting Null? SET NOCOUNT ON SET @Path='dir E:\Database\CGd\ftp_downloads\DailyUge\' SET @var = '*.bak /b' SET @cmd = @Path + @var EXEC master..xp_cmdshell @cmd SET ...more >>

RESTORE Help
Posted by Greg at 4/4/2007 1:34:07 PM
I have the following VBA Code I use to create a SQL Server Backup file (.bak). strSQL = "BACKUP DATABASE [" & strDatabase & "] " & _ "TO DISK = N'" & strDest & "' " & _ "WITH NOFORMAT, NOINIT, " & _ "name = N'" & strName & "', " & _ "Skip ...more >>

Change to [JOBID] from 2000 to 2005
Posted by Tom Burket at 4/4/2007 1:20:04 PM
We are finally migrating from 2000 to 2005 and in our jobs, we run one T-SQL procedure as our only step. exec ourprocedure 1, [JOBID] and then look up our own custom info about that job when "ourprocedure" runs. This now gets errors at run-time. We have 2005 SP2. I have been reading abou...more >>

How to find out what job is running...
Posted by Leon Shargorodsky at 4/4/2007 1:12:03 PM
I'm running a SQL Trace to determine user activity on the server. It's a simple trace that gathers only EventClass, ApplicationName, UserID, SPID, etc. My ApplicationName field contains this kind of entries for SQL Jobs: SQLAgent - TSQL JobStep (Job 0x91865C9FA3E2F84488869B351CBDA25F : Step 1) ...more >>

Combining a multi-to-one in one table
Posted by junk NO[at]SPAM kevin-amy.com at 4/4/2007 12:29:29 PM
Here's the problem: I need to combine two tables into one recordset Table 1: Contains the PK and a couple of known columns Table 2: Contains the FK to table 1 and can have multiple rows associated to a single row in table 1. What I need is to have table one and table two merge together in...more >>

2005 Developers Edition
Posted by Chris Botha at 4/4/2007 12:09:11 PM
I use 2005 Developers Edition on my XP box. Some times I start getting time-outs, or it slows down a heck of a lot. What is the number of connections limitations or other limitations - someone has a link to a page? IIS may time-out or Management Studio may time-out and if I close VS or M...more >>

Same Query - Different query plans
Posted by subalexei at 4/4/2007 11:14:07 AM
I am running the same query from a .Net webservice and from SQL Management studio on the same server and the same Database. For WebService SQL server constantly chooses a slow query plan (10sec+) but for SSMS it chooses a fast plan (<1sec) - that is visible in Profiler. here is the sql: ...more >>

trigger question
Posted by WebBuilder451 at 4/4/2007 10:42:01 AM
I like to update the value of a column on a table when the matching column of another table get updated gets updated. I would like to update only the matching field so that (psudo code) when field3 of table1 with table1.date=04/04/2007 and customerid=5 gets updated then update table2 w...more >>

HELP!!! ANYONE!!!
Posted by Andre at 4/4/2007 10:34:03 AM
I am having an issue with registering a server using my domain account. My server is running under a domain account called arizona\servsql. The account is in the administrators group on the server and a sysadmin. What I recently did was created a Windows group called arizona\sqlsa and I put th...more >>

Processing Logic / Query Help
Posted by Brian Kudera at 4/4/2007 9:16:02 AM
I'm trying to write a retail system that tracks retails by Store/Upc. Unfortunately the database was already designed by the time I was added to the project. There are six tables involved: 1)Date table holding dates by dateID 2)Store table holding a list of the stores by storeID 3)UPC tabl...more >>

Replacing Carriage Return With Space
Posted by James at 4/4/2007 9:14:11 AM
I have a select query that I import to Excel. when I open it in Excel I notice the rows with a carriage return dont work. Is there a way to replace the carriage return char code with the space char code durnig the execution of my sql select query. Thes steps I am taking are: 1 In query design...more >>

SQL: how to convert time from GMT to EST
Posted by sweetpotatop NO[at]SPAM yahoo.com at 4/4/2007 7:46:15 AM
Hi, In my Database, all date and time are stored in GMT, however, when it is displayed, I need them in EST. How can this be done with Daylight saving time taken into account as well? Thanks in advance. Your help is greatly appreciated. ...more >>

stored procedure in sql 2000
Posted by Ryan at 4/4/2007 7:40:03 AM
I need to create a stored procedure spA whcih executes three stored procedures sp1,sp2 and sp3 as: create procedure spA as begin exec sp1 exec sp2 exec sp3 end The problem i am having is that when sp1 has an error; sp2 and sp3 are never executed. I want to continiue to run next sp r...more >>

Query takes too long to run
Posted by sweetpotatop NO[at]SPAM yahoo.com at 4/4/2007 6:21:43 AM
Hi, I have the following query that runs forever, I wonder how this can be speed up? 1. Can I use INNER JOIN with the following logic? 2. How about indexing? By indexing tblMain.f3 and #tmpTable#.colf3 ? 3. Or the query has to be rewritten? If yes, please advice. 4. Any other advice? up...more >>

Don't see the View alias
Posted by Bidyut Bhattacharjee at 4/4/2007 5:50:07 AM
Hi, When we create views at times we give alias(friendly name) names to columns but the views do not show the column alias, once created, but show the orinigal column name. Is there a way to have the column alias in the view definition and not the actual column name, so that when we query a...more >>

Which are my risks if I use NOLOCK hint inside a transaction?
Posted by Washington Moreira at 4/4/2007 5:42:02 AM
(SQL SERVER 2000) Hi Friends, To be more clear: I have a financial application using Serializable Transaction Isolation Level. In many situations, I need to work with a result set returned from a SELECT statement to do updates based on this result. Which are my risks, if I use with(NOLO...more >>

CLR UDA median ?
Posted by B D Jensen at 4/4/2007 2:41:34 AM
Hi! We try to make an clr uda for the statistical median function, but it don't work - there is problem with the list type. Can anyone help? Greetings Bjorn D Jensen using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Se...more >>

need help switching a boolean value
Posted by Milsnips at 4/4/2007 12:00:00 AM
hi there, what i want to acheieve is the following, in my table i have an "isactive" field, i want to create a sql line something like update tblProducts set isactive = NOT isactive where productID=123....but it doesnt work.. is there any syntax that handles this in sql? thanks, Paul ...more >>

How to prevent accidently deleting or updating whole table
Posted by Jason Huang at 4/4/2007 12:00:00 AM
Hi, In my SQL Server 2000 Database, I'm thinking is there a method to remind me not to accidently UPDATE or DELETE all record in a table? Once upon a time, I should've just updated one row of record in TableA, but I made the mistake and updated every rows in TableA. You can imagine that....more >>

use index in sql server 2005 with Oledb
Posted by kevinniu at 4/4/2007 12:00:00 AM
Hi, I would like to know how to use an index in sql server 2005 in the following situation: I have a table named TAB with an primary key field named ID(identity field). so I have an index PK_TAB. In this table I have hundreds of thousands of records. I have a array of ids (range from t...more >>


DevelopmentNow Blog