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 > september 2006 > threads for monday september 11

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

Programatically Accessing Maintenance Plans through SMO
Posted by Brad Baker at 9/11/2006 9:40:18 PM
Can anyone point me to any resources on how to programmatically add databases to maintenance plans through SMO on SQL 2005 preferably using VB? Thanks! Brad ...more >>


Need CheckSum Algorithm
Posted by ManDev at 9/11/2006 8:37:26 PM
Hi, We have checksum function in sql server 2000,i would like to implement same in .Net.Can some one provide checksum algorithm. Thanks ManDev. ...more >>

Using XML templates
Posted by Igor Solodovnikov at 9/11/2006 8:22:39 PM
There is MSDN article "Using XML templates" at http://msdn.microsoft.com/library/en-us/xmlsql/ac_xml1_2cx1.asp. Does there exist formally defined XML schema for XML templates?...more >>

Database Id prb !
Posted by Prasad at 9/11/2006 6:37:24 PM
Hi, I was profiling the Audit Schema Object Access Event in SQL Server 2005, and when I executed the system stored procedure "sys.xp_msver" I found that the database id of the this procedure is shown as "32767" which doesn't exists in the sys.databases view ? Any idea to what database it ...more >>

SQL2K: Query to consolidate multiple rows into single row with additional data?
Posted by PGC at 9/11/2006 6:07:55 PM
Hi, Given a table EmpeeTrans with the following structure CompanyID char(1) EmployeeNumber varchar(16) WeekNo int Code varchar(20) Hours decimal(18,4) Rate decimal(18,4) Sample data 4,1234,1,"BASIC",40.25,12.3456 4,1234,1,"T+1/2",7.50,20.1234 4,1234,2,"BASIC",40.25,12.3456 4,1234,...more >>

Data Manipulation
Posted by Ash at 9/11/2006 5:46:17 PM
We are changing our numbers from 7 digits to 5 digits and what to copy the data from one field to the other while triming off the last two digits. We have determined that we no longer need the last two digits. Both fields are in the same table. Can I do this with a SQL statement? Please see...more >>

SQL Challenge
Posted by Itzik Ben-Gan at 9/11/2006 5:11:18 PM
http://www.sqlmag.com/Article/ArticleID/93462/sql_server_93462.html Cheers, -- BG, SQL Server MVP www.SolidQualityLearning.com www.insidetsql.com Anything written in this message represents my view, my own view, and nothing but my view (WITH SCHEMABINDING), so help me my T-SQL code. ...more >>

Execute AT <linked server name>
Posted by Amos Soma at 9/11/2006 4:06:05 PM
In a stored procedure, I have the following TSQL statement: EXECUTE ('Insert Into Federation.dbo.FederationData (FederationData) Values (?)', @Buffer) AT [HostBox.abcd.mydomain.com\SQLServer2005,1563]; This works fine. However, I would like the linked server name to be determined at run-ti...more >>



How do I run a DTS package from vb.net
Posted by Gordon at 9/11/2006 2:56:01 PM
Hi; I am trying to execute a DTS package from within a vb.net module using VS 2003. I understand that you must add a reference to a com library. I tried using a reference to Microsoft.DTSPackage.Object Library Then doing " Dim oPackage As Object = CreateObject("DTS.PAckage2") I m...more >>

Server: Msg 8623 - The query processor could not produce a query p
Posted by Andy at 9/11/2006 2:51:02 PM
Dear all, We get the following error *periodically* on our site... Server: Msg 8623, Level 16, State 1, Line 8 Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information. When it occurs it happens all the ...more >>

Cannot see system views?
Posted by JP at 9/11/2006 2:49:02 PM
Im trying to access the system tables for SQL 2005. I understand I can no longer access the tables directly, and I’m fine with that. But I cannot see the System Procedures folder or System Databases folder that several sites talk about in order to get to all the processes MS created for read...more >>

How to calculate a 5 minute running average?
Posted by Jeff Richardson at 9/11/2006 2:15:07 PM
I have a table that records temperatures every minute or so. There is a datetime (Sample_Date) that stores the time a temperature was read and a float (Sample_Value) that stores the temperature. I'm trying to write an UPDATE statement to calculate the average of the previously 5 minutes wo...more >>

Fast "InUse" flag.
Posted by Robinson at 9/11/2006 1:37:37 PM
I have two tables with a one to many relationship existing between them. I want to be able to select in a Flag in my result set that indicates that the "one" record has one or more records pointing to it (excuse my lack of relational terminology), I mean related to it. My solution is a left ...more >>

Script for importing Windows active directory domain user accounts?
Posted by J at 9/11/2006 1:29:35 PM
Hello. Does anyone have a script or point me to a link that shows how to create a script that can use existing Windows active directory accounts to be set up as new Windows authentication logins for SQL Server 2000? We have a rather large list of active directory accounts that need to be set...more >>

CURRENT DATE
Posted by wnfisba at 9/11/2006 1:11:02 PM
Isn't there a special function in SQL Server similar to DB2 where I can extract rows based on "CURRENT DATE"??? I have this query... SELECT column_1, column_2, column_3,... FROM TABLE_NAME WHERE column1 <= CURRENT DATE Any help is GREATLY appreciated... Th...more >>

Money formatting
Posted by raghu at 9/11/2006 12:42:53 PM
I need to format monetary values to s9(6)v99 format with leading zeroes. For example: 20.00 -> 002000 20.56 -> 002056 Negative values will have a minus sign -20.00 -> -02000 -20.56 -> -02056 Is there any easy way to do this? Any pointers would help. Thanks in advance. ...more >>

Deadlock Victim!!!!
Posted by Vai2000 at 9/11/2006 12:08:59 PM
Hi All, I have a Master Stored Procedure, which internally calls other procedures as needed. This master proc is invoked from a Web Application (ASPX). Sporadically I get error messages Error Detail: System.Data.SqlClient.SqlException: Transaction (Process ID 60) was deadlocked on lock resources...more >>

execute checkpoint command in stored procedure for specific databa
Posted by Mike Kansky at 9/11/2006 11:52:01 AM
I need to execute CHECKPOINT command for a specific database in a stored procedure. The [USE] statement is not allowed in proc: use database_name checkpoint What are my alternatives?...more >>

error-checking in dynamic SQL?
Posted by Rick Charnes at 9/11/2006 11:47:09 AM
When using dynamic SQL in SQL Server 2000, how do I confirm that my SQL statement executed successfully? I have my statement in var @sql, and execute it with: EXEC @ck = sp_executesql @sql N'[...parm defintion list and values list...] but I think var @ck will be non-0 only if sp_executes...more >>

Is "inner join" the same as "join"?
Posted by mike NO[at]SPAM bridgecanada.com at 9/11/2006 11:46:08 AM
I have a tsql query of this form SELECT ... FROM a JOIN b ON ... JOIN c ON ... LEFT JOIN d ON ... WHERE ... I see that the query optimizer has decided to do full outer joins for the first two joins. My interpretation of the documentation is that these should really be inner joins....more >>

number spread over a few quarter
Posted by sweetpotatop NO[at]SPAM yahoo.com at 9/11/2006 11:39:29 AM
Hello, I wonder if there is a quick way or a simple sql to accomplish the following: I have a lump sum of money which spread thru' the start date and end date, and eventually the money spread evenly in 4 quarters, e.g. Jan-Mar =Q1, Apr-Jun=Q2, July-Sep = Q3, Oct-Dec = Q4 For instance, if...more >>

Trouble with Stored Procedure - SQL 2005
Posted by Bart at 9/11/2006 11:02:22 AM
I've having some trouble creating a stored procedure that conents to a linked server. I'm connecting to our IBM AS400 and I have to change the date from 09/01/2006 to 20060901. If I run the query below as is, it working without a problem. However, I want to create a stored procedure so I ca...more >>

Database Design ROI White Paper
Posted by Paul Nielsen (MVP) at 9/11/2006 10:38:20 AM
The Database Design ROI White Paper is intended to help data modelers (regardless of their title) justify the cost and time of developing an excellent design even if it delays the project. http://www.sqlserverbible.com/files/databasedesignroi.pdf -Paul Nielsen SQL Server MVP PASS Board o...more >>

ACCESS TO MSSQL Incorrect syntax near the keyword 'AS'.
Posted by areejan2000 NO[at]SPAM yahoo.com at 9/11/2006 9:57:04 AM
UPDATE Table1 AS t1 LEFT JOIN Table2 AS t2 ON (t1.BrID = t2.BrID) AND (t1.SID = t2.SID) SET t1.NAME = [T2].[NAME], t1.QID= [t2].[QID] gives Incorrect syntax near the keyword 'AS'. ...more >>

how do i add the records
Posted by rodchar at 9/11/2006 8:36:02 AM
hey all, how do i create a script that will save the structure as well as the records? thanks, rodchar...more >>

getting the records returned by one query and not another
Posted by Mike P at 9/11/2006 8:23:32 AM
How do I write some SQL which gives the result set for the records that are returned by one query and not returned by another query? Here are my 2 queries : 1)select distinct ups.SerialNumber, ups.Division, ups.Family, ups.Product, ups.ContractStart, ...more >>

local variable not recognized when executing dynamic sql
Posted by dotnet dude at 9/11/2006 8:22:04 AM
This is the issue I am facing: I have a stored proc something similar to this: CREATE PROC spGetApplesAndMangoes @units int AS Declare @dynSQL nvarchar(500) Declare @apples int, @mangoes int -- contruct this dynamic sql statement using conditions etc. ...more >>

Delete duplicate records
Posted by Dolphin at 9/11/2006 7:59:02 AM
Hi, I have a table like this: TableA -------- RECORD_ID (primary key) Field1 Field2 Field3 Field4 Field5 In this table there are many duplicate records. (it's mean all FiledX values same [except RECORD_ID]) Example: RECORD_ID, Field1, Field2, Field3, Field4, Field5 -----------...more >>

NDF and file groups
Posted by JP at 9/11/2006 7:58:02 AM
I am current re designing one of our databases for SQL 2005. This database will have about 20 tables. Of those 3 will have over 4 million records and at least one more will have over 20 million records. I was looking at using partitioning, but as we use replication across half a dozen serve...more >>

Syntax error converting datetime from character string
Posted by MSUTech at 9/11/2006 7:46:04 AM
Hello, I have a stored proc.. that is giving me problems.. seems straight forward??? '-----' CREATE Proc InsertEmailNewIStudy @IStitle varchar(150), @ISfacmember varchar(150), @IScontactinfo varchar(150), @ISexpiration datetime, @ISdescription varchar(6000) AS '-----------' ...more >>

Tool to compare SQL Schema?
Posted by DotNetDev at 9/11/2006 7:34:02 AM
Hi, Can any one recommend a tool (Free lisc, preferred) to compare SQL Schema (and may be data)? Thanks...more >>

Trigger ID
Posted by Joy at 9/11/2006 7:32:03 AM
Hi All, I am faced with a situation where i want to know the ID or name of a trigger that fires another trigger. For example say i have two tables namely tblSource and tblDestination. Now i have say one trigger(called trg_updateDest) for updating the tblDestination and assume that this trigge...more >>

URGENT - Cannot find bad data in table
Posted by MartyNg at 9/11/2006 7:28:51 AM
I have a small table in SQL 2000 that has < 5,000 records. All of a sudden, I cannot run most queries against it...always get a time out. This is a CRITICAL production table, and I need to get this fixed ASAP. I only have two indexes on the table (on varchar columns), neither of which I can dr...more >>

query optimisation
Posted by rocket salad at 9/11/2006 7:25:02 AM
I have the oportunity over the next couple of days to alter an aggregate table which we're using to report from to include a couple of primary keys from the original tables. These keys are integer identity columns. There will almost certainly never be a reason to join on these columns in pa...more >>

c sql server library?
Posted by c19h28o2 at 9/11/2006 4:25:53 AM
Hi, I'm trying to connect to a sql server 2000 box using c but cannot find a library for it, any ideas the best way to connect to it? Cheers c19 ...more >>

Using EXECUTE AS
Posted by devjnr NO[at]SPAM gmail.com at 9/11/2006 3:54:25 AM
I compiled a sp using "EXECUTE AS" with ad-hoc user created to perform ddl operations and added permissions of db_ddladmin. So, I'm trying to execute a sp from a low-level permissions user impersonating the new one, db_ddladmin assigned role user. When I try to query something, I obtain "The...more >>

Service Broker
Posted by yugant NO[at]SPAM gmail.com at 9/11/2006 2:40:07 AM
Hello , I am trying to Implement distribution of the Stock Quotes over the LAN(only within the Network) and showing the live changing stock Quotes on the front end (in datagrid) installed at each clients desktop.I am receiving the Stock prices over the TCP / IP from the Stock Exchange. I am reci...more >>

Rollback actions of SP
Posted by ipramod NO[at]SPAM gmail.com at 9/11/2006 2:26:09 AM
There is one stored proc 1. Inside that we begin one transaction and in that We call another stored proc 2 Inside that we begin another transaction and committed it Now in stored proc 1 we rollback first transaction Will this rollback, reverts the changes made by transaction in stored...more >>

Application design help: ADO.NET
Posted by Micus at 9/11/2006 1:59:59 AM
[VS 2005, SQL Svr 2000] Hello all, I have a SQL 2000 database with 4 tables (A,B,C,D). I'm writing a program that will manipulate the 4 tables in the database. I'm planning on using disconnected ADO.NET. Each table will need a different set of SqlCommands used by a DataAdapter. I'm new ...more >>

Read system catalogs for a from another user
Posted by devjnr NO[at]SPAM gmail.com at 9/11/2006 1:55:38 AM
Sql 2005: I have to query ALL views or tables from a database this way: select * from information_schema.views What I'm noticing is that I'm trying to connect to db using a low-permission user and when I query this views I obtain only the objects owned by this user. Is there a way to read...more >>

Storing all Upper Case value
Posted by wrytat at 9/11/2006 1:31:01 AM
I want to keep all the value of a field in my table to the Upper Case, i.e. even if the user keyed 'abc', it will be stored as 'ABC'. I tried using UPPER(fieldvalue) in my update statement, but still the value is stored as lower case. What can I do?...more >>

SELECT IIF(True,Null,'' ) equvalent in sqlserver
Posted by areejan2000 NO[at]SPAM yahoo.com at 9/11/2006 1:28:23 AM
how to convert MSACCESS query SELECT IIF(True,Null,'' ) as Dummyfield from yourtable to sqlserver syntax. ...more >>

Running Average Query ? A Challenge
Posted by Luqman at 9/11/2006 12:38:40 AM
I have an Inventory Application where Receipt and Issued of Quantity are entered, while Only Receipt Value is entered, how can I show the Average Value of Issued Item. Say my Sample Data is : CREATE TABLE test ( PRITC varchar(10) NOT NULL, QTY numeric(10,3) NOT NULL, RATE numeric(18,4)...more >>


DevelopmentNow Blog