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 2006 > threads for thursday february 2

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

Is "SQL Server Management Studio" an OLE Automation Server?
Posted by Frank Lee at 2/2/2006 11:44:11 PM
Is "SQL Server Management Studio" an OLE Automation Server? If so, I would like to control it. Thanks. ---Frank ...more >>


wsid() help
Posted by rmanchu NO[at]SPAM gmail.com at 2/2/2006 10:43:59 PM
hi is there a built in function that returns an int that can be set via the connection string? wud prefer to use a single function call that returns an int as this field will be inserted into almost all tables for audit trails. currently i'm using wsid() but that returns a nchar? would a ...more >>

Best practice BIT or SET('no','yes') ?
Posted by Lisa Pearlson at 2/2/2006 9:23:42 PM
Hi, I know it's quite common to use BIT fields for boolean values. CREATE TABLE tblTest ( door BIT DEFAULT 0, accept BIT DEFAULT 0 ) instead of: CREATE TABLE tblTest ( door SET('close','open') DEFAULT 'close', accept SET('no','yes') DEFAULT 'no' ) (By the way, I use MSSQL ...more >>

database object hierarchy
Posted by GB at 2/2/2006 8:02:15 PM
Hello: In my SQL Server databases I have complex related tables and views. There is any tool which allow you to see (print) this complex hierarchy of views and tables as hierarchical tree? Thanks, GB ...more >>

Foreign Key from two tables to one?
Posted by mahalie at 2/2/2006 6:20:15 PM
I have a table called Employee_Bios with the following: Bio_ID Employee_ID Bio_Text The Employee_ID comes from one of two tables...the Employees_Active or the Employees_Inactive table. So I have a multi-part question...I know, this is SQL 101 - maybe y'all can give me a lesson on best pra...more >>

UDT in SQL server 2005 need help
Posted by Learner at 2/2/2006 6:06:18 PM
Hi there, I have created a UDT using in VS2005 and below is my code for the UDT **************************************UDT***************************** Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports Microsoft.SqlServer.Server ...more >>

Running low on drive space frequently.
Posted by Matthew at 2/2/2006 4:42:59 PM
Is there a way for SQL to alert me when any of the drive spaces on the server become too low? I am sure that someone has a scheduled jobs that does this and would send out e-mails to notify someone. Thanks -Matt- ...more >>

checkpoint
Posted by Alex at 2/2/2006 4:08:50 PM
Hi friends, I came across the recommendation to do checkpoint to flush a buffer pool out when doing massive modification in small chunks under simple recovery mode. Can someone elaborate a bit more on it? Is it reasonable? And why? Thanks a lot in advance. Alex ...more >>



Pintable with full-text search
Posted by DonSQL2222 at 2/2/2006 2:56:35 PM
Can you have a pintable and use a full-text search designed table? Thanks, Don ...more >>

nvarchar(max) equivalent in C#
Posted by skg at 2/2/2006 2:03:28 PM
i am writing a UDF which takes nvarchar(max) as input parameter. Can any one tell me what is the equivalent of this data type in C#. Thx ...more >>

Recurring Sequence Help
Posted by Doug Abrahamson at 2/2/2006 2:01:29 PM
I have a table that contains a date/time column and an integer column. I write to this table every 6 seconds. I am recording the datetime and a current phase (1-5) throughout the day. I want to query the table and list the start of each individual phase for the day. The phases are of varying ...more >>

Can a CASE Staement be used in the WHERE clause
Posted by Jim Abel at 2/2/2006 2:01:29 PM
I have confused myself and need some help clarifing how to weite the following statement so that 3 difierent results can come from the value of the passed Parameter. The parameter can have 0,1 or 2 as the values What I'm trying to get back is the records that are automated if the value is 1 ...more >>

How are views used each time it is requested.
Posted by CD at 2/2/2006 1:55:23 PM
Taking the view below, is a view reran each time it is requested or is there some sort of caching that would hold the dataset ready for the next request of the view? CREATE VIEW dbo.vwTodaysNeurologyAppts AS SELECT TOP 100 PERCENT PatientName, ResourceCode, ApptDate, ActivityType FRO...more >>

Encryption question
Posted by mvp at 2/2/2006 1:33:27 PM
Hello Everybody, I have a Encryption - Decription Question. In my project we are getting an XML File from a vendor which has a credit card number in clear text. We use XML bulk load process to load table from xml file. How can i encrypt credit card number while storing into table. Also i...more >>

Problem with Bulk Upload. Uploads twice.
Posted by meverts at 2/2/2006 1:10:28 PM
When I run the following stored procedure I get these results. My file has 24 rows in it. However I am uploading it twice for some reason. Stored Procedure: CREATE PROCEDURE [dbo].[dsp_Manual_Import] ( @PathFileName varchar(50), @SQL varchar(2000) ) AS SET @SQL =...more >>

ORDER BY in a SP
Posted by andrew at 2/2/2006 1:09:27 PM
I'm getting a little frustrated... I'm trying to write a stored proc... the following code works fine on its own in Query Analyzer... when I put it into my stored proc... SQL Server complains about the ORDERS BY clause. SELECT TOP 1 UserID FROM Users WHERE UserID > 50 ORDER BY Use...more >>

Search for a field within an SP
Posted by Mark at 2/2/2006 12:50:48 PM
Hi - I am trying to use DTS (from EM) to copy tables, SPs and data from my remote SQL Server (2000) to my local copy. However, it keeps failing when I try with the SPs - and I think it's because one of them references a field my_tempemail which has been deleted from a table. Is there anyway...more >>

Composite Index and Query Optimizer
Posted by Meher at 2/2/2006 12:20:28 PM
Hi I have a question. If I have a composite primary key on table (in essence I will have a composite clustered index as PK by default creates a clustered index) when would the Query optimzer would not use the index on it?. Is it like if the Query optimzer thinks that a table scan would be m...more >>

will a client application using ado.net get an exception if the command is executing a stored procedure that does a RAISEERROR in its tsql?
Posted by Daniel at 2/2/2006 11:11:06 AM
will a client application using ado.net get an exception if the command is executing a stored procedure that does a RAISEERROR in its tsql? ...more >>

Disable Trigger Question
Posted by Rich at 2/2/2006 11:04:58 AM
Here is a trigger in a table that I am working on. Call it tbl1. AT the bottom of the trigger is an Alter Table statement which looks like it disables the trigger. My question is for the purpose of this Alter Table statement at the end of the trigger. I am not familiar with the logic. Doe...more >>

How can you prevent the data changes message during editing a row
Posted by Oliver at 2/2/2006 10:33:04 AM
I just upsized my Access application (mail-order processing system) and linked to SQL server 2000 via ODBC tables links from an Access 2000 front end. By doing so the standard optimistic locking of SQL server 2000 comes into force and the option "lock edited record" on the Access Client gets...more >>

Moving data thru linked server
Posted by culam at 2/2/2006 9:55:49 AM
We are currently moving data using stored procedures and Linked server. However it takes too long (40 minutes for 600K records with 40 fields). I am hoping to shorten the time. Any suggestion would be appreciated. Example stored procedure: --Truncate destination table, then insert data....more >>

problem with SP to return last @@Identity
Posted by Rich at 2/2/2006 9:45:32 AM
I need to retun the last inserted Identity value. - The SP below has a syntax error on the Set line. How can I fix it? create procedure stp_GetIdentity @e int output as SET NOCOUNT ON Set @e = Select @@Identity return go Thanks, Rich...more >>

How do I know if my sql server needs more memroy ?
Posted by MO at 2/2/2006 9:27:04 AM
Hi, We have an OLTP system with 600+ connections, 30 gb database running on a 4 CPU and 4.2gb memory, out of which 3.5 gb is allocated to SQL Server (using fixed memory). SQL Server is on its own dedicated machine. Our clients are complaining about performance. Disk utilization is around 5...more >>

trying to group by day without splitting day out in the select list
Posted by jason at 2/2/2006 9:16:07 AM
given a simplified table like so: create table transactions ( transactionid uniqueidentifier primary key not null, datecreated datetime default current_timestamp /* just for you celko */ not null) go this query works: select datepart(month, t.datecreated), datepart(day, t.datecreate...more >>

Function for Determining Completion Time
Posted by Will Asrari at 2/2/2006 8:24:42 AM
The company I work for uses tracking software for entering help desk (IT-related) issues. The issues is timestamped and assigned a Priority level (A-D). Each level relates to an estimated completion time. What I'm trying to accomplish is to add the estimated completion time to the time and date....more >>

Can I use dynamic SQL in a stored procedure to call another stored
Posted by Rajendra at 2/2/2006 7:31:54 AM
Hi, I am having one stored procedure named SP1 which is having one input and one output parameter as follows CREATE PROCEDURE dbo.SP1 @xmldoc TEXT ,@FLAG_EXEC VARCHAR(5) AS BEGIN ..... END I have write another stored procedure named SP2 which is creating a dynamic SQL ...more >>

Namespace
Posted by Alan at 2/2/2006 7:28:16 AM
Hello, I have le following c# procedure: namespace AXRON.SqlServer { public partial class StoredProcedures { [Microsoft.SqlServer.Server.SqlProcedure] public static void pSoloDldCreateTables() I would like to insert it in my database with the following request: C...more >>

getting dates between start date and end date
Posted by Mike P at 2/2/2006 7:05:41 AM
I have two fields of type datetime - a DateStart field and a DateEnd field. Is it possible to use some SQL to return each of the dates between these 2 dates? Thanks *** Sent via Developersdex http://www.developersdex.com ***...more >>

how to optimize this procedure
Posted by rameshsaive NO[at]SPAM gmail.com at 2/2/2006 6:03:00 AM
Hi friendz, I've the following procedure & the table stockexcdownload contains at least 4,00,000+ records. My requirement is that this proc. is costing me about 10 mins to process these many records. I'd also have an index on this table. (given below) suggest me on how to optimize thi...more >>

Update Query in stored proc
Posted by Winshent at 2/2/2006 3:31:22 AM
I am transferring some queries from Access to SQL Server stored procs. I have a problem with an update query. I dont understand whats wrong with this: UPDATE #qry_IS_DomCareVar10 INNER JOIN #localtbl_DomCareVar ON #qry_IS_DomCareVar10.DEALITEM = #localtbl_DomCareVar.DEALITEM SET #local...more >>

user permissions in a database.
Posted by Mark at 2/2/2006 3:20:29 AM
Environemnt: SQL 2000 SP4 Windows 2003. I am looking for a way to check what permissions a user has in a specific database. For example: I am logged in as a login ABC and I want to know a login XYZ has what sort of permissions on Database DB101. I also need to know if this user is a membe...more >>

multiple cascade
Posted by Alan at 2/2/2006 2:04:26 AM
Hello, I need to do a relation between 2 tables with this request (under SQL server 2005) ALTER TABLE "dbo"."PrmBox" ADD CONSTRAINT "FK_OrgSet_PrmBox" FOREIGN KEY ("n_oset") REFERENCES "dbo"."OrgSet" ("n_oset") on update cascade on delete cascade But I have the error : .... may cause...more >>

Persisting data in custom aggregate
Posted by JamesM at 2/2/2006 12:45:26 AM
I want to create a custom aggregate to calculate percentiles. For example: The 50th percentile is calculated by extracting the value(s) in the centre of a sorted dataset. What I need in this case is a sorted dataset so that I can extract values at specific indexes to be able to calculat...more >>

Copy a table minimizing log space
Posted by pls at 2/2/2006 12:17:28 AM
Yes, I know this is a silly situation. I have an application that uploads several tables to a remote SQL Server that is part of a web site. The records are uploaded into a dedicated upload table, then the table they belong in is truncated and the records copied using INSERT INTO ... (SE...more >>

running a vb.net dll from sql server
Posted by Claude Hebert at 2/2/2006 12:00:00 AM
We have a new application were building which includes a module to preform overnight processing. Originally the idea was to schedule a job on the server to run for each database that needs the processing completed. Whats the best way to do this? we are using vs 2003, ms slq server 2000 ...more >>

trigger update on master-detail
Posted by JS at 2/2/2006 12:00:00 AM
my problem is about trigger update on master-detail. i have tables as follows: account ------- year (int) accountno (nchar) balance (money) master ------ tno (nchar) tdate (date) .... detail ------ tno (nchar) accountno (nchar) amount (money) .... if there is any changes on...more >>

Add two result values to a new result?
Posted by Peter Hartlén at 2/2/2006 12:00:00 AM
Hi! This is probably simple (or impossible) but I can't figure out how to add to values into 1 in a result. Something like this: select sum( lala ) as sum_1, sum( lele ) as sum_2, add( sum_1 + sum_2) as sum_tot from myTable I could ofcourse use lala and lele in a new sum ...more >>

How to make two filegroups to one filegroup
Posted by Andreas Klemt at 2/2/2006 12:00:00 AM
Hello, I have to filegroups like database_data1 stored on d: database_data2 stored on e: How can I delete the database_data2 and tell SQL 2005 to copy all data to database_data1? Thanks for any help in advance! A. Klemt ...more >>

¿ Can you change a column id with statement ?
Posted by Frederik Jensen at 2/2/2006 12:00:00 AM
Can you change the column id of a column using a statement? Its no problem if you use the Enterprise Manager -just drag til column in design mode and it has a new id. However as it can be done in EM it should be possible using a statement aswell I guess. Column definitions are found in mast...more >>

Exec a resultset to .txt file directly.
Posted by Geir Holme at 2/2/2006 12:00:00 AM
Hi all. Is there a way I can have my resultset saved to a file directly from a SP using SQL2000. E.g. use northwind CREATE PROCEDURE ToTxt AS SELECT * FROM Customers /* I want something like*/ /* SELECT * FROM Customers TO c:\Cust.txt */ /* Then I can run the following to create...more >>


DevelopmentNow Blog