all groups > sql server programming > february 2005 > threads for friday february 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
Check for username
Posted by Ed_P. at 2/4/2005 9:27:27 PM
Hello,
I have the following Table:
CREATE TABLE [dbo].[tb_User] (
[usr_id] [int] IDENTITY (1, 1) NOT NULL ,
[usg_groupID] [int] NOT NULL ,
[usr_createdBy] [int] NOT NULL ,
[usr_isActive] [int] NOT NULL ,
[usr_dateCreated] [datetime] NOT NULL ,
[usr_userName] [varchar] (25) NULL ,
... more >>
No columns defined in rowset
Posted by Sa at 2/4/2005 7:47:08 PM
Hello Experts,
I have a stored procedure. I used ADO to called this stored procedure. In
runtime, it says "No columns defined in rowset".
Here is my stored procedure:
================================================
CREATE PROCEDURE [sp_MigrateAccount]
@i_vchSessionID VARCHAR(50)... more >>
XML as parameter to stored procedure
Posted by J at 2/4/2005 7:46:36 PM
Any thoughts on using XML as a parameter to a stored procedure? I can think
of a great advantage to using this technique. Instead of having to manage
transactions spaning over multiple stored procedures, XML can be used to
passing the entire transaction in one stored procedure.
... more >>
sum multiple record and inset in one table
Posted by Owen at 2/4/2005 7:26:04 PM
Hello:
I want to get multiple record from table and then sum all this value and
insert this result in other table like this:
have one table with Id, RecNo and text, one article have only one id and a
lot of RecNo, in each RecNo have a line of text. This is a old database. I
want to sum all ... more >>
How to Download Remote SQL Server Database to Desktop for Development (Desktop Has MSDE & Visual Studio .Net)
Posted by TC at 2/4/2005 7:19:53 PM
Hello All,
I apology for posting to many groups but I wasn't sure which group would be
best targeted with my question.
I have inherited an ASP.Net application that requires some maintenance & bug
fixes. I have been asked to also download a copy of the remote SQL Server
database that it ... more >>
Insert into ...(select .. myTable order by ...)question
Posted by Agnes at 2/4/2005 6:53:18 PM
Insert Into myNewTable (select invno,issuedate,transdate from myTable order
by company,issuedate)
Now, I check myNewTable, and found the order which is not'by issuedate'
P.S - myTable 's order is like a mess and not well order,
... more >>
Export and email query as a CSV
Posted by celtic_kiwi at 2/4/2005 6:46:45 PM
I would like to run a set of SQL statements stored in a table and email
the results as an attached CSV. This will be run as a procedure.
I also have to use an external mail server. I got an email
component,XPSMTP.DLL - SQL Server SMTP Mail XP, from
http://www.sqldev.net/xp/xpsmtp.htm#Installat... more >>
Transaction span stored procedures
Posted by J at 2/4/2005 5:57:38 PM
Is it possible to have a transaction span multiple stored procedure or maybe
the same stored procedure multiple times?
I have seen something called a @trancount. Is this available in SQL Server?
Thank You for any information toward this end.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
HIPAA and SQLServer
Posted by Gopinath Rajee at 2/4/2005 5:52:28 PM
Hello All,
Is there a document that talks about HIPAA compliance in a SQLServer
Environment.
I'm posting this in the SQLServer.Server newsgroup as well.
Gopi
... more >>
T-SQL on datetime column
Posted by Robert Richards via SQLMonster.com at 2/4/2005 5:41:48 PM
I have a datetime column that stores the dates in the following format:
yyyy-mm-dd hh:mm:ss[.fff].
I have run a "select *" and there are 5 records that have a value of 2005-
02-03 17:39:55.980 in the filedate column, but when I run the following, I
do not get any returns.
select filename fr... more >>
newbie, concatenate values of related table.
Posted by dik mus at 2/4/2005 5:34:39 PM
Hi,
I cant believe there is no standard solution for this, so i hope i am
missing something and someone can help me out.
I have two tables (say empoyees and tasks)
I want to create one table that shows: [emloyee name] , [list of all tasks
for that employee seperated by , ]
If I was a mi... more >>
prevent zero length entries
Posted by Keith G Hicks at 2/4/2005 5:14:44 PM
I have a couple critical fields where I am setting them to no nulls but just
realized that they can be set to zero length strings very easily. Other than
a trigger or handling the validation in the front end, is there an easy way
to handle this?
MS Access is my front end so interestingly enoug... more >>
View Uncommitted Query or Data in Sql 2K ?
Posted by Luqman at 2/4/2005 4:19:51 PM
How can I view uncommitted Query or Data in Sql Server 2000 ?
Say, I have run various queries on Sql Server 2000 but now want to COMMIT
certain queries.
Best Regards,
Luqman
... more >>
Frequency distribution SQL statement
Posted by Steve at 2/4/2005 3:49:34 PM
I have a table which contains attribute names and values
for example:
attrib_name attrib_value
Age 20
Height 70
Weight 165
Age 25
Height 67
Weight 168
Age 20
Height ... more >>
Job & Temporal tables
Posted by popootts at 2/4/2005 3:37:03 PM
Hi everyone. Thanks in advance for any answer you can provide.
I got a sp with lots of temporal tables (not global, just #) and it runs ok
with osql. However when I schedule it in a job it returns an error that tells
me that #temp does not exist.
Someone told me that I need to create global te... more >>
DTS Import Text File Replacement - too many errors with DTS
Posted by Ed West at 2/4/2005 3:24:43 PM
I am using the DTS COM object to import a bunch of different text files.
some are 2 or 3 million rows. if there's an invalid row (can't find
row delimiter or column delimiter) sometimes DTS will crash and stop the
import... it even does it if I try to import it from the GUI, and going
int... more >>
Re: Is this query possible in Sql Server ?
Posted by Devinder Singh at 2/4/2005 3:15:49 PM
the query is
Select * from Contract where cn in (select cn from Invoice) and rev in
(select rev from Invoice)
... more >>
Problem ....Kindly get me out of this
Posted by Malik Asif Joyia at 2/4/2005 3:13:07 PM
Hello
kindly tell me that is there any way to update a table in a user defined
function
I want to execute a Update Command in the Function .
Plz help me as soon as possible
Thanks
... more >>
WMI methods availabe for SQL Server??
Posted by Lou Machado at 2/4/2005 3:05:02 PM
So in theory I should be able to do certain database management activities
via a combination wmi and scripting.
My problems is I can't see what methods are availabe via wmi to work into my
scripts. It should be fairly basic. I want one script to create a database
another to delete it. Sou... more >>
Data Tranformation in Replication
Posted by Nitin at 2/4/2005 2:55:02 PM
I have a transactional replication set up from one system to another.
Subscriber has only read mode on data (Uni-directional Replication). I need
to do lots of transformation in the data while replication from Publisher to
Subcriber Like adding the same record in the other table as well or do ... more >>
Is this query possible in Sql Server ?
Posted by Luqman at 2/4/2005 2:34:56 PM
I use this query in Oracle, is such query possible in Sql Server, if so,
what is the sql server syntax.
Select * from Contract
where (cn,rev) in
(select cn,rev from Invoice)
Best Regards,
Luqman
... more >>
Indexing..... Which one will use....
Posted by Akshay Sen at 2/4/2005 2:27:22 PM
I have a table with the following columns.
Customer Id, SSN and rest of the columns.
I have two queries, one with WHERE criteria as CustomerId and other with
WHERE criteria as SSN.
I have created two Index on the above table. One index uses CustomerId as
the indexed column and other index... more >>
Set Begin Transction by default ?
Posted by Luqman at 2/4/2005 2:26:04 PM
I have to set Begin Transaction, every time I use update and delete query,
so that I can Rollback in case of any mistake, but in Oracle, I don't have
to type Begin Transaction, just Rollback works out. Is there any such way in
Sql Server, because sometime I forget to write Begin Transaction befor... more >>
shrink file
Posted by Britney at 2/4/2005 2:16:18 PM
I want to free up some disk space, So I deleted 1000000 rows from a history
table. You thought the database size is decreased, but in reality it's not.
I went to the Enterprise manager --> go to property of my Database, but size
is still remaining the same as before.
Before deletion:
... more >>
Coping table from one database to another
Posted by Valery Frolov at 2/4/2005 2:08:29 PM
I have databases HR and HR2
how copy table PERSONS from database HR to HR2?
Thanks a lot!
... more >>
SQL Server 2005 and VS 2003
Posted by Thore Berntsen at 2/4/2005 1:53:12 PM
Can I connect to a SQL server 2005 database from Visual Studio 2003?
Thore Berntsen
... more >>
Update Text data type column
Posted by Hai at 2/4/2005 1:41:32 PM
Dear SQL gurus,
Here is my table with History as Text data type
CREATE TABLE [dbo].[articles] (
[articleNO] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[createdBy] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[createdDate] [smalldatetime] NOT NULL ,
... more >>
XML file to Database
Posted by Emma at 2/4/2005 12:29:02 PM
I have a database application that stores configuration information in an XML
file on the user’s desktop/laptop. If the user’s computer crashes, the
configuration information is lost. In addition, the user can’t work on any
other computer. When they do, they end up using the configuratio... more >>
How to get values from SELECT stmt into local variables?
Posted by mkerrigan NO[at]SPAM ktoys.com at 2/4/2005 12:18:55 PM
I have a table which is used for history. It has several fields, any
one of which would be "updated", but in this case, a new record is
inserted instead with a new value and effective date. The old values
in the previous record need to be inserted into the new record as well.
I am using a ... more >>
varchar more than 8000 characters ?
Posted by Irfan Akram at 2/4/2005 12:15:02 PM
Hi Guys,
I was wondering how we can have a representation in SQL Server which can
store more than 8000 characters, as I run out of space to store a big xml
structure. Wondering how I can store a value more than 8000 characters long...
will value feedback...
Thanks.
I.A... more >>
Searching for field name in the tables of a database
Posted by Ray at 2/4/2005 12:05:38 PM
Dear all,
Is there any sql command for Searching a specific field name in the
tables of a database? Since I would like to change a field name within
tables but there are many tables in the database.
Thanks,
Ray
... more >>
Login fails when trying to load a txt file to a table
Posted by Dan Carnathan at 2/4/2005 11:29:09 AM
I have just installed .NET and SQL 2000 on my system. I have MSSQL on my C:
drive and my tables on D:.
I am using BCP to load my tables but am getting :
SQLstate = 37000, NativeError = 4060
Cannot open database requested in login 'D:\Database\Inventory'. Login fails.
It worked when everyth... more >>
Insert into Image field
Posted by Emma at 2/4/2005 11:27:02 AM
I am reading a binary data from file and I want to insert it into an image
field as follows:
Insert INTO TableName (IDField, Imagefield). I get an incorrect syntax when
I do this. How do I resolve it?
Thanks... more >>
Update or Delete querys with Joins
Posted by bob at zachys at 2/4/2005 11:23:03 AM
Im trying to update data on one table when it has a related record from
another table. I have done this in MSAccess which allows you to join the
tables with fields that have matching data. I have been unsuccessful trying
this in SQL server.... more >>
Cannot update identity column
Posted by vickie at 2/4/2005 11:12:05 AM
I have just taken over a sqlserver 2k database using C# (not to mention I
don't know the language). I have a column in one of the tables that is an
autonumber as well as a primary key. Here is the problem, the autonumber
was created to display the current year and a number. Example, 2004001,
20... more >>
Architecture question.
Posted by Kenny M. at 2/4/2005 11:03:02 AM
Hi
I have a Windows Form running in 40 clients around the city, those apps are
communicating with a central SQLDB hosted in a hosting company (each one is
sending data, waiting for data comparisons and receiving the data back). I
have been using a Web Service to make the link between my app... more >>
double lines with osql
Posted by Torry Slaton at 2/4/2005 10:56:46 AM
Does anyone know how to eliminate the double lines that osql puts in your
output?
The help file says: "When running stored procedures, osql prints a blank
line between each set of results in a batch."
This may or may not be my problem. A very simple example:
osql -S[server_name] -U[logon_... more >>
reregister sqlDmo.dll
Posted by simon at 2/4/2005 10:46:30 AM
When I try to script my database, I get the following error:
schema_name is not recognized function name
I found that I have to reregister sqlDmo.dll
How can I do that?
Thank you,
Simon
... more >>
SQL MAIL
Posted by Shahriar at 2/4/2005 10:30:29 AM
I posted this question earlier, but I still need help.
I am trying to configure SQL mail. I have a machine running XP with
microsoft outlook 2002 and SQL server 2000. This machine is NOT part of a
domain. It is part of a workgroup. Can SQL mail work under this
environment? If so, how? In ... more >>
Extended Stored Procedure Problem
Posted by Charles Parker at 2/4/2005 9:56:13 AM
I am using the Open Data Services to program an extended stored procedure.
The extended stored procedure is called from a table trigger. The problem I
am having is the call to srv_paramlen(...) returns 30 for a varchar(255)
variable even when the data is longer than 30. Therefore when I retrieve ... more >>
Rename a column
Posted by x-rays at 2/4/2005 8:49:01 AM
Is it safe to use DBCC RENAMECOLUMN(@table, @oldname, @newname)
or is better to drop the column and recreate it?
Thanks in advance?... more >>
XML Processing in SQL Server
Posted by Irfan Akram at 2/4/2005 8:33:06 AM
Hi Guys,
I am writing a web-application in asp.net, using SQL Server as the back end
database.
I have the following table that I want to write to.
Question_Details (Question_id, Subject, Level, Parent, Num_SubParts).
I use the following Stored Procedure to achieve this: -
CREATE Pro... more >>
SQL XML
Posted by mvp at 2/4/2005 8:19:05 AM
Hello,
I am trying to load bulk xml into database table using
following ActiveX script in DTS package
Function Main()
Dim objXBulkLoad
Set objXBulkLoad = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad.3.0")
objXBulkLoad.ConnectionString = "provider=SQLOLEDB.1;data
source=usmeadmterptdev;... more >>
"On Error Resume Next" in SQL Server
Posted by Andy Wakeling at 2/4/2005 8:06:06 AM
I am executing a stored procedure that uses a cursor to do
a CONTAINS search for each record and to produce a result
set from that for output. The trouble is that if a good
old "ignored words" error occurs for one of the records
the procedure stops running. I need this to carry on
running ... more >>
Alias a linked server
Posted by Jeremy Chapman at 2/4/2005 8:05:29 AM
Is there any way to alias a database on a linked server, so that if the
server name ever changed, I could just update the alias so that stored
procedures would not get broken?
for example, I have database1 on server1. On server2 i have a stored proc
that has a statement select * from server1... more >>
Copy current record
Posted by Paul in Harrow at 2/4/2005 7:51:03 AM
Hi There
Tablename "tblAppDetails"
Which includes the following fields
AppDate smalldatetime, Apptime varchar 10 (both make the PK), AppName
varchar 100, AppAddress1 varchar 100
What I'd like are 2 SP's, the first to select the all the fields (other than
AppDate & AppTime) for the current... more >>
Permission
Posted by Ed at 2/4/2005 7:19:05 AM
Hi,
If I grant a user with the permission of db_datareader in EM, do I also
need to click on the Permission Button and check on every table/view in order
for her to view them or the db_datareader means a user can view all
table/view by default?
Thanks
Ed... more >>
OPENQUERY question
Posted by Raul at 2/4/2005 6:49:11 AM
I'd like to use a linked server to a Setcim database to retrieve results from
a procedure in the Setcim database.
The syntax used to call the view in Setcim is:
start record 'BSW1View'
which works when using the SQLplus tools for Setcim.
I was assuming I could OPENQUERY to call this rec... more >>
Extremely Slow Trigger Problem
Posted by Arghknork at 2/4/2005 6:29:03 AM
I have an after update trigger that is killing me and I can't figure out why.
When I run an update query that fires the trigger and look at the execution
plan, 85% of the cost is in the OPEN __0005 statement. I'm only updating 1
row, so this makes no sense to me. The I/O cost of opening the... more >>
Stored Procedure Question: How do I return 3 Output values calculated using SUM()
Posted by Russell Mangel at 2/4/2005 4:06:51 AM
I need to fix the following stored procedure to return 3 Outputs.(3 of =
these Outputs, are caclulated with SUM(), and another non-calculated =
called FileNM). I don't know how to get the 3 Sum() values into the =
three output variables, @SumOfQuantity, @OnHand, @OnOrder.
Is this possible?
... more >>
vb & Stored procedure prob
Posted by Peter Newman at 2/4/2005 3:35:07 AM
Apoligiues if this is posted on the incorrect board
Im trying to execute a stored proc from a vb application and am getting a
weird result. I can excute the sp from query analzer with ut any probs.
part of the sp
CREATE PROCEDURE BacsLimitTest
@Licence VARCHAR(6),
@AccCode VARCHAR(... more >>
Temp db permissions
Posted by Ruz at 2/4/2005 2:29:03 AM
I have an application which requires permissions to the temp db to handle
state and hold parameters. I have set up a SQL server login for the
application that has permissions to all the required db's and everything
works fine. The problem occurs when SQL server terminates and restarts. This
... more >>
Undocumented procedure help
Posted by Robert Richards via SQLMonster.com at 2/4/2005 1:06:11 AM
I am attempting to run the following command:
exec sp_MSforeachdb ?..sp_helpfile
I get the following error message:
[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
Any idea how to get it to execute?
If I run it like this:
exec sp_MSforeachdb sp_helpfile
It ret... more >>
The preceding restore operation did not specify WITH NORECOVERY
Posted by sql fren at 2/4/2005 12:25:07 AM
Hi
I m doing a test restore but got another error as below.
What is the correct sequence to restore at the point of failure?
Means I can't afford to lose any data.
Is it something wrong with my restore sequence?
I use the backup script below:
-- Back up the currently active transactio... more >>
|