all groups > sql server programming > february 2006
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
changing ordinal position of a field
Posted by rameshsaive NO[at]SPAM gmail.com at 2/23/2006 4:55:43 AM
Does anyone have the idea of how to change the ordinal position of a
field using DDL statements in access 97? I know i'm posting it in
incorrect group, as this is the only active group i've visited till
now.
thanks in advance
... more >>
Server management Studio
Posted by zoran at 2/23/2006 4:43:27 AM
Hello,
I wanted to ask you just a opinion
What do you think about the new Ms Server Management Studio?
In my opinion MS did a really slow and less "user friendly" product than we
had before. Maybe I am wrong but I am using it almost every day.
I would prefer an enhanced version of Query... more >>
Help on Query
Posted by Wayne Wengert at 2/23/2006 4:26:40 AM
I have a table that has a field "Judge Name" that may contain names in the
format "J Jones" or "M Smith". I need to change that format to "Jones J" and
"Smith M". I am trying the following query thinking I can use that in an
Update query but I am getting the error:
"Subquery returned more t... more >>
suggest on sub query improvement.
Posted by guoqi zheng at 2/23/2006 4:12:36 AM
Hi,
I have a SQL statement which myself think might be a little tricky. any
suggestion on improvement?
SELECT * FROM tblMsg
WHERE DateAdded <
(SELECT MIN(DateAdded) FROM
(SELECT TOP 140 DateAdded FROM tblMsg Order by DateAdded DESC)
as sss))
Any suggestion on th... more >>
Varchar Local Variable Question
Posted by S Chapman at 2/23/2006 3:24:59 AM
I have a local variable nvarchar(4000) which I use to set the @sql that
I execute in a stored procedure. Sometimes the sql string gets bigger
than 4K and consequently the whole stored procedure fails. How do I get
around this problem of 4K limit?
I have tried using text as a local variable t... more >>
Comma seperated IDS in SELECT query with IN.
Posted by Adarsh at 2/23/2006 2:25:53 AM
How can I use list of comma separated IDS in SELECT query with IN.
DECLARE @TaskID varchar(200)
SET @TaskID = '(30,32)'
SELECT DISTINCT UserID
FROM tbl_UserTask
WHERE TaskID IN @TaskID
... more >>
sql server 2005 error handler
Posted by farshad at 2/23/2006 2:01:54 AM
At present There is a stored procedure with several sql statements. Each one
has a standard sql 2000 error handler. i.e. after each statement there is a
if @@error > 0 ...
does this mean that I have to place a begin catch instead of each present
(if @@error > 0)?
Or, how can I use the begi... more >>
create trigger based on value of 2 fields
Posted by Lee at 2/23/2006 12:02:26 AM
Hello, first of all I have no clue how to set up a trigger, nor do I
understand its code, yet! :)... (But I am willing to learn).
The following tables are to be used:
tblTC (list of training centers... trigger fields & record selection
fields--from other table-- are in this table).
tblGovO... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
transaction problem
Posted by Kasper Birch Olsen at 2/23/2006 12:00:00 AM
hi NG
Im stuck in a really annoying situation.
To transpose a table I have to execute sqlcode from a variable. This
variable has grown way above 8000 chars, so to solve the problem I write to
a file instead and use the osql utility to run the script. Its far from
perfect, but it works, a... more >>
Optimize the query performance?
Posted by Pushkar at 2/23/2006 12:00:00 AM
Hi,
I want to improve performance of my query to ensure that my query does not
timeout.
Scenario:
Table : EmpCheckInCheckOut
Felds: RowNumber,TokenID,CheckinTime,CheckoutTime,Action,EmpName
Query : Select TokenID,CheckinTime,CheckoutTime,EmpName,RowNumber from
EmpCheckInCheckOut EC
... more >>
UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT'
Posted by Newbie at 2/23/2006 12:00:00 AM
good day pros!
im having trouble regarding updating my table trough my vb6 program, and it
displays error message as stated in this post's subject line.
my vb6 program runs the SProc to update my table..
i've search into microsoft KB and didn't found any articles regarding this
aside from I... more >>
How to use regular expressions on T-SQL?
Posted by ABC at 2/23/2006 12:00:00 AM
Cast varchar to decimal
Posted by Greg at 2/22/2006 11:57:26 PM
I am losing my hair....and my mind....
Is there any reason why I wouldn't be able to cast a varchar value of say
7.8 to decimal?
I have a whole bunch of lab results that come with a bunch of garbage in the
result column. I have stripped it away so that it is only a format
[1-x].[0-9]. I... more >>
Query Question
Posted by marty.weel NO[at]SPAM gmail.com at 2/22/2006 11:31:05 PM
I have the following
State with many transitions to other States
Tables include
State
StateId
Name
StateTransitions
StateId
DestStateId
How could I get a list of all the possible states for a given state id?
Thanks in advance,
Mardo
... more >>
previous value in trigger
Posted by Adarsh at 2/22/2006 11:28:47 PM
Hi,
Can I get previous and current values of row in trigger for update
operation.
Regards,
Shah Adarsh.
... more >>
Using an alias in WHERE clause?
Posted by Terry at 2/22/2006 11:11:57 PM
Is there a special way to be able to reference an Aliased column name
in the WHERE clause?
For example, the following works fine (Northwind):
SELECT CompanyName,
(SELECT COUNT(OrderID)
FROM Orders
WHERE Customers.CustomerID = Orders.CustomerID AND
... more >>
Q: SQL Server 2005 and Schemas
Posted by Martin Arvidsson at 2/22/2006 8:32:41 PM
Hi!
I am just learning SQL 2005 and also programing C# (Studio 2005).
Why is it a good idea to use namspacing on the tables in a database? such as
if those schemas exist
Purchase, Sales.
Purchase.PruchaseHead
Purchase.PurchaseDetail
Sales.SalesHead
Sales.SalesDetail
Why just not ... more >>
Restoring database from SQL-2000 to SQL-7
Posted by Hardik Shah at 2/22/2006 7:44:45 PM
Hi,
I have a database on SQL-2000 , I take backup of it and trying to restore in
SQL-7 but I am fail, Is it possible to restoring SQL-2000 to SQL-7 or not.
Thanks in advance.
Hardik Shah
... more >>
Import / export question
Posted by Chubbly Geezer at 2/22/2006 4:52:29 PM
When importing / exporting tables between databases in SQL 2005, the fields
lose any properties that have been set, i.e. primary key.
Any idea if there is a solution to this.
Thanks
... more >>
UPDATE statement optimization?
Posted by David Mackenzie at 2/22/2006 4:45:22 PM
Does anyone know what optimizations SQL Server 2000/2005 carries out
if an UPDATE statement sets a column to its existing value?
For example, the MySQL documentation explicitly states that if an
UPDATE statement sets a column to its existing value, MySQL will not
attempt modify the column at... more >>
Help with float data type
Posted by News at 2/22/2006 4:18:58 PM
Hi,
I am developing a web based application that deals with financial info
(coldfusion and sql server 2000 on shared server). All the numbers that
carry this info are of float data type. I ran into a situation when this
gives all kind of problems.
For example, I calculate cost after very... more >>
Help with most efficient column sorting technique
Posted by MJB at 2/22/2006 4:12:32 PM
I have a SQL 2005 database with 4 million+ rows. One table in
particular has about 35 columns. I have implemented a paged data grid
results view for them. They want to be able to sort on the majority of
the columns. When they sort they want all the results sorted not just
the visible r... more >>
Need a help on a SQL Query
Posted by wubin_98 NO[at]SPAM yahoo.com at 2/22/2006 4:03:25 PM
Could somebody please help me on following SQL Query.
Single table data likes this:
SerialNumber PassedTestType
20001 1
20001 2
20001 3
20001 4
20001 ... more >>
List() Function
Posted by mason at 2/22/2006 3:49:18 PM
Sybase has implemented a useful aggregate function called list() which takes
a column and returns all values in a comma delimited string. In Oracle10g,
there is a Java solution to duplicate this aggregation function. Now I have
to do the same in SQLServer2005. I found the UDA (User Defined Agg... more >>
Printing the results of a dynamic query
Posted by RSH at 2/22/2006 3:41:24 PM
I have a situation where I need to run several Queries from different NON
RELATED tables and I would like to print the results on a single formatted
line.
Code:
PRINT 'FUTA--------------'
--FUTA
SET @QUERY = 'SELECT sum(CompanyAmount) as CompanyAmountTotal,
sum(CompanyAdjWage) as Com... more >>
SqlServer 2005 Express Question
Posted by Richard Thayne at 2/22/2006 3:37:45 PM
I have created a database in 2005 Express and now I need to move it onto
a SQLServer 2005 box (regular edition). Can it be done and how? I have
web surfed and found nothing. Thanks.
... more >>
When to use Distinct vs Group By
Posted by Rich at 2/22/2006 2:56:28 PM
Hello,
I want to retrieve a distinct list of elements from a column not including
any aggregate functions. I can do this by
Select col1 from tbl1 Group By col1
or
Select Distinct col1 from tbl1
Is there any criteria for using Distinct vs group by or group by vs distinct
when not... more >>
Math in a column
Posted by wnfisba at 2/22/2006 1:37:30 PM
Can't I perform Math functions in deriving a column???
Check out the following SQL which DOES NOT work...
SELECT GEN.loan_num,
MKT.yield_prem,
MKT.yield_fee,
GEN.ysp_to_wire,
GEN.loan_amt,
(MKT.yield_fee =
(GEN.loan_amt *
(MKT.yield_prem/100)))
FROM DataTrac.dbo.GEN,
DataTra... more >>
VAlidate
Posted by alejandro at 2/22/2006 1:30:49 PM
HI, i have table with with a column named expire_date , i want to make a
rule for block enter a date < today date , how i can make this?? only dates
> today must be enter in this column.
Thanks in advance
alejandro carnero
... more >>
Strange rollbacks happening
Posted by Carl Henthorn at 2/22/2006 12:49:28 PM
I have 6 sql servers running sql2k sp3 that process data. One part of my
process consists of updating two varchar(8) feilds with the latest date. This
code has been working for 3 years now. While I do not use any tran
statements, yesterday the updates started rolling back one of the columns
... more >>
Active Directory / Groups + MS SQL (yikes???)
Posted by jebuskrust NO[at]SPAM gmail.com at 2/22/2006 12:48:28 PM
When configuring ms sql to permit authentication from users over a
domain. Is it possible to poll from system tables like sysusers /
sysmembers / sysgroups / sysprocesses / etc what active directory
group's a specific user is a member of once they are authenticated into
a ms sql server? I've bee... more >>
Insert running slow
Posted by Larry Charlton at 2/22/2006 12:46:27 PM
Are inserts really slow in 2005 or am I doing something stupid?
Here's the table:
CREATE TABLE [dbo].[Tickets](
[ticket] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[data] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[added] [datetime] NOT NULL CONSTRAINT... more >>
Calling a user function
Posted by mason at 2/22/2006 12:27:08 PM
I created a user function fn and MSSQL did not let me call it without a
schema prefix. Do I need to create a synonym to get around this behavior?
Thanks.
select fn()
error: 'fn' is not recognized built-in function name
select dbo.fn()
works fine.
... more >>
Date and time stamp
Posted by blueboy at 2/22/2006 11:22:38 AM
Hi im having a few problems saving a file with the data and time i am
using the below t-sql but can only get the date and not the time.
CONVERT(NVARCHAR(16),GETDATE(),112)
Any guidance would very much be appreciated.
thanks in advance
... more >>
email using
Posted by Kalyan at 2/22/2006 11:07:29 AM
hi
can any one guide me, how to send email using stored procedure in sql server
2000 in windows 2003 o/s without using mail client installed on server.
Thanks
Kalyan
... more >>
Help with exception list from another table
Posted by Matthew at 2/22/2006 10:49:17 AM
I hate to do this, but I need to now. The program below sends an e-mail
alert for each server/drive that is below the critical threshold. Well
it turns out that I need an exception list for some servers. So I
created that list in a new table with the following fields
Computer VARCHAR (128),
... more >>
Optimizing daylight savings query by not using UNION
Posted by br at 2/22/2006 9:46:28 AM
I was interested in optimizing a query I created in SQL Server 2000 for
adjusting time zones for daylight savings time (only USA DST for simplicity).
In essence I have one table "tblDaylightSavingsTime" where the PK is Year,
with fields Spring_Forward (ex: 4/3/2005 2:00:00 AM), and Fall_back ... more >>
how to retrieve full text of procedure definition from syscomment
Posted by Rich at 2/22/2006 9:09:40 AM
Hello,
I am trying to locate where/when data is being inserted into a table from a
DB I recently inherited. So I write this in QA
select * from syscomments where
text like '%Insert Into CompareSubscribers%'
This will retrieve the procedure(s) that contains the text "...Insert
Into..... more >>
temp table dilemna
Posted by CharlesA at 2/22/2006 9:09:28 AM
We have to import huge quantities of data into our database on a SQL server
2000 box (running under NT 2003 server). Our requirement is to create temp
tables that house anything from 5 Million to 7 Millions rows
This will happen once a week as run by whatever account runs a DTS package
is it... more >>
Datagrid/Stored Procedure Issue
Posted by MJKulangara at 2/22/2006 8:58:12 AM
I have a developer that has databound datagrids as follows:
Datagrid.datasource= DataSet (yes, the compiler allows this)
The dataset is returned from stored procedures. Each of the sps return
a single recordset, but periodically we are seeing some
nondeterministic behavior where the code for... more >>
Opinios: SQL DB Dev MCP Exam 70-229
Posted by Joel at 2/22/2006 8:05:26 AM
I'm terrified, and could use some opinions from the user community...
I'm about to take my first ever Microsoft MCP exam on SQL Server 2000
Development (70-229). To prepare, I've been reading the SQL Server 2000
Design Exam Study Guide from Sybex Books.
One of the problems I have is with a... more >>
CLR Stored procedure to access OleDb datasource, how?
Posted by Va1era at 2/22/2006 7:17:34 AM
I tried to write a CLR stored procedure using C# in SQL 2005 to access an
Access
database.
When I use the OleDbConnection class in System.Data, the procedure throws
SecurityException at runtime.
Output as following:
System.Security.SecurityException: Request for the permission of typ... more >>
updating rows using cursor
Posted by Koert at 2/22/2006 6:57:29 AM
Hi there,
i have a problem with updating rows using a cursor, my code is below:
-- Fill column DataId for each row in the Data table
DECLARE @index1 int, @index2 int
DECLARE DataID_Cursor CURSOR FOR
SELECT index1, index2
FROM data
OPEN DataID_Cursor
FETCH NEXT FROM DataID_Cursor
INT... more >>
first day of week by Week Number
Posted by tomek at 2/22/2006 4:30:05 AM
I was looking for a solution for this problem - but none of what I
found in Internet helped - so finally I made something myself ( based a
little bit on someone's idea). I hope it will be useful to someone - or
maybe u'll see some bugs in it? please report.
there 2 assumptions
1. before execu... more >>
2005 using CLR for UDF accessing DirectoryServices
Posted by HowardB at 2/22/2006 2:21:48 AM
Not sure if this is correct group, but I cannot access
DirectoryServices namespace (directoryservices.dll) when creating (or
running) a C# UDF.
It seems that this is a 'feature', but why - and is there a way round
it - I need to access Active Directory from the UDF.
Thanks
Howard.
... more >>
Output to serial port
Posted by Michael at 2/22/2006 2:14:16 AM
Is it possible for an event coming into the database (I have an access
control system that uses SQL server, and it has an event type column
for alarms, troubles, etc. Is it possible to set up a command to
output a specific ASCII command based on incoming data? Any help would
be appreciated... more >>
Internet Access
Posted by Oddie at 2/22/2006 12:38:28 AM
Hi.
Does anyone have any advice to how to connect to the SQL Server2000 via the
Internet?
Background:
1. SQL Server2000 setup as NT Authen only
2. Internet access from the public (that is no work NT accounts)
3. I do not want to code any SQL Server password into the web application
(e.g... more >>
question about process order
Posted by Robert Bravery at 2/22/2006 12:00:00 AM
Hi all,
I have a trigger for update on a table. It does a whole bunch of things,
then calls a SP. I want to then check something afet the SP is completed. To
check this out I put a print statement after the line that called the SP
exec calcdeductables @claimid, 1
print 'Check SIP'
The SP, ... more >>
Audit Add Windows Login?
Posted by Pushkar at 2/22/2006 12:00:00 AM
Hi,
I want to audit add/drop of windows login to my sql server.
Through SQL Profiler Add/Drop login I can only Audit Add/Drop login of SQL
Security Login and not the windows login.
Is there any way to audit Adding of windows login?
Thanks
Pushkar
... more >>
Help with Best practie and design
Posted by Robert Bravery at 2/22/2006 12:00:00 AM
HI all,
I covert your input.
I am designing a claims database. I am looking at have a common claims
header table, that will keep all common thing to every claim, and then
seperate tables depending on the type/class of claim. So I could have a
motor, marine, asset for example. Reason being that ... more >>
|