all groups > sql server programming > june 2004 > threads for monday june 7
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
I give up! Where is the definition of " N'... "
Posted by Larry Woods at 6/7/2004 10:31:36 PM
I can't find the definition of the use of N'.....' in SP's anywhere in the
BOL. Obviously I don't know what "N" is called.
TIA,
Larry Woods
... more >>
Command prompt utility for running a TSQL script
Posted by Amin Sobati at 6/7/2004 10:07:10 PM
Hi,
I have some tsql command(in a *.sql file) that I need to execute them from a
command prompt utility. For example, I need to provide a batch file so that
the user execute that simply, then the batch file runs the tsql commands.
How can I perform this?
Any help would be greatly appreciated,
... more >>
Date Format
Posted by Amin Sobati at 6/7/2004 10:07:02 PM
Hi,
I need to format the result of SELECT GETDATE() in customized order of
D/M/Y.
Any help would be greatly appreciated,
Thanks,
Amin
... more >>
Xml using SQLQueryData - help
Posted by Timothy V at 6/7/2004 9:29:01 PM
Hi,
I'm having trouble working this out and was wondering if anyone could help
me. I have a query:
SELECT
1 AS Tag,
NULL AS Parent,
classID AS [Class!1!classID],
className AS [Class!1!Name!element]
FROM Classes
FOR XML EXPLICIT;
The problem is that when i invoke this:
X... more >>
only grab number from string
Posted by Paola at 6/7/2004 9:26:03 PM
Hi
I have a string that looks like this: Validation Protocol (12)
Right now I used rtrim to grab the last 4 characters. I need help in only getting the numbers without the brackets. Please assist
Thx... more >>
mueric representation of a string
Posted by Richard R at 6/7/2004 8:58:31 PM
Hi,
Quick question with a possibly long answer.
Is there a simple T-SQL function that takes a string as an input, and
returns an numeric representation such that the order of the returned
integers is alphabetical order?
ie: fn(a) > fn(aa) > fn(b) and so on.
I don't think there is, but t... more >>
rename a table
Posted by TJS at 6/7/2004 8:54:04 PM
I am trying to rename a table from a query by this statement
Execute sp_rename 'SubMenuItem', 'Portal_MenuSubItems'
but it gives me an error message :
The following error occured while executing the query:
Server: Msg 15225, Level 11, State 1, Line 273
No item by the name of 'SubMenuItem'... more >>
complex query
Posted by ford6 at 6/7/2004 8:21:44 PM
I have a table that has customers. I have another table
with a record for each individual customer purchase which
includes date of purchase. So repeat customers have
multiple entries in the purchases database. I need to
find out the following: How many customers purchased in a
given mo... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Backup Password and PasswordMedia
Posted by Otis at 6/7/2004 7:51:20 PM
Hi,
I am writing a VB6/MSDE app to be used by people who do not want to become
DBAs. I want to provide password protection for backups but I can't figure
out a way to prevent a confusing mess when the password is changed.
What I would like to do is not to get the user involved directly and u... more >>
Need advice w/ table design
Posted by Sam at 6/7/2004 7:40:42 PM
Hi,
I want to define business objects and their properties in a database. I'm
thinking about defining all business objects in one table i.e. departments,
processes, computers, etc. and their properties in another table. My
question is properties of some these objects are numeric and others are... more >>
copy data
Posted by Rob at 6/7/2004 5:30:14 PM
Anyone know how to insert data into a new column from the same database?
For example, database name is TEST with 2 columns (column1 and column2). Now
if you add a new column (column3) how can I copy all the data from column2
to column3, in the same database/server?
Thanks.
... more >>
find a char
Posted by qwerty at 6/7/2004 5:07:52 PM
how do u find the loaction of a certain char in a field.
for example lets say i was lookofr a space?
i would like the result of the query to look like this.
information loaction
hhhh hhhh 5
hhhhh hhhh 6
hhhhhh hhh 7
THANKS!
... more >>
SP Report to Return YTD and Last Years Numbers
Posted by Bryan Harrington at 6/7/2004 4:21:33 PM
OK.. I'm working on an SP to do some reporting on claims being written off
I need to return a count and dollars for THIS fiscal year to date (10/1/03 -
Current) and also return dollars for Last Fiscal Year (and the year before..
and the year before that). The problem that I'm having is that sin... more >>
Unit Tests questions
Posted by chrisrath NO[at]SPAM aol.com at 6/7/2004 4:04:30 PM
I have two questions related to some tsqlunit tests that I'm writing.
1). Is there a way to temporarily suppress the print output from system stored
procedures? In the immediate case, I am calling DBCC CHECKIDENT from the
teardown proc and it's echoing messages into the query analyzer window ... more >>
IsMoney
Posted by SKG at 6/7/2004 3:45:27 PM
Is there any function which can validate whether a text string is a valid
money type
like $2.5
... more >>
audit trigger
Posted by Darren Woodbrey at 6/7/2004 3:33:01 PM
I am trying to implement an audit trigger I found on the net. It gives me
an error when I try to update a record saying "no PK on table wo_main". The
table wo_main does have a primary key 'entry'. Can anyone help me out with
this? Here is the trigger:
create trigger tr_wo_main on wo_main f... more >>
GROUP BY problem with subqueries
Posted by mike at 6/7/2004 3:21:20 PM
--Hi. I'm a little new to SQL so any help would be big
help. Someone told my I need to use DDL in a prior thread
but I'm not sure what that means. I hope the explanation
below is adequate. I was told that the naming conventions
are a little screwy but that's largely out of my hands.
I'll s... more >>
Return extra columns in a SELECT
Posted by richardb at 6/7/2004 1:51:03 PM
I am selecting patient appointments between two dates, as shown
SELECT A.PatUniqueID, PatName FROM Appointments A WHERE ApptDate BETWEEN DateLow AND DateHIgh
However, I also want to return the first (lowest) active insurance plan for this patient in the same row
SELECT I.PatUniqueID, Min(plan... more >>
Memory "leaking" from ADO!!! Help!
Posted by Sander Verhagen at 6/7/2004 1:41:32 PM
Hi,
Using ADO I'm experiencing what I would call a memory leak. It might
formally not be one, because I have no prove that my application is not
nicely releasing the data on exit, but every time the code below is called,
the memory use of my application (as Windows Task Manager shows it) is
... more >>
Loooong running stored procedure
Posted by SKG at 6/7/2004 1:30:20 PM
Iam running a stored proc in a Job. This will run for long time during
normal operations.
It will copy a few hundred thousands of records from one table to another.
I want SQL to let process other user requests at this time. Will
WairForDelay relieve control to SQL to process other queries faste... more >>
Can A stored procedure return a table variable?
Posted by A.M at 6/7/2004 1:28:39 PM
Hi,
Can a stored procedure return an table output parameter?
If the answer is yes, then what is the syntax? and does sql server transfers
all data in the table between caller and stored procedure or only the
reference to that variable is being passed?
Thanks,
Alan
... more >>
Using Aliases to calculate another Alias
Posted by ASP.Confused at 6/7/2004 1:25:04 PM
I keep getting an "Invalid Column Name" error. How can I fix this, or can I
use variables within a query, or should I just do a stored procedure?
I have a SQL statement similar to the following:
SELECT
CASE WHEN (ISNUMERIC(col1) + ISNUMERIC(col2) + ISNUMERIC(col3)) > 0 THEN
((ISNULL(co... more >>
Writing good formatted SQL
Posted by Nags at 6/7/2004 1:19:46 PM
Does any one know of any document or any website which has information about
writing GOOD, WELL FORMATTED SQL's.
A normal SQL can be written in several ways. We are trying to come up with
a standard in writing queries, and we are researching on if there are any
standards already available, so... more >>
How do I add code to send a result set to file without using the icons in QA?
Posted by dg at 6/7/2004 1:12:30 PM
Hi all
How can I add code to my query to send the result set to a file? Similar to
Oracles spooling. I want to avoid using the icons and save as file type
features of QA. Also is it possiable to append a date timestamp to this
same file?
thanks
... more >>
SQL Profiler Exception Error Codes
Posted by hdsjunk at 6/7/2004 1:01:14 PM
I am running a trace using profiler in order to find
performance issues. I have several Exceptions being
returned; however all I know is the code, severity, and
state. Is there somewhere I can look these up?
Thank you!... more >>
Stored Procedure - unrecognized variable(s)
Posted by Steve Williams at 6/7/2004 11:28:57 AM
This is weird enough that I think I need to lay it out as follows:
SITUATION:
Stored procedures (SPs) that runs properly on my development
machine but not at the client's.
SYMPTOM:
A VB.net Windows application using the SPs seemed to have
"issues" - wher... more >>
Single quotes in stored procedure parameters
Posted by jhoge123 NO[at]SPAM yahoo.com at 6/7/2004 11:24:57 AM
I've recently upgraded to Mdac 2.7, after running 2.5sp3 for a few
years with few problems. One very wierd thing started hapening with a
web application. I have a form to edit rows of a table by passing form
fields to a stored procedure, which is pretty much like this:
create proc updater(@key... more >>
Importing XML file into Table
Posted by Rafael Chemtob at 6/7/2004 11:20:21 AM
How do I import into an XML file into a SQL table.
rafael
... more >>
Check for open cursors
Posted by Klaus at 6/7/2004 10:53:30 AM
Hi!
Is it somehow possible to check for declared/open cursors.
The reason why I am asking is that I declare a cursor in
an IF-ELSE statement. That means that the cursor has only
been declared/opened under certain conditions.
If I later try to close the cursor, and it hasn't been
decla... more >>
SP Question: Need to execute a COMPLETE SQL Statement and return Identity
Posted by Larry Woods at 6/7/2004 10:40:19 AM
I have an application that has created a complete INSERT statement via code.
When I execute this statement I want to get the IDENTITY of the resulting
record. My idea was to use a SP to execute the string that contains the
INSERT statement, then return @@IDENTITY.
Make sense? Other ideas?
... more >>
SELECT SCOPE_IDENTITY() with PHP....ahhhhh!
Posted by Rizyak at 6/7/2004 10:40:16 AM
This message is being cross posted to:
alt.comp.lang.php
alt.php.sql
microsoft.public.sqlserver.programming
I have two tables, bars & contacts. Using 1 form to input information about
both the bar and the contact I need to be sure that the contact_id for that
session is input in the appr... more >>
field description
Posted by Mark at 6/7/2004 10:25:07 AM
Hi,
How to put column description?
I use sqlserver 7.0, I try to this,
but it doesn't work.
CREATE table T1 (id int , name char (20))
GO
EXEC sp_addextendedproperty 'caption', 'Employee ID', 'user', dbo,
'table', T1, 'column', id
Thanks,
--
Mark
... more >>
Linked Server to Oracle - please help
Posted by Mark Andrews at 6/7/2004 10:02:37 AM
I can't seem to get a linked server pointing to an Oracle database to work.
I need to be able to insert records from SQL Server to Oracle and prefer not
to use DTS. Would like to find out the best way to make this work.
This code does work:
DECLARE @temp_sql varchar(7000)
SELECT @temp_sql ... more >>
SP to return DB size
Posted by rikesh at 6/7/2004 10:00:00 AM
Hi
Is there any system SP's that return the size remaining of a Database or a
Server??
--
Kind Regards
Rikesh
(SQL2K-SP3/W2K-SP4)
... more >>
REPLACE function and space.
Posted by Derek at 6/7/2004 9:41:01 AM
Hello all
I create the following temporary table
CREATE TABLE #test (Col1 VARCHAR(30)
INSERT INTO #Test SELECT '28%orange 72%water
--The following doesn't work
SELECT REPLACE(Col1, '%', '% ') FROM #Tes
--The following does work
SELECT REPLACE('28%orange 72%water', '%', '% '
Why doesn't... more >>
Excel Sheet column with numbers shows as float
Posted by SKG at 6/7/2004 9:40:15 AM
In excel i have a column which has numeric values. Some start with zeros.
Iam trying to import from excel using DTS.
But this column is being imported as float can any one tell me why.? I want
it to be imported with zeros as a text field.
Thanks!!!
... more >>
Must I use a Cursor?
Posted by silversalmon25 NO[at]SPAM yahoo.com at 6/7/2004 9:01:51 AM
I have a table that contains name and Age. I want to put each record
into another table that will have a key and a collumn containing XML
that looks like this (formated for easy reading):
<xml Description="NameWithAge">
<EventData>
<RSchema Name="Name" Value="{Name}"/>
<RSchema Name="... more >>
Re-Building Indexes
Posted by Tony C at 6/7/2004 7:30:03 AM
Is it possible to re-build indexes from MS Access?... more >>
Speed up
Posted by Denis Crotty at 6/7/2004 7:21:02 AM
Hi
I have written a small query tool for a database. When the user selects certain columns to use in the query, the input box for entering the search variable changes to a drop dwon selection box with all the distinct choices in the database. The problem I'm having is that the number of choices ... more >>
Is there a simple way to query self-referencing table?
Posted by foolmelon NO[at]SPAM hotmail.com at 6/7/2004 7:08:45 AM
Say I have following table:
Table Employee:
column 1(PK): employee_id
column 2: employee_name
column 3: manager_employee_id (foreign key link to column 1)
Is there a simple way to write following query: for a given employee
id, the query returns the employee's name and the manager's name.... more >>
Views - General Question
Posted by Gerard at 6/7/2004 6:32:14 AM
Hey all,
I just need to know some rules for making Views
updateable. I have realized the hard way, that doing joins
(left or right) in the SQL pane of a view usually leads to
the view not being updateable. I know there is a way to
derive one view from another view. What I have read is... more >>
Compatibility Level
Posted by Richard J at 6/7/2004 5:51:04 AM
Hi group,
This question may be a little off-topic for this specific newsgroup, but thought I would post it here anyway
I have SQL2k installed on my local machine with databases set at a SQL Server 6.5 compatibility level (when I run the sp_dbcmptlevel stored procedure against any of the database... more >>
SQL Query Analyser Debugger
Posted by Phil Davy at 6/7/2004 4:06:02 AM
Hi
I need to debug some script with loads of IF statements but cannot find where the debugging toolbar is, despite it being shown in the help information.
My version of Query Analyser is 8.00.760
Can someone pls advise me how to enable the debugger (if possible)
Thanks
Phil... more >>
Dynamic Memory
Posted by Malik at 6/7/2004 3:31:03 AM
Dear h
How to increase Dynamic Memory for sql server2000
thanx.... more >>
Use Bulk Insert to overwrite some rows in a table
Posted by moonriver at 6/7/2004 3:06:41 AM
Could I use "bulk insert" command to overwrite some rows
with same primary key with the inserted rows? i.e., for a
row to be inserted, if there is already a row with the
same primary key in the table, update the existing row;
Otherwise, just insert it.
... more >>
ADO NextRecordSet
Posted by paul.gamblen NO[at]SPAM pacmicro.com.au at 6/7/2004 2:20:39 AM
Hi
Im executing multiple SQL statements within a batch (using ADO) and
using the ADO NextRecordset method to loop through the returned
results. Im actually expecting some of the SQL statements to error for
one reason or another, however when I call NextRecordset after I have
retrieved inform... more >>
uniqueidentifier
Posted by samir.sabri NO[at]SPAM laposte.net at 6/7/2004 1:58:03 AM
How to migrate a database that use uniqueidentifier as primary key to
the same using int as primary key ?... more >>
player stats
Posted by tranphp at 6/7/2004 1:16:02 AM
I have a table for stats and a table for players. My stats table contain individual stats for each game
"stats" - playerid, pts, reb, ast, stl, bl
"player" - playerid, firstname, lastnam
I need to extract and add the stats for the player with the most points, rebounds, assists, etc. They'll p... more >>
|