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 2006 > threads for wednesday january 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 31

It's unbelievable and unacceptable
Posted by Enric at 1/4/2006 11:45:02 PM


Can I determine insert order without an explicit field
Posted by Computer User at 1/4/2006 6:19:02 PM
I want to be able to find the differences between the before and after values in a table as updates occur. I thought an easy way to do this would be to create another table with an identical structure and then use an update trigger to insert the deleted and inserted rows into that alternate tab...more >>

How to create view or stored proc in another db using stored proc?
Posted by tamsun at 1/4/2006 5:23:57 PM
for example, Now I am in database Master, I want to create a stored procedure which named usp_Test1 in database Northwind. yes, I can run T-SQL as follows: ---------------------------- use Northwind go Create Proc usp_Test1 AS SELECT * FROM Orders ---------------------------- but I w...more >>

outputing the results of a parameterized stored procedure to a tab
Posted by jonefer at 1/4/2006 5:13:02 PM
Could I someone help me in modifying this stored procedure to 'OVERWRITE' a table of the same name every time it is executed? It could delete all values in the table append to it More or less, I will use it like a temp table, but I want the 'temp' table to always exist. Since ADO.NET data...more >>

x64 SQL and DBLIB
Posted by Kirk Barrett at 1/4/2006 4:59:02 PM
Hello! Does anyone know where i could get the x64 .lib version of DBLib? I am specifically looking for Ntwdblib.lib for x64 edition. Is anyone else moving xprocs to x64? Thanks so much! Kirk Barrett kirk@cimbrian.com...more >>

Something easy for you SQL gods, I'm sure...
Posted by Scott M at 1/4/2006 3:58:58 PM
I have a big query where I'm using in memory tables and aggregating some data and needed some better performance. So, I've changed one or two of my @tables into true tables in the DB and I want to create some PK Constraints on the table. So I'm running this SQL on the tables... BEGIN A...more >>

ADO.Net 2.0 Bulk copy vs SSIS
Posted by nick at 1/4/2006 3:02:02 PM
For simply loading a big amount of data. Is the the performance similar?...more >>

CREATE TABLE without columns
Posted by RSH at 1/4/2006 3:01:38 PM
Is it possible to use t-sql to Create a table without columns? I keep getting syntax errors and can't figure out the correct syntax to do this. Thanks, RSH ...more >>



What is the version of sql server
Posted by Roy Goldhammer at 1/4/2006 2:57:40 PM
Hello there How can i know what is the version of my sql server database? MSDE, STANDARD, DEVELOPER, ENTERPRISE? ...more >>

Using Two motch memory
Posted by Roy Goldhammer at 1/4/2006 2:38:45 PM
Hello there I have database on one of my clients that has 2.7 Gb on the data On normal hours sql server usege is approx 1.85Gb The sql in the is standard edition. And it works very slow Does it normal that 70% of the database is on the RAM and what i need to do to improve performanc...more >>

Missive
Posted by nikool19a NO[at]SPAM yahoo.com at 1/4/2006 2:32:34 PM
FRIEND, As are you, Brandon and www.ChezBrandon.com are intelligent and awesome. May you have an awesome day. A succinct warning: Elements of the Mossad, sated with cash from the murderous and destructive narcotics trade -- for example, according to Reader's Digest, cocaine alone costs US ...more >>

Allocate by assets
Posted by Terri at 1/4/2006 2:22:33 PM
I need to write a stored procedure in which I allocate based on the assets of an account. I'd like to pass my procedure 2 variables: @AccountType and @Amount. @Amount is the amount to be allocated. @AccountType determines among which accounts the amount will be allocated. The amount allocated ...more >>

How Can I Get Client User Ip Number
Posted by kimsin_sen at 1/4/2006 1:28:58 PM
Hi, Use Mssql, How can I, Get Client User Ip Number in Mssql Thanks, ...more >>

Elegant alternative to table-valued function
Posted by dustbort at 1/4/2006 12:56:08 PM
I have a table, call it Liquidity, that is the result of joins of other table-values functions, tables, and subqueries. Now I want to create a table-valued function (or some parameterized query) called GetLiquidityInfo to return a view in which each row contains all the columns from Liquidity...more >>

really large stored procedures
Posted by vortep NO[at]SPAM gmail.com at 1/4/2006 12:48:47 PM
i'm not much of a sql developer, most of my exposure to it comes from needing to get data for my web applications. i've been kinda wondering, is it abnormal to have stored procs that are over 500 lines long? the business requirements seem to warrant such a long procedure and it doesn't seem to ...more >>

Rolling Totals
Posted by Vishal at 1/4/2006 12:46:23 PM
Hi, I have a table wich has Month int Year Int Store Int Sales Money When the user enters parameters for Month & Year eg Month =4 and Year=2005, I want to get the totals of sales for each store going backwards 12 months i.e. from 05/2004 till 04/2005 Please help I am not a seasoned ...more >>

Pulling Random Distinct Percentage
Posted by Bac2Day1 at 1/4/2006 12:14:29 PM
Having trouble coming up with a fast and efficient sproc for this. Thanks in advance for any help! tblRecords record_id (int) [key] location_id (int) owned_by_id (int) [default = 0] is_complete (int) [default = 0] date_entered (datetime) [default = getDate()] date_completed (da...more >>

How can I make SQL Server 2005 automatic generate scheme script for backup everyday?
Posted by ABC at 1/4/2006 12:04:16 PM
How can I make SQL Server 2005 automatic generate scheme script for backup everyday? ...more >>

Using the Query Anaylzer debugger for a DATETIME input
Posted by Dianna Moore at 1/4/2006 11:52:32 AM
Hello, I'm trying to use the Query Analyzer debugger tool to debug a stored procedure that I created. I have an input that is a DATETIME variable and if I remove this variable from the input list then I have no problem getting the debugger to start and step through the procedure. If I l...more >>

SQLAgent Job New Step -- app database not showing
Posted by Jason at 1/4/2006 11:38:21 AM
SQL Server 2000: I'm a DBO for database "appDB". When creating a "New Step" in a JOB (SQL Server Agent) I am trying to select that "appDB" in the database dropdown. I only see the system databases (master, tempdb, etc.). Any ideas? ...more >>

VB Script + SQL DMO Error
Posted by Nitin at 1/4/2006 11:32:03 AM
Hi All: Goal: Stop and Start SQL Server and run few queries in a loop. I am trying to run following VB Script using SQL DMO libraries to stop and start SQL Server. Stopping SQL Server part works fine but I get error when I start SQL Server because stopping the SQL Server service is still ...more >>

SQL WHERE clause spanning dates
Posted by Brian Piotrowski at 1/4/2006 10:56:49 AM
Hi All, Can someone tell me how I can make SQL server return a set of records based on a date spanning two different years? I have a query that requires all records between the dates 12/23/2005 22:38:05 and 01/04/2006 02:00 to be displayed. The original system has the date and time data i...more >>

Should I use a cursor?
Posted by meverts at 1/4/2006 10:49:06 AM
I am new at writing Stored procedures so please forgive me. I need to do the following. Read a file and choose the first record in the file that has a status of 2. I need to then copy data from this table and another table into a new database. How do I choose the first record only t...more >>

Probability table
Posted by Joe at 1/4/2006 10:42:05 AM
Suppose I have a two colum table: (value1, probability1) (value2, probability2) (value3, probability3) .. .. .. (valueN, probabilityN) Assume the sum of probability1...probabilityN is 1. How can I write a function using SQL that will return a random value (1..n), distribituted accord...more >>

uniqueidentified
Posted by Sean Trask at 1/4/2006 10:30:04 AM
Hello - forgive me if this is an easy question, but I have searched and searched, and can't find an answer. I am trying to do a compare on a field that is a uniqueidentifier that can contain NULLS, for example: WHERE a.uniqueidentifier <> b.uniqueidentifer I want to use ISNULL to conver...more >>

hunting down deadlocks
Posted by jason at 1/4/2006 10:25:10 AM
so i'm consulting BOL to troubleshoot the deadlocks that this database is experiencing. i've reviewed the object access order suggestions, which i don't think is the main problem here. all of the data manipulated accessed through single statement stored procedures. there are some errant direct...more >>

An interesting Question on DBDesign
Posted by lara169 at 1/4/2006 10:23:47 AM
Hi, Sorry for posting the question again. Since I send the question as attachments, some people were unable to read it. Also i missed to attach the latest word file of the Question This Question was asked in one of the top indian universities(I've copied itexactly the same way as it wa...more >>

Primary Key Violation Constraint, how to debug.....
Posted by certolnut at 1/4/2006 10:07:10 AM
Hi all, I have a stored procedure (from a vendor) that attempts to insert some records.. Unfortunately, its a very buggy early version, and tech support is sketchy at best, so I'm trying to figure out the problem myself.. This is the error I'm getting: Server: Msg 2627, Level 14, State ...more >>

Call function from a procedure and assign return value to variable (sql server)
Posted by Chris at 1/4/2006 9:55:24 AM
Hi all, I have a procedure proc1, which needs to update a table. One of the columns to update the table is calculated using a function funct1 (which returns a smalldatetime) My problem is how do I call the function funct1 from procedure proc1, so that the return value of function is saved in ...more >>

Union clause
Posted by HP at 1/4/2006 9:52:02 AM
I have problems selecting a text field in union clause. eg. select fld1,name from tablename where..... union select fld1,name from tablename where..... (name is a text field.) i am getting an error "The text, ntext, or image data type cannot be selected as DISTINCT." How should i restructu...more >>

SQLDMO: How to enumerate DB Maintenance Plans?
Posted by Mark Findlay at 1/4/2006 9:22:40 AM
Using SQLDMO, how can I enumerate the existing DB Maintenance Plans for a database? In viewing the SQLDMO object model, there is no particular object for the tree item "Maintenance Plans" that appears in Enterprise Manager. Do I need to examine each SQLDMO Job object? Or is it accessed via ...more >>

Partitioning using Date - TimeKey (Ref to another table) column
Posted by Christian Hamel at 1/4/2006 9:03:04 AM
Hello. I'd like to implement table partitioning for one of my tables in my DB (Sales History). I'd like to setup partitioning using a date. I'm planning to use a partition per year that are going to be spread among multiples Filegroups. This table contains an integer field that link to...more >>

using exec stmt in select query
Posted by HP at 1/4/2006 9:00:03 AM
I need to execute a stored procedure within a select query. eg. select fld1,exec spTest as fld_name,fld3 from tablename. I already tried this but it doesn't work. Can anyone pls give me the correct syntax? Thanks!...more >>

Escaping the Escape characters [ ]
Posted by barryb NO[at]SPAM nitec.com at 1/4/2006 8:16:02 AM
Hi i am having quite a bit of trouble getting the sql statement below to work (generated using asp.net) SELECT * FROM Members WHERE MemberID Like '[3Q, 1''J]' I have a Member in my db with the literal value '[3Q, 1''J]' and the details for it are not showing (due to the escape characte...more >>

PRC file extensions in MSSQL Management Studio 2005
Posted by Mike at 1/4/2006 7:35:56 AM
Most of our files were scripted out to our VSS as PRC files. In MSSQL Management Studio 2005 these file extensions are not recognized by the compiler as SQL text. Now I could go into VSS and change all my extensions to SQL, but I feel like that would be a very time consuming task. Is there a ...more >>

sp_configure "user options" and @@options function
Posted by Jerry Boggess at 1/4/2006 6:38:03 AM
From what I have read the value in sp_configure's "user option" value is suppose to match that of the @@options function. When I run sp_configure I see 0 (zero) as the current setting but when I run "select @@options" I see 5496. I think the @@Options function is returning bad results but I ...more >>

Un-encrypting Stored Procs
Posted by jaylou at 1/4/2006 6:18:03 AM
I have an application that runs an encrypted SP. it is failing due to a data type. Is there a way for me to unEncrypt the Procedure so I can see where it is failing? TIA, Joe ...more >>

The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACT
Posted by Liz at 1/4/2006 5:50:01 AM
Hello Everyone - Thanks in advance to whomever responds, if any! A little background, SQL 2000 sp4. I am receiving the subject line error on a piece of code I've inherited. It appears the sproc completes error free so I am unsure as to why the Begin Tran isn't found when the Commit's encoun...more >>

SQL Injection - Table created t_jiaozhu
Posted by zsghorayeb NO[at]SPAM gmail.com at 1/4/2006 5:28:23 AM
Dear All, please note that our server was hacked via the means of SQL injection; a table named t_jiaozhu was automatically created and SQL injection is messing up our data in the SQL database. SP4 is installed... Can someone help please? where can i find more info about this t_jiaozhu table? ev...more >>

SQL Distinct Value and Order by some Field......
Posted by krishnan at 1/4/2006 4:29:32 AM
Dear all, In SQL Server 2000 , how to get distinct records sort by one field . Example SELECT DISTINCT A FROM tblTEST ORBER BY B Here, In Table Field 'A' contain more than one same data... Field 'B' contain all are different Data...... I want ...more >>

Extracting info regarding ETL's
Posted by Enric at 1/4/2006 4:15:45 AM
Dear all, I'm pursuing for a method/query or any kind of task being able to find all those DTS which own Oracle connections inside. It's very hard open one and one (500)!! Does anyone ever experienced or face up such requirement? Thanks for your time and any input will be welcomed, E...more >>


DevelopmentNow Blog