all groups > sql server programming > june 2006 > threads for friday june 30
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
Writeable views
Posted by Just D at 6/30/2006 8:29:06 PM
All,
I know that in some conditions the views can be writeable. Did anybody see
or maybe know the links where we can find this information in detail? I mean
if we have many tables in our views using INNER JOIN and we need to insert
some new data what are limitation for the writeable views? ... more >>
[ database_name . [ schema_name ] . | schema_name . ] table_name
Posted by RBC at 6/30/2006 7:54:37 PM
Hi,
I try to create 2 schema as the syntax display's as below, but I get a error
of only use 1. Do I have to change any parameters in SQL 2005?
And will I get any other problems in the future to use 2 schema?
Syntax
CREATE TABLE
[ database_name . [ schema_name ] . | schema_name . ... more >>
Progress Versus SQL Server
Posted by pkohn NO[at]SPAM charter.net at 6/30/2006 7:20:32 PM
Progress is a piece of crap! Sure it runs on Unix. But the time
invested in learning and working with it obscene! With SQL Server I
could easily plan a maintenance backup plan and transaction backup plan
- Progress - well you have to learn about AI files, sizing the BI and
AI files as well as... more >>
select based on containing only certain characters
Posted by JR at 6/30/2006 2:46:35 PM
I need to select rows in a table where a particular column contains
only the following characters and not in any particular order. "AZ{<"
So "A", "Z", "{", and "<" without the quotes. If that's all there is
in the data for a column, select it.
Example:
Positive hit if data in column was: ... more >>
Guardar y recuperar texto con formato
Posted by Raul Romero at 6/30/2006 2:25:19 PM
Buenas tardes ...
Por favor alguien si me pudiera indicar como puedo hacer para guardar texto
con formato (Negrillas, subrayado, cursiva, espacios, etc.) en una tabla de
una BD SQL y despues poder recuperar este mismo texto con el mismo formato
con el que lo guarde.
Muchas gracias por cualq... more >>
Help with select statement
Posted by rhaazy at 6/30/2006 1:15:11 PM
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FK_tblScan_tblAsset]') and OBJECTPROPERTY(id,
N'IsForeignKey') = 1)
ALTER TABLE [dbo].[tblScan] DROP CONSTRAINT FK_tblScan_tblAsset
GO
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[tblAsset]') and O... more >>
TimeStamp as a String/VarChar
Posted by sloan at 6/30/2006 1:07:34 PM
I am passing xml into a stored procedure.
So I can handle 1 or more database updates in a single call. (I already
know the pros and cons of this).
...
Well, I'm trying to work in some concurrency checking with the TimeStamp
method.
( the table has a definition for a timestamp, lets ... more >>
Counting Consecutive days in SQL
Posted by VibroluxOn10 NO[at]SPAM gmail.com at 6/30/2006 12:36:11 PM
I've been trying to figure out how to count the number of consecutive
days of entries in a table. the table stores data on number of minutes
exercised in a day for users of an exercise program:
ExerciseId int
UserId int
Minutes int
ExerciseDate datetime
I need to produce a list of users w... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
More Efficient SQL Statement - Select Count(1)
Posted by Joe K. at 6/30/2006 11:55:12 AM
I know that you can write select statement (Select Count(1)) within Oracle
if finds one record it will stop the search critieria.
Please help me modify the SQL statement listed below to use the equivalent
if it finds one records it stops and output is 1 if not the output is 0.
Thank Yo... more >>
How to count existing items??
Posted by JLuv at 6/30/2006 11:38:12 AM
I want to check and see if an item exists within one of my tables
before I go and replicate. let's say that "John Doe" already exists in
a names database and the user tries to add him again, i want to notify
the user that this name already exists. also, i want to do this
programatically(sp?) in ... more >>
SQLCMD question
Posted by A McGuire at 6/30/2006 11:31:50 AM
Hello,
I'm trying to loop through a cursor, which is essentially querying the =
server names of the SQL Servers I manage. I pretty much understand this =
won't work, but many of you will understand what I'm attempting to do. =
Is there another way to approach this that will work? This will =
... more >>
Backup using TSQL Question
Posted by Mark Moss at 6/30/2006 11:20:17 AM
Ladies / Gentlemen
When I issue the command to 'BACKUP' my Database it does so
with no problem.
However it appends to the last backup. How do I make it
overwrite it.
I am using the following code
if not exists (select *
... more >>
migrate sql2k dts packages to sql2k5
Posted by === Steve L === at 6/30/2006 11:16:07 AM
new to sql2k5.
i have some sql2k dts packages i migrated to sql2k5 using wizard and
they showed up under intergration services, stored packages, msdb, but
I can't open or edit any of the package.
For the same packages, if I saved them as external file in sql2k, then
import them in sql2k5, t... more >>
SQL question
Posted by Jack at 6/30/2006 11:15:49 AM
Hello,
I have no idea what to do with this. I appreciate your consideration.
CREATE TABLE [dbo].[DisplayValues] (
[u_key] [int],
[GroupNumber] [int] NULL ,
[u_desc] [nvarchar] (50) ,
[u_parentkey] [int] NULL ,
[u_childkey] [int] NULL
) ON [PRIMARY]
GO
insert into DisplayValues valu... more >>
SQL 2005 Role Permissions
Posted by Sherri at 6/30/2006 10:51:43 AM
How can permissions be set across schemas?
I have tables in one schema and views from those tables in another
schema.
Is this possible? If so can you point me to any articles describing
how this can be done?
The issue, I do not want users having access to tables only the views
which res... more >>
Help with this SQL script.
Posted by sa at 6/30/2006 10:42:02 AM
I have code below to analyze existing network username to potential new
user's usernames. If no match then user gets first initial and lastname if
there is a match (conflict) then if the person have middle name then first
initial, first character of middle and last name else gets first two
... more >>
Passing a parameter as list in a Stored procedure
Posted by MittyKom at 6/30/2006 10:25:01 AM
Hi All
How can i create a stored procedure which can pass a parameter as a list.
Below is sample sp:
create procedure spxx (@@param1 varchar(100))
as
select * from tb1 where col1 = @@param1
When executing i like would like to be able to do this:
1. exec spxx 'John'
0r
2. exec spxx '... more >>
sql merge
Posted by brianfakemail NO[at]SPAM yahoo.com at 6/30/2006 9:03:20 AM
Hi all, I googled, but didn't find answer to my problem.
Is it possible to execute a single (complex) SQL query and get a merged
result as explained below?
1) a query gives me back as result let's say 3 lines - these are my
clients
2) another query gives me back a list of goods for all of a... more >>
Declare in a view
Posted by ITDUDE27 at 6/30/2006 8:43:02 AM
hello,
I have a quick question, can you declare a varchar within a view?
the code at the bottom generate error: Incorrect syntax near the keyword
'declare'.
CODE:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*---------------------------------------------------------------... more >>
Update a field after a user logs in
Posted by jmawebco at 6/30/2006 7:49:21 AM
I have a .NET application (2.0) and would like to do the following;
A user logs into the system and when his/her identity is validated a
field is updated to mart the individual as online. I want to do this by
use of a trigger so that when the user validation passes the record for
that individu... more >>
Concat key Query Question
Posted by Ed at 6/30/2006 7:41:02 AM
I have 2 tables with the fields: FiscalYear, Account, Region, Program
I want to treat these values as if they are a concatenated key. I want to
compare
2 tables to see if the one table has any concatenated key in that table that
does not
exist in the other. I need to do this without modi... more >>
How to sort
Posted by Faye at 6/30/2006 7:11:18 AM
Here is my select statement. I would like to sort the result so that
they will list by the freqency of the available data for each column.
SELECT ABA_NR , SUM(CASE YEAR(SURV_YY_DT) WHEN 2006 THEN 1 ELSE 0 END)
AS c2006,
SUM(CASE YEAR(SURV_YY_DT) WHEN 2005 THEN 1 ELSE 0 END) AS c2005,
SUM(CA... more >>
Function results
Posted by sparty1022 at 6/30/2006 7:06:01 AM
I am trying to convert a string value, from a parameter field, into a date to
insert into a SQL2005 db smalldatetime field. The function returns a bit
value, which I test by using the isdate function, and if true convert this to
a smalldatetime value, else I set to null.
I get error that "S... more >>
Incorrect information from a "View"
Posted by mtt_trcy NO[at]SPAM yahoo.com at 6/30/2006 5:04:31 AM
I am created a "view" like the one below
CREATE VIEW Tenant_Yearly AS
SELECT tn_proj as Company,
LTRIM(prj_name) as Company_Name,
tn_id as Tenant_ID,
ISNULL(monthly_rent.trm_amount,0) as Monthly_Rent_Amt,
ISNULL(monthly_other.tro_amount,0) as Monthly_Other_Amt,
ISNULL(monthly_rent.trm... more >>
Interesting interview question...........
Posted by Jaison Jose at 6/30/2006 4:19:02 AM
Hi all,
One small question.
I am having a table named maverick and having 2 fields, tkno(int) and
name(varchar(20)).
The table is filled with 10 entries.
tkno name
1 Zamsheer
2 ... more >>
SQL 2005 DML Triggers Auditing
Posted by Maxus at 6/30/2006 3:31:15 AM
Hi People,
I was wondering how I could create a generic audit trail trigger for
the tables in my database using SQL DML commands idealy. what I would
like to do is: what changed, when it changed and who changed it. I have
read the following articles:
These two are more for database changes ... more >>
Update of field if parameter is not null
Posted by Scott A. Keen at 6/30/2006 2:30:57 AM
Hi, I need a little help writing the code to conditionally update field(s)
if the parameter value passed in is not null.
Here's my first stab at doing this, but it's very lengthy. I have to write
the snippet of code for every parameter I pass in and I've go over 50+
parameters of differenty ty... more >>
calculated columns in a table
Posted by samuelberthelot NO[at]SPAM googlemail.com at 6/30/2006 2:19:25 AM
Hi,
I have a table with fields FirstName and LastName. I also have a column
FullName. Each time the table is updated, I'd like the field FullName
to be calculated automatically based on the values of FirstName and
LastName (FullName = FirstName + ' ' + LastName).
What Default value should I ent... more >>
Tring to replace a Line Break with a <br>
Posted by Marco Napoli at 6/30/2006 1:44:34 AM
I am trying to replace in a SELECT statement a field's value that has Line
Breaks and replace each Line Break with a <br>
I cannot fined what the value should be to represend a Line Break, I tried
CRLF but it does not recognize it. I know in VB its vbcrlf.
SELECT REPLACE(MyField, CRLF, '... more >>
Deleting records from two tables
Posted by Peter Newman at 6/30/2006 1:04:01 AM
im having a very blond day .. carnt get my head round this today
Im rining SQl2005
i have two tables ( A & B ) A contains the 'master' record abd B contains
the 'detail' For every record in A there will be a minimum of 1 record in B
to a max of 1000000
Table A is linked with table B ... more >>
Code 128 from SQL
Posted by checcouno at 6/30/2006 12:59:01 AM
I need a function or a SP tha codes mystring into CODE128 for barcode.
Some link?
thanks... more >>
selecting on a null col.
Posted by Aussie Rules at 6/30/2006 12:42:54 AM
Hi,
I have a date type column and want to be able to select from the table with
a where clause on the date column.
I want to be able to select where the date is say less than now (getdate),
and include records where the date is null.
I added the 'or' clause below, however it seems to br... more >>
Considering blank spaces
Posted by checcouno at 6/30/2006 12:26:01 AM
I need to make a function for coding string in which i make difference
between strings that are identical except from final blank spaces. In SQL 200
exists an option (collate set or something else) that can make SQL
distinguish betwene two string like these:
'MYSTRING1'
'MTSTRING1 '
... more >>
String or binary data will be truncated. How?
Posted by Waldy at 6/30/2006 12:00:00 AM
Hi there,
I am having trouble with a stored procedure that is reporting
a data truncation error when I insert into table. How can there be data
truncation when I am using the same local variable types in the insert
statement as are in the table structure?
... more >>
Do not Display "NULL" in Results tab
Posted by Mark at 6/30/2006 12:00:00 AM
Is there a setting in Management Studio to NOT display "NULL" in the
Results tab for either Grid or Text view? I didn't see anything under
Options. I'm currently having to do search and replace to remove it
before passing on to users or using for imports to other apps. Third
party import program... more >>
Cursor type changed?
Posted by TonyH at 6/30/2006 12:00:00 AM
Hi,
I just posted this on sqlserver.connect since I'm not sure where it belongs.
So here goes.
We've recently began migrating to SQL 2005 from SQL 7 and have had a few
issues.
Right now we have an issue when trying to logon to the server through our
application.
'sa' login works from... more >>
When sql express management studio final version will be released ?
Posted by Luqman at 6/30/2006 12:00:00 AM
When sql express management studio final version will be released ?
Best Regards,
Luqman
... more >>
Can't create fulltextcatalogs
Posted by Lasse Edsvik at 6/30/2006 12:00:00 AM
Hello
I have a strange problem. I'm trying to create some fulltext catalogs using
management studio 2005, and it works great. But on one table I have a
composite key (?) PRIMARY KEY(A,B), and when I rightclick table and pick
create new fulltext catalog and press next it says that no indexes ar... more >>
Currency conversion
Posted by Ivan Debono at 6/30/2006 12:00:00 AM
Hi all,
I have an application based in Germany where the currency is the following
format: #.###,00
Users enter values in the above format but SQL Server requires the standard
format: #,###.00
Is there a way that I can tell SQL Server to convert formats automatically
or should I do the c... more >>
|