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 > february 2007 > threads for tuesday february 20

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

how to execute stored procs thro C application?
Posted by prince at 2/20/2007 11:46:00 PM
Hi, I am trying to configure log shipping feature thro programming. So I have to write a C application to all these, can anyone tell me how to execute the stored procedures thro C application. thanks and regards prince...more >>

SP checking if running under a job? and if so, getting jobname and jobid?
Posted by jobs at 2/20/2007 10:34:59 PM
Is it possible for an SP to check to see if it's running as job, and if so, get it's own jobname and jobid? Also curious, does any know, is it possible to use ssis variables to set the connection, operation and file type settings in an ssis ftp task or must those items be preset? ...more >>

Dummy Names Database
Posted by Patrick Rouse at 2/20/2007 9:20:15 PM
Anyone know where I can find a list of dummy names and addresses that I can to replace real customer data for a test database? -- Patrick C. Rouse Microsoft MVP - Terminal Server Provision Networks VIP Citrix Technology Professional President - Session Computing Solutions, LLC http://www...more >>

Does mirroring solve my problem?
Posted by alex77ander77 at 2/20/2007 8:49:53 PM
Hello everyone, I'm not sure if considering mirroring will solve my problems here. Here is my scenario. I have a web application installed on 2 servers, A and B. Each of these servers also runs SQL Server 2005 SP1. I want redundancy via Replication or Mirroring, however, there are 2 possible ...more >>

job agent with ftp job running ssis ftp task .. passing parameters
Posted by jobs at 2/20/2007 8:37:30 PM
Can someone tell me if this is possible? Create an SSIS package with a single ftp task. Create a job in the agent that runs SSIS package. Somehow, pass that job all the ftp parameters at run time? At a high level, how do we do this? Thank you. ...more >>

Query to split Firstname Lastname into 2 fields
Posted by Anthony Smith at 2/20/2007 7:23:01 PM
Good Afternoon Everyone, I hope everyone is doing GREAT today. I've got a database where my customers First and Last name are in ONE field (ContactName), and we are upgrading to another SQL application that actually has (2) seperate fields, FirstName and LastName. Does anyone know how I can ...more >>

using store procedure
Posted by Roy Goldhammer at 2/20/2007 5:57:12 PM
Hello there I have sql sentance which has 4 tables join one each other I need to add filter to the result according to user request. For that i found 2 ways to do that: 1. Create store procedure with paranaters that use sql sentance with where condition including case statement: WHERE...more >>

Can I use snippet in SQL Server management Studio like Visual Stud
Posted by Junior at 2/20/2007 5:45:18 PM
Someone knows If there is a way to use snippet code or somethink similar in SQL Server Management Studio like the new Visual Studio 2005? Thanks ...more >>



Storing variable values whilst using cursors
Posted by archanapatelwhite NO[at]SPAM googlemail.com at 2/20/2007 5:44:37 PM
Hi below is the code I am using. ------------------------------------ SET NOCOUNT ON DECLARE @emailid varchar(50), @rastype varchar(50), @message varchar(80) declare @allrastypes varchar(200) DECLARE email_cursor CURSOR FOR SELECT distinct Email FROM dbo.tblMaintCustomer ORDER BY Emai...more >>

how to prevent field type 'money' to round value?
Posted by michel at 2/20/2007 5:17:26 PM
Hi, i defined a field as 'money' (and then as 'smallmoney'). When i insert a non integer value in that field, it's rounded: e.g. if i insert 17,95, it becomes 18,0000 in the table. Any way to prevent That? thanks michel ...more >>

Altering column width
Posted by jeffc at 2/20/2007 5:06:26 PM
Not a lot of SQL experience here. Trying to alter a column width (character). Normal ANSII SQL ALTER statements do not seem to apply. How is this accomplished in MSoft SQL? thx ...more >>

SQL Express SP2
Posted by Michael Tissington at 2/20/2007 4:23:48 PM
Any idea when this will be available - the link still take you to SP1 Express. ...more >>

Query Help
Posted by Mangler at 2/20/2007 4:05:33 PM
Here are the tables: /****** Object: Table [dbo].[prod] Script Date: 02/20/2007 18:58:03 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[prod]( [idseed] [int] IDENTITY(1,1) NOT NULL, [idlot] [int] NULL, [part] [varchar](50) COLLA...more >>

bulk insert does not work over unc to unix file system not working.
Posted by jobs at 2/20/2007 3:33:46 PM
I have a unc path which points to a unix file system. I am able to access the file in question from the windows run command on the db server as the same user that sql server services are started as. However when I try to load the file as follows: ALTER PROCEDURE [dbo].[DT_sp] ( @READO...more >>

SQL Express SP2
Posted by Aaron Bertrand [SQL Server MVP] at 2/20/2007 3:32:19 PM
Please fix your clock. ...more >>

Deferred Name Resolution and Compilation
Posted by CTS_DBA at 2/20/2007 2:25:08 PM
Hi ALL, I have a case where SQL server not behaving according to what it says in BOL. In this case SQL 2005 behaves as it should be but not 2000 our servers are SQL 2000 with SP4 EE when I compile a SP with an non existance column in the select statment ( it's in the select list as well as i...more >>

"use" statement
Posted by Crash at 2/20/2007 1:29:43 PM
Is there any way that I can supply a variable to the "use" statement? Aka I would like to do something like this in a batch script: declare @DBName sysname set @DBName = 'MyDatabase' ... use @DBName Is there any way to acheive this effect in a batch script?? ...more >>

Cursor in SQL 2005 Triggers
Posted by dlander525 NO[at]SPAM yahoo.com at 2/20/2007 1:09:03 PM
Beginning in SQL 6.5, we have been using PowerDesigner to generate triggers in our database. To keep the triggers as generic as possible, we have broken the business rules out into separate procedures to be called by the trigger. To deal with batch processing, we declare a cursor in the trigger ...more >>

Get Sequence number of Rows
Posted by mavrick_101 at 2/20/2007 12:51:02 PM
Is there a way that I can get sequence number of the rows returned by the query? For example if the query returns 10 rows. I want to have a column in the result set which would tell the order number of the row. Thanks for your help....more >>

quick way to delete millions of records
Posted by Lee at 2/20/2007 12:35:28 PM
Hi Is there a quick way to delete millions of records from a table? I have a SP where I pass through a ID value which performs a simple: DELETE FROM table WHERE id=<ID> but this action takes a lot time. I cant truncate the table as it contains data I need to keep. The ID column is in...more >>

Cascade Issue
Posted by IT at 2/20/2007 12:34:02 PM
I have 2 tables A and Table B respectively: Table A: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[aa]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[aa]( [aa1] [int] NOT NULL, [aa2] [int] NULL, [...more >>

Newbie performance question
Posted by Flomo Togba Kwele at 2/20/2007 11:39:21 AM
I delete an item from table A (contains 5 rows) whose identity column is a foreign key in table B with about 2.25 million rows. This operation takes about 79K reads according to the profiler. The execution plan uses a Clustered Index Delete on table A at 84% cost and a Clustered Index Scan ...more >>

SQL 2005 Replication Agent Jobs
Posted by Crash at 2/20/2007 11:11:33 AM
SQL Server 2005 SP2 Windows 2000 SP4 Merge replication with client pull subscriptions Hi, Questions about replication agent jobs: 1) We changed a password on the user account that we run our agent jobs under. In management studio I clicked on the "Change Replication Passwords" butt...more >>

SSIS Parameters to queries... any way to do this?
Posted by Sean Aitken at 2/20/2007 9:41:07 AM
Good afternoon, pardon me if this is the wrong group, but I couldn't find a SSIS specific one. So, I have a package with some data transform tasks. These tasks move data to a destination server for a certain date range. Instead of hard coding the date range in the query, does anyone know of a wa...more >>

Stored Procedure VS. Query Analyzer
Posted by Magnum at 2/20/2007 9:01:10 AM
I have a stored procedure that joins 4 tables with an if statement wrapped around the SQL statement. When I run the query in Query Analyzer, it takes less than a second, but when I run it as a stored procedure it takes over a minute. I have tried sp_recompile, but it made no difference. Any...more >>

Trying to get process id
Posted by mike at 2/20/2007 8:48:20 AM
Is there a simple way to get the current process id? I'm trying to log usernames for certain actions taken, and was going to use something similar to this: INSERT INTO [User Log] SELECT loginame FROM sysprocesses WHERE spid = ???...more >>

How to not include similar entries
Posted by Kat at 2/20/2007 8:33:59 AM
I want to create a list of clients and their preferred phone number, and not get the phone numbers that are not preferred. For instance, ClientA may have a home phone and a business phone, but the home phone being the one the client wants us to try first. So my list would be: aClient, 444...more >>

CLR vs Windows Forms DLL
Posted by barrettpaulj NO[at]SPAM gmail.com at 2/20/2007 8:16:40 AM
I wrote a some crypto wrappers into a dll for use in our vb6 app and for abstraction for when we migrate to a pure .net app. In the dll I created the following hash routine. Original function from dll: /// <summary> /// Use to hash strings quickly returning a base 64 string. /// /// <...more >>

SqlDependency Compile Problem
Posted by GlassGuy at 2/20/2007 6:45:12 AM
I have an MFC application and am not very experianced with managed code. I am trying to create a class to block waiting for a change in SQL data. Here is my .cpp file that contains the code. I am compiling with /clr. When I compile I receive an error. If I use the constructor that has no ...more >>

Update Statistics
Posted by FARRUKH at 2/20/2007 6:25:10 AM
when we use Update Statistics and how we use it. I tried to use but diodnt work Farrukh...more >>

saving sql scripts as ANSI instead of UniCode
Posted by Henrik Staun Poulsen at 2/20/2007 6:14:30 AM
One of my coleagues Management Studio saves new sql scripts as UniCode, where as mine save a new file as ANSI encoded. This is causing problems when we want to check files out of Source Safe, and apply the files to a new server. I have looked all over Management Studio setup, and been unable t...more >>

How can I do this? (No T-SQL allowed)
Posted by cbmeeks at 2/20/2007 5:33:19 AM
I might be in the wrong place but I have a problem that I just can't seem to answer. Let's say I have a table that contains: Sku Lot === === SKU1 LOTA SKU1 LOTA SKU2 LOTA SKU2 LOTB Notice how SKU1 is only in ONE lot (LOTA) b...more >>

Very Complicated Query
Posted by Hadidi at 2/20/2007 5:31:18 AM
Hi All , I have a table named Table1 consists of 3 columns : 1-UserID 2-ProductID 3-NumOfTimesSold Ex : the record : ( 12 --- 5 --- 240 ) indicates that the user(12) has sold 240 piece of the product no. 5 //PrimaryKey is the composition of Column1 & Column2 the desired query is ...more >>

SQL Database Engine
Posted by sachinnshah NO[at]SPAM gmail.com at 2/20/2007 5:21:11 AM
Hi, I want to find out number of SQL Server database engine running in my network ? I want to write code in VB but can you just give me idea? Regards, Sachin ...more >>

autonumber column
Posted by Chris at 2/20/2007 5:17:08 AM
I have simple statement: select something1, something2 from table As the output I get table with 2 columns. Is it possible to add 3rd column with autonumber? I.e index 1,2,3...N?...more >>

Stand Alone Machine
Posted by Ricky at 2/20/2007 3:20:00 AM
Is it possible to run SQL Server 2005 on a stand alone machine and still be able access all the features? Thanks, -- Ricky Rickard, Jr....more >>

Provider Performance C++ and .Net
Posted by Fredrik Nilsson at 2/20/2007 3:10:28 AM
We are testing to see whether or not to use C++ or .Net ADO to access a SQL Server 2005. The test consists of accessing a stored procedure that inserts a string “testing”. All the test shows that the .Net out performs the C++ implementation. This seems a little strange at first, but after ...more >>

Help with this problem
Posted by Paul at 2/20/2007 2:27:39 AM
Hello All DDL ================================================================================== set nocount on declare @LeaveTable table (LeaveID int IDENTITY (1, 1) NOT NULL ,EmployeeID int ,LeaveTypeID int ,LeaveSubTypeID int ,LeaveStartDate datetime ,LeaveEndDate datetime ...more >>

INSERT Triggers
Posted by NH at 2/20/2007 2:11:05 AM
Hi I have a simple fraud detection process which I run on a transaction table. It is simply; 'INSERT INTO fraudhistorytable SELECT accountnumber, transactionID, GetDate() FROM transactiontable WHERE <various conditions>' Most of the time, there are no results to insert, so nothing actua...more >>

VS 2005 and SSRS 2000
Posted by Mike P at 2/20/2007 2:00:38 AM
I have just purchased a new laptop with Vista OS, and I have VS 2005 installed for all my development. What I want to know is, is it possible to create Reporting Services 2000 reports in VS 2005? My web host still only supports RS 2000, so since I am not planning to install VS 2003, I need to ...more >>

Function as a default value that needs an input parameter
Posted by W1ld0ne74 at 2/20/2007 2:00:00 AM
We have a need to use a custom written function which takes an input parameter as a default value in a table. Is this possible at all? Any help would be much apreciated. Thanks David...more >>

visual sourcesafe
Posted by farshad at 2/20/2007 1:42:08 AM
Hi, How is it possible to link the stored procedures in sql server to Source Safe? The idea is that if anyone goes to sql server and wants to change a stored procedure, he has to check out/in, etc... Just like the way it is done is Visual studio with Source safe. Thanks...more >>

sorting problem on varchar type
Posted by santiago at 2/20/2007 12:16:42 AM
i am having a problem in sorting a varchar column numerically. suppose i have a table called customers which has columns customerID, customerName where both customerID and customerName are of varchar type now the values for customerID are like: 1 2 3 4 1A 2A 3A 4A 11A 22A 111A ...more >>

ORDER BY time of a column
Posted by luna at 2/20/2007 12:00:00 AM
Is it possible to order by time eg the column contains 01/02/2007 09:00 03/02/2007 10:00 05/02/2007 08:00 06/02/2007 07:00 results would be 06/02/2007 07:00 05/02/2007 08:00 01/02/2007 09:00 03/02/2007 10:00 cheers mark ...more >>

"Search" SQL Statement (MSSQL 2005).
Posted by Jorgen [DK/2600] at 2/20/2007 12:00:00 AM
Hi, how do I do a simple formula, which will search a field for special characters and return a value. If it finds "%" - it returns 1 else If it finds "?" it returns 2 end If this is the incorrect newsgroups, please direct me to the correct one regards Jorgen ...more >>

SQL Mobile TSQL Error, Please explain.
Posted by iKiLL at 2/20/2007 12:00:00 AM
hi All I am new to SQL Mobile and i am not sure about the different rulez relating to SQL. i have tried the following query in 2 different ways and i get the same error. What i am trying to do is fill a Data Set on the a Windows Mobile 5 PDA using CF2.0 SELECT Orders.OrderID, (Custome...more >>

Truncate a field after it finds character.
Posted by Jorgen [DK/2600] at 2/20/2007 12:00:00 AM
Hi, another problem I have is that have compounded fields in my sql table. Example product@customer I need a simple function to return "customer", so it should return the value after "@", unfortunate "@" will sometimes be character number 6, sometimes character number 7 etc. regar...more >>

Year to Date - SELECT statement
Posted by magix at 2/20/2007 12:00:00 AM
Hi, I want to find the total of count for the 1st week of sales from January 1st until the input month and year (Year to Date) For example: The input month is June (6), and input year is 2006. then I want to find the total sales for the 1st week of every month until June. How the SQL ...more >>


DevelopmentNow Blog