all groups > sql server programming > november 2003 > threads for friday november 21
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
How to get the result of dynamic statement into a variable?
Posted by Vadim Rapp at 11/21/2003 11:18:30 PM
Is there a way to get the result of a dynamic statement into a variable?
For instance, the idea is like this:
Declare @DBName varchar(50), @Name varchar(50), @OurId int
-- get @ourid and @dbname from some processing; then
select @Name=name from @dbname.dbo.sysobjects where id = @ourid
... more >>
Reporting Services questions
Posted by D Tomyn at 11/21/2003 10:01:14 PM
I am looking for a place to post Reporting Services beta questions to. I
received the copy of Reporting Services via the PDC and now have a couple of
questions regarding it... the main one being how do I pass in a DataSet and
can one create an RDL based off of an XSD (like Crystal Reports.NET).
... more >>
Tranfering Tables from SQL Server
Posted by Sunil at 11/21/2003 9:24:10 PM
I want to transfer some tables in SQL Server 6.5 to MS
Access. Usually we can do it by Importing the tables in MS
Access, but i want to write a code in Visual Basic, so
that any novice user can also transfer the tables easily.
... more >>
needing to export data from temp table to excel
Posted by Dianna Braden at 11/21/2003 3:42:52 PM
Is there a sql command which I can export data in a temp table in SQL to an
excel spreadsheet without using the gui for dts?
Thanks ahead of time.
Dianna
... more >>
Used space in database file
Posted by Artem Kliatchkine at 11/21/2003 3:29:11 PM
Hi All,
I would like to get an approximate amount of space available in a
database file before it starts to grow.
Using sp_helpfile I can get the size of a file.
But how can I get amount of space used?
DBCC SHRINKFILE returns such an information (UsedPages) but I don't need
to change the... more >>
Proc Issue
Posted by Russ Evans at 11/21/2003 3:16:09 PM
We're trying to resolve an issue in this scenario: Stored
Proc in one SQL Server 2000 database executes a simple
SQL statement against a view in another SQL database
through an LSN. When literal values are used in the where
clause of the originating query the result is correct.
When parame... more >>
Using crossib table
Posted by Roy Goldhammer at 11/21/2003 3:12:34 PM
Hello there
I have table of rates with breaks
for example: price for LHR is: 45/3.0 100/2.5 300/2.2
the way i hold the data is by using an agreement table relate one to many
for rates table.
i need to show the data in crossib way
Agent | Destination | 45 | 100 | 200
for this i'm usi... more >>
BEFORE Triggers
Posted by Mike Tremendous at 11/21/2003 2:53:44 PM
Hi.
I read that SQL Server 2000 does not support BEFORE triggers. This strikes
me as a huge ommission.
1) Is this true?
2) If so, how do I get around this when migrating a DB from a platform that
does support this feature?
Mike
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Who many parameters can i send to a stored procedure ???
Posted by George at 11/21/2003 2:28:25 PM
Hello to everybody
Does anybody know if there is limitation
on how many parameters a stored procedure can accept?
Thanks a lot
... more >>
Interchangeable table structure
Posted by Nelson at 11/21/2003 2:16:30 PM
Hi,
I have a table with 4 integer columns and 2 floating point
columns. I use a C++ program to write to this table
through ODBC. I write about 15 million records in one
batch. The most efficient way I found to write to this
table is to first truncate the table, drop all indexes,
inse... more >>
Debugger causes A/V
Posted by Morgan at 11/21/2003 2:02:16 PM
SQL Server 2000 Developer Edition - SP3 (build 8.00.760, or is this SP3a?).
Attempting to debug a stored procedure resulted in this error message:
ODBC: Msg 0, Level 19, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]SqlDumpExceptionHandler:
Process 58 generated fatal exception c000000... more >>
Unique Values
Posted by robot smiff at 11/21/2003 2:01:08 PM
How do I get the unique values in a column?... more >>
Slow Query/SubQuery
Posted by Chris White at 11/21/2003 1:44:18 PM
I'm using a 3rd party application that's been tweaked a little to fill a
specific business need.
There are samples that are tested Whole and broken in 5 parts and tested. I
need to group these together by creating field SAMPGROUP.
The only thing tying these together is the Whole record has the ... more >>
SQL-92 compliance. How to check?
Posted by Nikolay Baranov at 11/21/2003 1:37:21 PM
Hello!
How to check SQL-92 compliance for storage procedures T-SQL code?
Some tools, articles, Web links, anything about the issue...
Any ideas will be greatly appreciated
Thanks
Nick
... more >>
login problem
Posted by rainbow at 11/21/2003 1:34:14 PM
hello.
this is login problem.
I intend to log in with mixed mode (SQL and windows mixed mode)
so I added new account on EM.
but I cannot login with this new account(mixed mode)
thanks for this problem.
... more >>
@@ERROR doesn't work
Posted by Libor Forejtnik at 11/21/2003 1:27:03 PM
Hi,
if an error occurs within a stored procedure (due to primary key constraint
violation), the procedure breaks the execution and shows an error message.
The rest of stored proc.which tests a status of @@ERROR (if @@ERROR<> 0) is
not executed. What do I have to do to prevent the code of showi... more >>
Getting the LAST few rows
Posted by David Knapp at 11/21/2003 1:16:48 PM
I don't want the TOP rows, just the last few rows that
were added to a table. This table has over 15 million
records and I am trying to verify the key data, since my
queries are getting no hits whatsoever. The key goes
something like "CompanyName" + "AccntNumDate". When I
query on Compa... more >>
trigger
Posted by walter at 11/21/2003 1:13:21 PM
hello.
I need to trigger that after is executed of to have made
replication.
I explain myself, the person synchronizes with the data
base and update trigger a field of a table despues of to
have made the insertions in that table.
Please an example.
Thanks... more >>
SELCT INTO #TEMP EXEC SP_NAME
Posted by Roji. P. Thomas at 11/21/2003 12:58:17 PM
Is it possible to populate the results of an SP to a temp table
withot prior delcaration as in
SELECT * INTO #TEMP
FROM <TABLE>
--
Roji. P. Thomas
SQL Server Programmer ;)
________________________
... more >>
how i can run update quiry in Low-priority
Posted by Mtcc at 11/21/2003 12:55:06 PM
i need to run update quiry for update sums fields.
i want that this process run on backround in low priority
how i do that on sql server 8
... more >>
trim zeros after decimal
Posted by OvErDrIvE at 11/21/2003 12:41:05 PM
hi,
i have a datatype of numeric(20,5).
after outputing the value into a .txt file, i get a lot of zeros after
the decimal.
can someone pls show me how to get rid of it.
thanks
... more >>
slow update query
Posted by Wayne Barnett at 11/21/2003 12:31:19 PM
I have an application that runs with SQL 2000 & Jet 4.0.
I have an update query that executes at a rate of 200,000
per hour with Jet 4.0, and 10,000 hour with SQL 2000.
I've installed SP3a, but it did not help.
The ADO connection strings are shown below. If anyone has
an idea for what I... more >>
Moving files
Posted by anita at 11/21/2003 12:25:36 PM
Having a problem moving files from one folder to another.
This code is giving me a warning of 'syntex not correct':
EXEC master..xp_cmdshell 'copy
"\\datastore.stuff.com\restricted\ftp\you\test.txt"
"\\datastore.stuff.com\restricted\ftp\you\old_code\test1.t
xt"'
but this code works:
e... more >>
Delete duplicates
Posted by Andy Williams at 11/21/2003 12:16:05 PM
There are many posts by others regarding similar topics, but I'm not sure
that any of them apply to my situation. I apologize in advance if my
question has already been answered recently.
CREATE TABLE Vendors
(
Vendor_ID int,
Vendor_Name varchar(50) NOT NULL
)
INSERT INTO Vendors VALUES... more >>
application role
Posted by Fernando Amaral at 11/21/2003 12:09:03 PM
Can an application active more than one application role and have the
permissions associated with this roles, or the activation of other
application ignore the permissons of the previous application role ?
Tanks
Fernando
... more >>
'Once again ' the Holy joly... @@identity issue
Posted by Fabian Castro at 11/21/2003 12:06:49 PM
Hi you guys. I am sure for many of you this is a 'once
again' issue. I am a new comer on this sql server and have
been reading and testing everything found but haven't
succeseded.
So, Thanks you for your time...
I am using sql server 7.0 and vb 6.0.
I'm triyng to get the @@identity by... more >>
Cross databases
Posted by Cesar at 11/21/2003 11:46:19 AM
I apologize my mistakes. English isn't my natural language
I've been searching about aplications thas uses tables that resides in more than one database
There is a lot of information about how to manage this, when there're applications that have to share information
But, instead, I can't find no ... more >>
what difference do qoutes do when searching char field
Posted by andrius at 11/21/2003 11:33:56 AM
Hey pros,
I wonder if anybody knows and could explain me the
difference between these 2 qryies.
1.
SELECT * FROM table(NOLOCK)
WHERE field1 IN (08348476,08348477)
2.
SELECT * FROM table (NOLOCK)
WHERE (field1 = '08348476') OR (field1 = '08348477')
Field1 is declared as char(11). ... more >>
updating a table
Posted by Gunnar Kleive at 11/21/2003 11:18:29 AM
Hello!
I have a problem that I really could use some help to solve. I have a table
which looks like this:
id1, id2, id3, rate, ratenr
Examples of a select * from this table would be:
1047336399 21000 1 617 1
1047336399 21000 1 624B 1
1047336399 21000 1 ... more >>
Chinese chars through stored procedures...
Posted by Etienne M. St-Georges at 11/21/2003 11:11:12 AM
Hi,
I have a problem with my Stored Procedures...
Recently we decided to change the type of our column in our databse from
varchar to nvarchar because of new customers (chinese).
Everything works fine EXCEPT the stored procedures... When i try to pass
chinese characters for a simple SP that th... more >>
Trigger Templates
Posted by ppparent at 11/21/2003 11:05:28 AM
Hi does anybody know how to create a dynamic trigger
template. I just replaced my trigger template with a
beefier starting point and the dynamic table name that is
normaly shown in the ON clause is now static.
I've been looking everywhere for info on the keywords to
use or something. Any... more >>
Adding Columns
Posted by Luke Ward at 11/21/2003 10:35:46 AM
I need to loop through some records and add columns to a table depending on
what records I find. my problem is I cant seem to add a column using a
variable name.........
Declare @MyField varchar(10)
Set @MyField = 'TestField'
alter table tbltest add MyField int
Any help would be appreci... more >>
OT - Yukon - Useless as is now or is it ???
Posted by Vincent Haakmat at 11/21/2003 10:27:22 AM
So I got back from the PDC03 in LA and popped the Yukon Beta1 CD in to
install. After finishing, 80% of the menus and popup menus don't work... How
can MS call this Beta1. Shoudn't it be still Alpha???? I know when I ship
beta software it is to get rid of the bugs, not just show-ware.
Another th... more >>
sending dynamic html emails...
Posted by s at 11/21/2003 10:22:42 AM
is sql server (2000) the best way to handle this? This
needs to loop through roughtly 500 email addresses in a
table, and send an html email with 2 dynamic data
variables specific to each email. Thanks.
... more >>
design of table schema for internationalized content
Posted by perseus at 11/21/2003 10:14:07 AM
Hi all ,
I want to design a table, e.g.
T_PRODUCT { PRD_ID, NAME, DESC }
where NAME and DESC will have english (EN) and japanese
(JP)
I found that there are two ways I could use to design such
a schema :
1) T_PRODUCT { PRD_ID, NAME_TEXT_ID, DESC_TEXT_ID }
T_TEXT_LANG { FIELD_ID, ... more >>
ERROR 21305 URGENT!!!!
Posted by Chris Calhoun at 11/21/2003 10:04:11 AM
Does anyone know how to resolve this error when attempting to script a =
SQL 2000 database from the enterprise manager.
The schema change information could not be updated at the subscription =
database.
Thanks in Advance................... more >>
identify duplicates
Posted by marwan hefnawy at 11/21/2003 9:53:00 AM
I have a table of many columns (no primary key) one of them is an ID_number
of 13 characters which may conatin duplicates.
I want to make a new column (ID_Duplicate) that identifies the rank of each
record in the duplication in (ID_number)
i.e. the first occurrence of an (ID_number) in the datab... more >>
space delimited in the output file
Posted by culam at 11/21/2003 9:42:11 AM
When I output a file through QA. It gives an extra space
between fields. Can I get rid of the space?
Culam... more >>
xp_cmdShell cannot output file to map drive
Posted by culam at 11/21/2003 8:54:22 AM
Hi,
I am using xp_mcdShell to out a file on the network drive
and it give an error:
Cannot open output file - u:\osqloutput.txt
No such file or directory
NULL
I execute the following script:
declare @cmd varchar(1000)
select @cmd = 'osql -E -dpubs -Q"select * from authors" -
o"u:\osqlout... more >>
Newbie Question
Posted by Newbie! at 11/21/2003 8:15:36 AM
Hi Ppl,
Could someone Help a newbie?
I keep getting:
'Convert' is not a memeber of 'string'
Here is my code:
Public Function IsWeb_AddressNull() As Boolean
Return Me.IsNull(Me.tablePasswords.Web_AddressColumn)
End Function
Public Sub SetWeb_Add... more >>
Data Type Money
Posted by Jim Heavey at 11/21/2003 7:45:13 AM
In a VB.Net client, what datatype do you use in to supply a parameter of
type "Money" or "smallMoney"
Thanks in advance for your assistance!... more >>
Convert
Posted by anonymous at 11/21/2003 6:36:25 AM
I have a field varchar(10) with the following data:
10/31/2003
I need to convert to the following format:20031031? how do
I do this?
... more >>
Modeling problem - 3NF violation?
Posted by ssslither9 NO[at]SPAM yahoo.com at 11/21/2003 6:19:00 AM
I want to model information about a horse - a mare, to be exact. I
need to be able to record whether the animal has given birth, and if
so, to how many offspring. (no details about the individual offspring
are required.) Sometimes, I might know that the animal has given
birth, but not know ho... more >>
Cross join report with nulls
Posted by caos NO[at]SPAM regerar.com at 11/21/2003 6:16:19 AM
I'm trying to create a query that will create data for a report of
different kind of crimes, grouped by city/country/kind of crime.
Assume the following tables
Country
----------
ID
Name
SomeMoreInfo
City
-----
ID
Name
Country (FK)
SomeMoreInfo
Crime
-------
ID
Date
City (F... more >>
DBNull or nothing
Posted by Jim Heavey at 11/21/2003 6:10:13 AM
In a VB.Net client, if I want a parm to have null, so I load "nothing" or
dbNull?... more >>
Help with this T-SQL code?
Posted by John Rugo at 11/21/2003 6:05:24 AM
Hi All,
I am having a problem figuring out why the below code works in parts but not
together. I'll explain after the example:
DECLARE @tmpID VarChar(100)
SET @tmpID = '30504229-d3c1-4bad-a89f-a14a304e35f7'
SELECT [dbo].usf_ContactData_FullName_From_ID
(SELECT SiteRoles.CntID AS [SiteCn... more >>
Can table names be used as variables?
Posted by Alex young at 11/21/2003 6:02:25 AM
Hi, I am trying to store table names in a table and then
retrieve them and use them and use them in query so that
I can dynamically change which table is queried. I am
aware this can be done using ADO or similar but I am
hoping to use it in stored procedure or function. Does
anyone know of... more >>
From Access DB to SQL MSDE
Posted by DavideX at 11/21/2003 5:28:29 AM
I changed the archive of a program in VB6 that used
Access 97 Database via DAO USING JET 3.5 passing it to SQL
server (sqloledb1 driver) and using ado 2.7 and with
surprise (The file structure and data is not grown) I find
now the program slower than before using access file?? It
is possi... more >>
Stored Procedure - Date Comparison
Posted by NewToSql at 11/21/2003 4:56:10 AM
Is there an sql procedure to show when a record has been updated? I am updating data and I have a LastUpdate (datetime) Column which I would like to compare with the LastUpdate when it was selected prior to the update. Is the best practice to compare these 2 dates (what was in the table and what i... more >>
Invoking stored procedures
Posted by Jeff at 11/21/2003 4:28:38 AM
Can a stored procedure be invoked via command line?
... more >>
Finding defined column size
Posted by Amit at 11/21/2003 4:21:22 AM
Hi to all SQL Gurus,
Is there any way to find out the size defined for a column
in a table. For example:
Create table Amit( Name varchar(500), Age int, Address
nvarchar(600))
So, what I am looking for is: capturing the size I've
defined at the time of table creation. For this is there ... more >>
Passing data to SQL Server
Posted by Yuri Ch at 11/21/2003 4:04:04 AM
How to pass big set of data from ASP to SQL Server stored procedure (for
example 30 rows and 5 columns - content of html table) ?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
BCP -R
Posted by ravi sankar at 11/21/2003 4:03:28 AM
Hi all,
I m trying to use BCP utility to upload a huge text file.
As per microsoft documentation, -R is used to specify the
regional settings. My computer (client) and the sql server
(running in a network machine) has dd/mm/yyyy as the
regional settings. The incomming text file also has d... more >>
Formatting of rows
Posted by Mayet at 11/21/2003 3:01:49 AM
Hi,
I have a table with the structure:
CategoryID SubCategoryDesc RefundID
---------------------------------------
1 Subcat1 10
1 Subcat2 11
1 Subcat3 12
2 Subcat1 14
2 Subc... more >>
Cursor
Posted by maxheadroom at 11/21/2003 1:26:04 AM
Hello
I wrote the following script to update several columns as well as the string of one specific column
Everything works fine, except that this table only has 6104 rows and the query never ends. Do I have a loop here
Is there a better way to achieve the same result
SET NOCOUNT O
DECLARE @jba... more >>
How to do simple insert on variable table name
Posted by mikeyP at 11/21/2003 12:06:04 AM
I want to take an input variable and insert data into a table of that name, what kind of special logic do I need to make this work? This is the basic (wrong) idea
CREATE PROCEDURE myS
@table_name As VarChar(50)
@name As VarChar(100
A
INSERT @table_name (name
VALUES (@name)... more >>
|