all groups > sql server programming > december 2005
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 31
Appending Text to a SQL Text Data Type
Posted by bobnunny at 12/31/2005 8:19:59 PM
I am trying to use a cursor to create a mass Text field with the results from
the selections from a series of VarChar(8000) values. I know I need to use
UpdateText, but it only seems to store the 1st one it reads. Can anyone help?
Here's my text:
Declare @TriggerText nVarChar(4000)
Declare ... more >>
SELECT INTO PROBLEM
Posted by Savas Ates at 12/31/2005 4:08:46 PM
I have two tables.. They are both identical..
I want to select some fields from one and insert to another one.
How can i do it ?
SELECT urunadi INTO [AlisverissaatiXML].[dbo].[urunler] FROM
[Kangurum].[dbo].[urunler] WHERE urunadi='ROMANSON PHIL MEETY'
It returns
The object name 'A... more >>
Cursor is the only choice?
Posted by Frank Lee at 12/31/2005 2:38:45 PM
If I want to do a process in a sequence order, is Cursor my only choice?
for example,
------------------------------------------------------------
declare @ID uniqueidentifier
declare MyCursor cursor local for
select id
from table
where created>thedate
order by created
for read only... more >>
insert a un-ordered data to a clustered indexed column, what would happen?
Posted by Frank Lee at 12/31/2005 2:13:11 PM
Q1, If a column is clustered indexed and there are more than 500000000
records in the table. Now, if I insert a data which should be inserted to
about the 10th location according to the clustered index, what would happen?
Will system stupidly move all other data after the 10th location to nex... more >>
The case of the inadequate case function
Posted by Daniel Manes at 12/31/2005 2:05:18 PM
In most programming languages, there is a way to branch your code in
multiple directions depending on the value of some switch variable.
My situation right now is that I have a variable, @PostType, that
determines which stored procedure should be called. I tried to use the
CASE statement, but ... more >>
SELECT Min Date
Posted by Scott at 12/31/2005 12:09:18 PM
My below code selects the last 10 days of data from Northwind, how can I set
that variable to the min date or dtStartDate variable?
To be clear, my results below are fine, however, I need a SET dtStartDate =
"The min date that below CODE is using as it's start date where criteria."
CODE 1:... more >>
How to fetch AutoANSIToOEM, RegisteredOrganzation, etc. in SQLServer?
Posted by Mark Findlay at 12/31/2005 11:23:52 AM
I have both default instances and named instances of SQLServer.
My reporting program is able to read the AutoANSIToOEM,
RegisteredOrganization and UseIntlSettings properties from the registry
under the HKLM\SOFTWARE\MICROSOFT\MSSQLSERVER\Client\DB-Lib key - but only
for the DEFAULT instance... more >>
T-SQL 258 XML Iteration Boundary?
Posted by LvBohemian at 12/31/2005 9:47:01 AM
T-SQL 258 XML Iteration Boundary?
Here is the scenario…
I have to get a set of particular records for a particular time frame in a
MSSQL 2000 table, then I have to pass them one at a time to a web service
that returns additional information as xml for each applicable record from a
legacy... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
MD5 Hashing rows?
Posted by Edgars Klepers at 12/31/2005 1:06:01 AM
I'm trying to implement some sort of security checking against database
modification. I'm thinking to store a list with Hash values for row sets.
i.e.
[pseudocode]
byte[] returnHash = MD5Hash( SELECT stuff FROM database WHERE junk )
[/pseudocode]
Is there a way to do an MD5 hash or ... more >>
SID to dotnet SecurityIdentifier
Posted by Edgars Klepers at 12/31/2005 1:00:02 AM
From my research, SID's are supposed to be stored in an SQL database as a
varbinary(85).
What is the best way to translate the SID to the dotnet 2.0
SecurityIdentifier type?
I am working in C# but can probably translate VB code over as well if that
way is easier to explain.
Thanks ... more >>
Field value determines whether there is extra info that should be held about that record
Posted by Amir at 12/30/2005 7:14:22 PM
Hi,
I would like to have your advice in a little DB design issue. I'll try to
demonstrate it by an example:
Guess I have DB to hold information about rooms that are in a house. Each
record represent a room, and has many fields like: width, height, wall color
etc. One of the fields in the... more >>
five connection limit
Posted by Igor Solodovnikov at 12/30/2005 6:10:11 PM
Hi!
Everybody know that MSDE (based on SQL Server 2000) has five-connection
limit after which its performance degrades. Do SQL server 2005 Express
edition also has five-connection limit? Or this limit was dropped?... more >>
Union duplicates
Posted by tshad at 12/30/2005 6:08:51 PM
If I have 2 tables (actually it would be the product of multiple joins) and
I am getting the same data out of both tables and unioning them, how would I
say if a person was in both tables I only wnat the data out of table x.
For example
Select Name,address,salary from candidate
union
Sel... more >>
Storing Richtextbox data In Sql
Posted by den 2005 at 12/30/2005 3:31:01 PM
Hi everybody,
What is the datatype in sql for storing data from RichTextbox? How do I
create a sql Insert statement for this data? The data has format like
indentation, Butted list, Font Style and others.
Thanks.
Dennis
--
MCP Year 2005, Philippines... more >>
need to know the detail about cursor.
Posted by Skywalker at 12/30/2005 2:51:10 PM
Hi,
I have a Table1( C1,C2,C3)
DECLARE T1_cursor CURSOR FOR
SELECT C1,C2 FROM Table1 WHERE C3=1
Tabel1 has multi-millines records. Say if the snap-shot of the T1_cursor has
10000 records when the cursor start running (Fetch), I add more records to
Table1 which has C3=1 while the T1_cur... more >>
Stored Procedure Output Parameter Woes
Posted by Denis at 12/30/2005 2:19:02 PM
I have written a stored procedure with several output parameters.
eg
@Vendor bit OUTPUT
When I execute this stored procedure via query analyzer it thinks I have
declared this as input/output. Is this a feature or is there something
fundamental I have missed?
I am attempting to call thi... more >>
CAN'T SOLVE SELECT GROUPING WITH MAX FUNCTION
Posted by rlueneberg NO[at]SPAM gmail.com at 12/30/2005 2:10:14 PM
Here is the scenario
ACCOUNT CONTACT DATE
account A CILXFA000HJ6 4/6/2005 16:05
account A C15467XXXXXX 7/27/2005 12:22
account B C20002XXXXXX 2/15/2005 18:25
account B C12225XXXXXX 12/14/2005 20:10
The RESULT should be this;
account A C15467XXXXXX 7/27/2005 12:22
accou... more >>
Design Question - SQL 2000 to 2005 App Upgrade (CLR?)
Posted by Craig S at 12/30/2005 1:32:20 PM
I'm upgrading an app I wrote from SQL 2000 to 2005 looking for some
high-level design advice, just to determine how much should be T-SQL vs.
CLR, and the best approach to take for performance. For background, I'm a
strong c# developer, but with only average SQL skills and I'm just getting
i... more >>
How to get the Column Name of primary key of a table?
Posted by Frank Lee at 12/30/2005 1:17:58 PM
How to get the Column Name of primary key of a table?
Thanks.
--Using SQL 2005 dev
... more >>
T-SQL does not support breakpoint Conditions
Posted by LvBohemian at 12/30/2005 1:00:03 PM
When attempting to select the breakpoint condition from within the VS05 RTM
IDE I get the following error message:
"T-SQL does not support breakpoint Conditions"
What's up with that?
Also, why the heck would you not be able to debug TSQL from "SQL Server
Management Studio" ?
This... more >>
SQL Server locking
Posted by Abhay Sobti at 12/30/2005 12:48:07 PM
Hi friends,
I have an issue here.
1. Two users are adding Slips [vouchers] from two different terminals.
2. The Slip numbering scheme goes as follows : TR/00001 , TR/00002.... and
so on.
3. When these two users click on the SAVE button simultaneously , the
application tries to
fetch t... more >>
Scripting of database objects in SQL 2005
Posted by Edward at 12/30/2005 12:28:03 PM
I've written scripts to generate the tables, functions, indexes, keys, views
and stored procedures but I can't find any information for triggers. The
sys.triggers table contains no entries even though I've created a trigger.
When I script from the SQL Management Studio it works fine. I moni... more >>
Case in Join
Posted by tshad at 12/30/2005 12:10:40 PM
Can you put a Case statement in a Join?
My problem is that I have 2 possible fields I want to join to the same
table. If one is null, use the other.
For example:
Create Table Position
(
UserID1 int,
UserID2 int
)
Create Table Logon
(
UserID int,
UserName
)
I ... more >>
Using input parameters differently for different values
Posted by Mark Rae at 12/30/2005 12:09:54 PM
Hi,
I have the following table in SQL Server 2000 which contains accounting
ledger data:
ACCNT_CODE varchar(10)
ACCNT_NAME varchar(50)
ACCNT_TYPE char(1)
TRANS_DATE smalldatetime
PERIOD int
D_C char(1)
AMOUNT numeric
The PERIOD field indicates which accounting period the record belo... more >>
how to install multiple instances of Reporting Services?
Posted by === Steve L === at 12/30/2005 11:39:19 AM
background: sql 2000 with reporting services 2000.
from reading the MSDN, looks like one can install multiple instances of
reporting services 2000 on the same machine (for qa testing and
production and so on), but when I started the reporting services 2000
installation process, it didn't offer... more >>
Picture insert
Posted by vul at 12/30/2005 11:34:46 AM
Access allows to insert manually an image into OLE Object type field very
easy. I was wondering if there is a simple way to insert an image into image
type field in SQL Server using Enterprise Manager (not programmatically)
Thank you
Al
... more >>
Log File Error
Posted by Ricky at 12/30/2005 9:50:03 AM
Good Morning
We have a nightly DTS job, which uploads data, to a number of tables (35
tables). However the DTS job failed last night, due to the following error
returned :
****
Error Source: Microsoft OLE DB Provider for SQL Server
Error Description:The log file for database 'G_Data' is f... more >>
Profiler event class question
Posted by SSM at 12/30/2005 6:52:02 AM
When capturing tuning data in SQL Profiler, what are the key differences
between event classes 10 (RPC Completed), 12 (TSQL Batch Completed), and 45
(SQL Stmt Completed)?... more >>
getting per case info from 1:n related case and log table fast
Posted by zu at 12/30/2005 6:48:02 AM
I neeed to search through the CASE table and get all records with case
created between two dates. A lot of info is in related tables and the case
table only has the id. So there are quiet some Joins, but that's not the big
problem.
What made my SQL unusable is the fact, that I needed also to ... more >>
sql statement formatting
Posted by bringmewater NO[at]SPAM gmail.com at 12/30/2005 5:17:28 AM
What is a good way to format this nested sql statment? Are there any
good sites showing other examples? Thanks !
SELECTMerchandise.Description, Users.Name FROMUsers INNER JOIN (Sales
INNER JOIN (Merchandise INNER JOIN Types ON Merchandise.TypeID =
Types.TypeID) ON Sales.MercID = Merch andise... more >>
Mapping from flatfile to SQL server database...
Posted by Christian Johansen at 12/30/2005 2:22:02 AM
Hi!
Im trying to find existing software to map from flatfiles (mostly .txt) to a
database running on MS SQL Server. The files are recieved by mail, and made
available to my program, and are supposed to be read and processed in a way
that extracts the data from the files and inserts it into th... more >>
AntiVirus Software
Posted by Lan at 12/30/2005 1:57:02 AM
We have McAfee VirusScan installed on our database server. I would like to
configure the system not to scan *.bak, *.mdf, *.ldf. My question:
1. Is this the right configuration ?
2. By doing so, any potential security breach ?
3. By doing so, will the SQL box performance improve a bit?
Furt... more >>
handling parameters that could be missing
Posted by jonefer at 12/30/2005 12:13:03 AM
I have a search app that I'm developing in ASP.NET
It has 5 parameters
MRN, Name, Sex, DOB, SSN
All or any combination can be used.
what is the best way to handle the non-supplied parameters?
i.e. if the user selects only supplies 'Name' and 'MRN'
I want the SQL for the stored procedure ... more >>
Query
Posted by Manoj at 12/29/2005 10:26:02 PM
Dear All
I have a query is:-
select
A.AllocatorId,a.CustomTypeId,a.CustomId,a.ScopeTypeId,a.ScopeId,a.ActivityTypeId,a.PriorityId
from allocation a
Out put is
AllocatorId CustomTypeId CustomId ScopeTypeId ScopeId ActivityTypeId
PriorityId
----------- ------------ -----------... more >>
Trouble using sql IN statement with list of datetimes
Posted by JavaJeff NO[at]SPAM gmail.com at 12/29/2005 7:25:48 PM
I would like to pass in a list of dateTime stamps in a nVarChar
parameter like so:
--Example input data:
'2005-12-21 15:55:26.053, 2005-12-21 15:41:35.600, 2005-12-21
15:23:21.647, 2005-12-20 19:15:27.180'
declare @RequestCreationTimeList nvarchar(500)
Select dbo.MyTable.RequestCreationT... more >>
Use of NULL and DEFAULT
Posted by Gerard Marshall Vignes at 12/29/2005 6:16:02 PM
I have a rule of thumb which I would like to get opinions about.
RULE: Provide Data or Go Meta
SCOPE: Designing SQL Tables, UDFs and Stored Procedures
MEANING:
A good database design will restrict the occurrence of NULL. An
overabundance of NULLs in a database suggests, among other thi... more >>
SCHEMA - primary key - SQL problem
Posted by Jeff User at 12/29/2005 6:03:37 PM
Hi
I posted this in another group and got no reply.
Hope someone here can help. Perhaps this is more of a SQL programming
issue than a schema or PK issue, as the actual problem is duplicate
records:
I have reviewed previous posts about finding primary key, table schema
information, etc...
... more >>
Need to Execute SQL Script after SysPrep or after first boot
Posted by Scott Townsend at 12/29/2005 4:51:27 PM
I'm ghosting a few classroom machines that have a SQL server on them. We
are using one base image and pushing it out to 12 machines.
I'm looking for an automated way to execute the sp_dropserver and
sp_addserver Stored Procedures.
So I'd like to be able to execute the following:
sp_drop... more >>
Limitation of sql standard
Posted by Roy Goldhammer at 12/29/2005 3:12:36 PM
Hello there
In one of my clients who have SQL Standard has past the 2Gb data file.
In this office there are approxsimatly 80 users
Since then a lot of problems have happened in the database:
1. tables are locked more often and we need to reset the sql server at least
once a week (Very bad)... more >>
compare '002' and '00²'
Posted by Gene Vangampelaere at 12/29/2005 2:39:51 PM
does anyone knows why '002' = '00²' in sqlserver 2000 ?
create table Test2 (veldnaam varchar(10),veldnaam2 varchar(10))
go
insert into test2 values ('002','00²')
go
select * from Test2 where veldnaam=veldnaam2
I did not expect to find a record !
Gene
... more >>
Evaluation of conditions
Posted by Lalit Bhatia at 12/29/2005 2:04:53 PM
I have a Join condition like
Select columns
From Table1 T1
Inner JOIN Table2 T2
ON T1.col1 = T2.col1 Or T2.Col1 Between T1.Col1 and T1.Col2
In table1, I have two cols that store some string range values. Col1 can
have inidividual entries and col1 and col2 may have range values.
... more >>
Developing CLR Objects - Visual Studio Requirements?
Posted by Craig S at 12/29/2005 1:14:20 PM
I have SQL 2005 Express & Visual Studio 2005 Standard on my XP workstation,
and SQL 2005 Standard installed on my Win2k3 server. I can't find anywhere
on either system's VS installation the option to create a new Sql
Project/Solution to create CLR objects. Am I missing something, or do I
n... more >>
Row based security
Posted by Leila at 12/29/2005 1:07:14 PM
Hi,
Are there any new feature for restricting users access to particular rows in
SQL Server 2005?
Thanks in advance,
Leila
... more >>
Using Case Conditions in WHERE clause
Posted by HP at 12/29/2005 1:06:02 PM
Can i use case conditions in where clause? does it affect the performance?
eg.
select fldnames from table
where type =
case when @ctype = '1' then 'quote'
else 'order'
end
Thanks
... more >>
SQL Server 2000 and SQL Server 2005 - Installation issues
Posted by Raja at 12/29/2005 12:47:49 PM
How to configure SQL Server 2000 as default instance, while having installed
SQL Server 2005 beta, on the same server?
As, VS Team suite needs SQL Server 2005 as a default instance. But, my
application needs SQL Server 2000 as a default instance. If not possible,
how we can have bot... more >>
Deadlocks
Posted by Yaniv at 12/29/2005 12:43:49 PM
Hi,
I have recently directed a query that used to run on my main server to
another server that is a Pull Subscriber to a Transactional Replication from
the main server.
I now face deadlocks from time to time when the query is being run. The
deadlocked process is the proccess executing th... more >>
SQL Server :
Posted by Sirisha at 12/29/2005 12:31:02 PM
Hi,
I have created a table valued user defined function
CREATE FUNCTION Testting (@labrunid int)
RETURNS TABLE
AS
RETURN
(
SELECT *
From labruns
where labrunid = @labrunid
)
Now in the Query Analyzer when i try this
select labrunid from... more >>
Help with xp..sendmail needed!
Posted by Damon at 12/29/2005 12:11:42 PM
Hi,
I keep getting the following error in my SP which I can't seem to resolve:-
Server: Msg 18031, Level 16, State 1, Line 0
xp_sendmail: Could not resolve recipient
If anyone has any ideas why this is happening it would be greatly
appreciated. My SP is below for reference.
DECLARE @... more >>
Select Calculations
Posted by Vishal at 12/29/2005 11:57:45 AM
Hi,
I have a problem here, please help me I am sure it can be done but just
can't figure out how.
The table structure is something like this :
ID Store_id Year Month Sales
1642 2 2004 1 1000
1792 2 ... more >>
Question about the best way to relate some tables.
Posted by Star at 12/29/2005 11:55:43 AM
Hi,
I am creating a database that contains persons, vehicles, addresses and
some other information.
A person may have several addresses. The same with vehicles. That's why
I'm going to put all the information in different tables. I don't store
the address and vehicle information inside th... more >>
|