Showing posts with label newbee. Show all posts
Showing posts with label newbee. Show all posts

Monday, February 20, 2012

Newbee...SSIS

Hi guys,

I am a newbee withh SSIS, I used DTS in SQL 2000 way back to migrate data from AS/400 DB2UDB iSeries to SQL 2000. It was easy to use DTS just specify Source and Destination and do some mapping and bingo. But now how do I do the same things with SSIS?

Is there some sort of tutorial out there? Any nice books? Any help is greatly appriciated.

T.I.A.

The simplest way to achieve it is to run the import/export data wizard (right click the Packages node and select Import/Export Data; or run DtsWizard.exe).

It is rather simple to do it without wizard as well - you'll need to create Data Flow task, and inside it create OLEDB Source and Destination, connect them and do the mapping in the destination.|||

I am having trouble using OLEDB providor, is it possible i can use ADO.NET ODBC provider that comes with AS/400 client? If I can how do i do that? I dont see any option of using ODBC provider.

TIA

|||Yes, use the DataReader Source (it should be called ADO.NET source really), it uses ADO.NET providers, including ADO.NET provider for ODBC.

NewBee Trigger Question

I want to create a basic insert trigger. In T1 I add a row, which creates
a
new ID. The trigger fires after the insert, how do I get the new ID to add
to the child table?
I know this is as simple as it gets but I've read about 10 posts and dont'
see it?
Thanks in advance.
Greg P.CREATE TRIGGER YourTriggerName
ON T1
FOR INSERT
AS
DECLARE @.newid int
IF @.@.ROWCOUNT=1
BEGIN
SET @.newid=(Select col1 FROM inserted)
--Do what you want do to with the @.newid here
END
Nathan H. Omukwenyi
"Greg P" <gsp@.newsgroups.nospam> wrote in message
news:872807BA-17FA-47A7-AAE1-AAF397488904@.microsoft.com...
>I want to create a basic insert trigger. In T1 I add a row, which creates
>a
> new ID. The trigger fires after the insert, how do I get the new ID to
> add
> to the child table?
> I know this is as simple as it gets but I've read about 10 posts and dont'
> see it?
> Thanks in advance.
> Greg P.|||try this...
create trigger trig1 on T1 after insert
as
begin
insert into [child table] ([new id])
select [new id] from inserted
end
"Greg P" wrote:

> I want to create a basic insert trigger. In T1 I add a row, which create
s a
> new ID. The trigger fires after the insert, how do I get the new ID to ad
d
> to the child table?
> I know this is as simple as it gets but I've read about 10 posts and dont'
> see it?
> Thanks in advance.
> Greg P.|||I read up on how to use the inserted table and this seems to answer the
question I posted, yet i have a bit of a different use than what was posted.
I need to look up values in two other tables before I can do my insert. I a
m
doing this with cursors. From what I am understanding I can't Declare
anything in a trigger, so to use the cursors I am calling a stored procedure
.
Inside this stored procedure is where I need to access the data in the
inserted table. Should I create a temp table and somehow copy the info from
the Inserted table into there?
FYI: I want to insert initail values for a 3 unique Id's into a 4th table.
So the inserted table contain the first ID's and I open cursors to store the
other 2 sets of ids. Then I am nesting the three cursors to insert a row fo
r
each of the three ID combinations.
IDCol1 IDCol2 IDCol 3 Tbl4Col
1 1 1 0
1 1 2 0
1 2 1 0
2 1 1 0
2 1 2 0
2 2 1 0
ect...
I hope that all makes sense. From what I know I can't do this in a trigger,
maye I can?
Thanks,
Greg
"Nathan H. Omukwenyi" wrote:

> CREATE TRIGGER YourTriggerName
> ON T1
> FOR INSERT
> AS
> DECLARE @.newid int
> IF @.@.ROWCOUNT=1
> BEGIN
> SET @.newid=(Select col1 FROM inserted)
> --Do what you want do to with the @.newid here
> END
>
> Nathan H. Omukwenyi
> "Greg P" <gsp@.newsgroups.nospam> wrote in message
> news:872807BA-17FA-47A7-AAE1-AAF397488904@.microsoft.com...
>
>|||Omni,
Any ideas on my new post?
Thanks,
Greg p
"Omnibuzz" wrote:
> try this...
> create trigger trig1 on T1 after insert
> as
> begin
> insert into [child table] ([new id])
> select [new id] from inserted
> end
> --
>
>
> "Greg P" wrote:
>|||>> want to create a basic insert trigger. In T1 I add a row, which creates a new ID
[sic]. The trigger fires after the insert, how do I get the new ID to add to the chil
d [sic] table? <<
Stop using SQL and go back to a network database. You have described
how they work as they build pointer chains as the data is inserted. I
am not kidding -- read a DB history book. You even used the term
"child" instead of "referenced" table!! Pure network/pointer chain
database concepts and terms, not anything like RDBMS.
Perhaps you should have read one book on RDBMS instead?
You do not create a relational key. It already exists in the real
world and you discover it.
Triggers are a kludge for putting procedural code into a declarative
language.
You need to start over; you do not know what you are doing. People
here will give you kludges to get rid of you quickly because we cannot
give you a 1-2 year course in RDBMS. Telling someone to "smash rats
with a rock when they get near your baby" is easier than "improve the
sewer system by learning civil engineering so rats are not a problem"
Look up this article: http://www.apa.org/journals/psp/psp7761121.html
Journal of Personality and Social Psychology
Unskilled and Unaware of It: How Difficulties in Recognizing One's Own
Incompetence Lead to Inflated Self-Assessments
Remember it takes SIX years to become a Union Journeyman Carpenter in
New York State. How many years to be an SQL programmer? A few ws
in a ceritificate training class!|||On Tue, 9 May 2006 13:10:02 -0700, Greg P wrote:

>I read up on how to use the inserted table and this seems to answer the
>question I posted, yet i have a bit of a different use than what was posted
.
>I need to look up values in two other tables before I can do my insert. I
am
>doing this with cursors. From what I am understanding I can't Declare
>anything in a trigger, so to use the cursors I am calling a stored procedure.[/colo
r]
Hi Greg,
First misunderstanding: you CAN declare anything in a trigger. Whoever
told you otherwise obviously has little experience and even less
knowledge of SQL Server.
Second misunderstanding: Never ever use a cursor (*). And especially not
inside a trigger. Unless you want to ruin your performance and your
scalability, of course.
(*) Okay, there are SOME situations where a cursor is the best choice,
but they are very rare - only experienced DB programmers should be
allowed to use cursors, because it takes a lot of experience to
recognize a situation that might benefit from a cursor.
>Inside this stored procedure is where I need to access the data in the
>inserted table. Should I create a temp table and somehow copy the info fro
m
>the Inserted table into there?
If you MUST use the values from the inserted table in a stored
procedure, then yes, you must copy the data from inserted to some other
(preferably temporary) table.
But I don't think that this is the correct solution in your case.

>FYI: I want to insert initail values for a 3 unique Id's into a 4th table.
>So the inserted table contain the first ID's and I open cursors to store th
e
>other 2 sets of ids. Then I am nesting the three cursors to insert a row f
or
>each of the three ID combinations.
>IDCol1 IDCol2 IDCol 3 Tbl4Col
> 1 1 1 0
> 1 1 2 0
> 1 2 1 0
> 2 1 1 0
> 2 1 2 0
> 2 2 1 0
>ect...
>I hope that all makes sense.
To be blunt - not at all.
Please post the structure of all relevant tables, as CREATE TABLE
statements. Don't forget to include all constraints, properties and
indexes. Then, post some illustrative sample rows of data (as INSERT
statements), one or two sample INSERT statements that should fire the
trigger and the end results you need to have in your table after the
trigger has finished execution. With that information, we can probably
help you write this trigger without cursors or temp tables.
Hugo Kornelis, SQL Server MVP|||Hugo,
Thanks for the response. What I'm looking do is actually quite easily
explain. I'll use 4 tables and three relationsip, Widgets (WidegetsID PK),
Colors(ColorsIDPK), Sizes(SizesID PK) and WidgetsUsed (WidgetsUsedID,
WidgetsID FK, ColorsID Fk, )
I do an insert of multiple widgets creating multiple rows which are stored
in the "Insert" Table of the trigger. When a new Widget is inserted I need
to initialize the WidgetsUsed table. This means inserting a new record for
each size and color possibility and setting . (This table will need a row fo
r
each color and size that widget can come in)
If 2 Widgets were added A and B, and the colors are stored in the colors
table, and the sizes are stored in the sizes table. For this example lets
say there are three color in the color table and two sizes in the color
table. So for each Widget inserted into the widget table I want to add 6
records into the Widgets used table. Finally I'll call the field in the
table I'm updating MyDataField.
I know the idea of using curosr is bad now and they they are very
inefficient, but what I was thinking was I would use the cursors like old
adodb recordsets and loop through each one like the procedure below. I thin
k
this is a pretty thourough description of what I'm doing. Thanks for your
effort.
CREATE TABLE [dbo].[tblWidgetsUsed](
[WidgetUsedID] [uniqueidentifier] NULL,
[WidgetID] [uniqueidentifier] NULL,
[ColorID] [uniqueidentifier] NULL,
[SizeID] [uniqueidentifier] NULL,
[WidgetsOrdered] [numeric](18, 0) NULL
) ON [PRIMARY]
CREATE PROCEDURE dbo.spTrigUtilInsert
-- Add the parameters for the stored procedure here
@.WidgetID as int = 0,
@.ColorId as int = 0,
@.SizeID as int = 0
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare curWidget Cursor for
SELECT WidgetID FROM tblTemp --created from Insert in the trigger
open curWidget
fetch next from curWidget into @.WidgetID
--for each newly insertered record
while (@.@.Fetch_Status <> -1)
Declare curColor Cursor for SELECT ColorID FROM dbo.tblColor
open curColor
Fetch next from curColor into @.ColorID
-- For each Color
while (@.@.Fetch_Status <> -1)
-- Each Size
Declare curSize Cursor for SELECT DISTINCT SizeID FROM
dbo.tblSize
open curSize
fetch next from curSize into @.SizeID
While (@.@.Fetch_Status<>-1)
insert into tblWidgetsOrdered("WidgetID", "ColorID", "SizeID",
"NumOrdered")
Values (@.WidgetId, @.ColorID, @.SizeID, 0)
END
GO
Obviously these are not my real tables, because of security issues with my
project I can't use real tables but I think this show you what I'm looking t
o
do. I am using VS2005 Windows form (which is why I discuussed child and
parent tables, because I need to handle the insert order myself... I will
have a reply for the extreemly rude gent that is all high and mighty...)
Let me know what you think the way to do this is. I'm upgrading an access
based app to SQL Server 2005 and would like to take advantage of triggers to
initalize these rows. In the old applicaiton recordsets did the work.
Thanks again Hugo.
Greg P.
"Hugo Kornelis" wrote:

> On Tue, 9 May 2006 13:10:02 -0700, Greg P wrote:
>
> Hi Greg,
> First misunderstanding: you CAN declare anything in a trigger. Whoever
> told you otherwise obviously has little experience and even less
> knowledge of SQL Server.
> Second misunderstanding: Never ever use a cursor (*). And especially not
> inside a trigger. Unless you want to ruin your performance and your
> scalability, of course.
> (*) Okay, there are SOME situations where a cursor is the best choice,
> but they are very rare - only experienced DB programmers should be
> allowed to use cursors, because it takes a lot of experience to
> recognize a situation that might benefit from a cursor.
>
> If you MUST use the values from the inserted table in a stored
> procedure, then yes, you must copy the data from inserted to some other
> (preferably temporary) table.
> But I don't think that this is the correct solution in your case.
>
> To be blunt - not at all.
> Please post the structure of all relevant tables, as CREATE TABLE
> statements. Don't forget to include all constraints, properties and
> indexes. Then, post some illustrative sample rows of data (as INSERT
> statements), one or two sample INSERT statements that should fire the
> trigger and the end results you need to have in your table after the
> trigger has finished execution. With that information, we can probably
> help you write this trigger without cursors or temp tables.
> --
> Hugo Kornelis, SQL Server MVP
>|||For anyone else reading this please do not think I would ever speak this way
if it were not for the post this gentlemen made first.
Hey Genius,
Mr F&*%ing high and mighty... did you see the title of the post. I admitted
to being unfamiliar to using Triggers and Cursors and was looking for some
advice from this newsgroup. Your slam of a person who claims to be
unknowledgeable in topic shows absolute insecurity you informed prick. Yes
once again I will say you are more informed more than me about this, that’
s
why I’m asking the questions moron!!! You could explain nicely what issue
s
have yet I would have to charge you $150 an hour to be your psychologist
because I’m sure no one else want to talk to you and it still isn’t enou
gh
money to listen to your useless babble.
FYI, I have a degree in computer science and do understand RDBMS very
clearly. I have designed and implemented many solutions in many different
technologies. Now I’m learning to work with a new one, SQL Server 2005.
I know that when you update tables in VS2005 you need to handle the
add/mod/deletes yourself through typed datasets. These method must be calle
d
by hand and the terminology used for this process includes Parent, Child, an
d
Grandchild tables. Here is one link to such a reference in the updating
multiple tables section:
http://www.15seconds.com/issue/051123.htm
I also have a WROX’s Visual Basic 2005 Database Programming book in front
of
me, which is the “most advanced” book in this series which even has a di
agram
on page 173 discussing the use of Parent, Child and Grandchild insert, updat
e
and deletes.
So now I have to question what do you really know? It seems to me not much.
You can talk very loud and very rudely… yet not very intelligently. Pleas
e
do not lower the average IQ of my posts again with your “knowledge”.
Regards,
Greg P.
"--CELKO--" wrote:

> Stop using SQL and go back to a network database. You have described
> how they work as they build pointer chains as the data is inserted. I
> am not kidding -- read a DB history book. You even used the term
> "child" instead of "referenced" table!! Pure network/pointer chain
> database concepts and terms, not anything like RDBMS.
>
> Perhaps you should have read one book on RDBMS instead?
> You do not create a relational key. It already exists in the real
> world and you discover it.
> Triggers are a kludge for putting procedural code into a declarative
> language.
> You need to start over; you do not know what you are doing. People
> here will give you kludges to get rid of you quickly because we cannot
> give you a 1-2 year course in RDBMS. Telling someone to "smash rats
> with a rock when they get near your baby" is easier than "improve the
> sewer system by learning civil engineering so rats are not a problem"
> Look up this article: http://www.apa.org/journals/psp/psp7761121.html
> Journal of Personality and Social Psychology
> Unskilled and Unaware of It: How Difficulties in Recognizing One's Own
> Incompetence Lead to Inflated Self-Assessments
> Remember it takes SIX years to become a Union Journeyman Carpenter in
> New York State. How many years to be an SQL programmer? A few ws
> in a ceritificate training class!
>|||Greg,
I dunno if this is what you want. And sorry for the delayed reply.. And
try to decipher this because I just got up from bed :)
try this...
create trigger trig1 on Widgets after insert
as
begin
insert into WidgetsUsed(WidgetID, ColorID, SizeID, NumOrdered)
select
a.WidegetsID,
b.colorsID,
c.sizesID,
0
from inserted a,
colors B,
sizes c
end
Let me know if this was what you wanted.

Newbee Table question

I am an MS Access developer who is writing his first SQL
Server app.
In MsAccess we have the AutoNumber data type to give
records a unique sequential value. There doesn't appear to
be an equivalent type in SQL Server.
I am adding records from a ASP.Net web page. What would be
the conventional means of giving each new record a
sequential value? I have gotten around this by querying
the table to find the value in the last record then adding
1 to it. I can't believe that there isn't a neater way to
achieve this.You can use something called an "identity" column:
CREATE TABLE #Table (SomeValue VARCHAR(20), AutoNum INT IDENTITY(1,1))
INSERT #Table VALUES ('A')
INSERT #Table VALUES ('B')
INSERT #Table VALUES ('C')
SELECT * FROM #Table ORDER BY SomeValue
A 1
B 2
C 3
"Ian Pendlebury" <anonymous@.discussions.microsoft.com> wrote in message
news:696f01c405c1$3a868d20$a601280a@.phx.gbl...
> I am an MS Access developer who is writing his first SQL
> Server app.
> In MsAccess we have the AutoNumber data type to give
> records a unique sequential value. There doesn't appear to
> be an equivalent type in SQL Server.
> I am adding records from a ASP.Net web page. What would be
> the conventional means of giving each new record a
> sequential value? I have gotten around this by querying
> the table to find the value in the last record then adding
> 1 to it. I can't believe that there isn't a neater way to
> achieve this.
>|||What is to be done in Sql Server to have an autonumber field
****************************************
******************************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET
resources...|||Look at the IDENTITY() function
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"saurabh" <s_saur79@.yahoo.co.in> wrote in message
news:OzSjUpaEEHA.3408@.tk2msftngp13.phx.gbl...
> What is to be done in Sql Server to have an autonumber field
> ****************************************
******************************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...

Newbee questions

I am trying to execute these set of statements...
CREATE DATABASE Sales1
ON
PRIMARY(NAME=SalesPrimary,
FILENAME='C:\Kim\SalesPrimary.mdf',
SIZE = 500MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
(NAME = SalesData1,
FILENAME = 'C:\Kim\SalesData1.ndf',
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
(FILENAME='C:\Kim\SalesData2.ndf',
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
(NAME = SalesHistory1,
FILENAME='C:\Kim\SalesHistory1.ndf',
SIZE=100MB,
MAXSIZE=500,
FILEGROWTH=50)
LOG ON
(NAME=Archlog1,
FILENAME='C:\Kim\SalesLog.ldf',
SIZE=300MB,
MAXSIZE=800,
FILEGROWTH=100)
I am using SSMS and typind this in the New Query Editor window.
But when I execute it...it gives me an error saying...
Msg 1036, Level 16, State 2, Line 1
File option NAME is required in this CREATE/ALTER DATABASE statement.
But I already gave the database name as SALES1...what is the problem
here?
Appreciate your help
Thanks in advance!
Just glancing, it looks like the NAME is missing for salesdata2.ndf
No idea if the rest is correct or not...
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com
"freeblue11" <freeblue11@.gmail.com> wrote in message
news:1164656369.028134.98250@.j72g2000cwa.googlegro ups.com...
>I am trying to execute these set of statements...
> CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=SalesPrimary,
> FILENAME='C:\Kim\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 200,
> FILEGROWTH = 20),
> FILEGROUP SalesFG
> (NAME = SalesData1,
> FILENAME = 'C:\Kim\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100),
> (FILENAME='C:\Kim\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300),
> FILEGROUP SalesHistoryFG
> (NAME = SalesHistory1,
> FILENAME='C:\Kim\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50)
> LOG ON
> (NAME=Archlog1,
> FILENAME='C:\Kim\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100)
> I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here?
> Appreciate your help
> Thanks in advance!
>
|||Kevin, Arnie
My oversite!!
Thank you very much!
Arnie Rowland wrote:
> Good formatting often makes things so easy to see. Notes inline...
> CREATE DATABASE Sales1
> ON PRIMARY
> ( NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 500, --Maxsize has to be at least the same as Size
> FILEGROWTH = 20
> ),
> FILEGROUP SalesFG
> ( NAME = SalesData1,
> FILENAME = 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100
> ),
> ( , --Missing Filename here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300
> ),
> FILEGROUP SalesHistoryFG
> ( NAME = SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50
> )
> LOG ON
> ( NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100
> )
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the top yourself.
> - H. Norman Schwarzkopf
>
> "freeblue11" <freeblue11@.gmail.com> wrote in message news:1164656369.028134.98250@.j72g2000cwa.googlegro ups.com...
> --=_NextPart_000_07DC_01C7121B.7A817570
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 5412
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <META content="MSHTML 6.00.5730.11" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY>
> <DIV><FONT face=Arial size=2>Good formatting often makes things so easy to see.
> Notes inline...</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face="Courier New" size=2>CREATE DATABASE Sales1<BR>&nbsp;&nbsp; ON
> PRIMARY<BR>&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; (&nbsp;
> NAME=SalesPrimary,<BR>&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;
> FILENAME='D:\Temp\SalesPrimary.mdf',<BR>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
> SIZE = 500MB,<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MAXSIZE =
> 500,&nbsp; --Maxsize has to be at least the same as
> Size<BR>&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp; FILEGROWTH =
> 20<BR>&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp; ),<BR>&nbsp;&nbsp; FILEGROUP
> SalesFG<BR>&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; (&nbsp; NAME =
> SalesData1,<BR>&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FILENAME =
> 'D:\Temp\SalesData1.ndf',<BR>&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;
> SIZE = 200MB,<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MAXSIZE =
> 800,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp; FILEGROWTH =
> 100<BR>&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp; ),<BR>&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;
> (&nbsp; , --Missing Filename
> here<BR>&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;
> FILENAME='D:\Temp\SalesData2.ndf',<BR>&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;
> SIZE = 400MB,<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MAXSIZE =
> 1200,<BR>&nbsp;&nbsp;&nbsp;&nbsp;& amp;nbsp;&nbsp;&nbsp;&nbsp; FILEGROWTH =
> 300<BR>&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp; ),<BR>&nbsp;&nbsp; FILEGROUP
> SalesHistoryFG<BR>&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp; (&nbsp; NAME =
> SalesHistory1,<BR>&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> FILENAME='D:\Temp\SalesHistory1.ndf',<BR>&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
> SIZE=100MB,<BR>&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> MAXSIZE=500,<BR>&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> FILEGROWTH=50<BR>&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp; )<BR>&nbsp;&nbsp; LOG
> ON<BR>&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp; (&nbsp;
> NAME=Archlog1,<BR>&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> FILENAME='D:\Temp\SalesLog.ldf',<BR>&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;
> SIZE=300MB,<BR>&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> MAXSIZE=800,<BR>&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> FILEGROWTH=100<BR>&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp; )</FONT></DIV>
> <DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
> <DIV><BR><FONT face=Arial size=2>-- <BR>Arnie Rowland, Ph.D.<BR>Westwood
> Consulting, Inc</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>Most good judgment comes from experience. <BR>Most
> experience comes from bad judgment. <BR>- Anonymous</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>You can't help someone get up a hill without
> getting a little closer to the top yourself.<BR>- H. Norman
> Schwarzkopf</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
> <DIV><FONT face=Arial size=2>"freeblue11" <</FONT><A
> href="http://links.10026.com/?link=mailto:freeblue11@.gmail.com"><FONT face=Arial
> size=2>freeblue11@.gmail.com</FONT></A><FONT face=Arial size=2>> wrote in
> message </FONT><A
> href="http://links.10026.com/?link=news:1164656369.028134.98250@.j72g2000cwa.goo glegroups.com"><FONT
> face=Arial
> size=2>news:1164656369.028134.98250@.j72g2000cwa.go oglegroups.com</FONT></A><FONT
> face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>>I am trying to
> execute these set of statements...<BR>> <BR>> CREATE DATABASE
> Sales1<BR>> ON<BR>> PRIMARY(NAME=SalesPrimary,<BR>>
> FILENAME='C:\Kim\SalesPrimary.mdf',<BR>> SIZE = 500MB,<BR>> MAXSIZE =
> 200,<BR>> FILEGROWTH = 20),<BR>> FILEGROUP SalesFG<BR>> (NAME =
> SalesData1,<BR>> FILENAME = 'C:\Kim\SalesData1.ndf',<BR>> SIZE =
> 200MB,<BR>> MAXSIZE = 800,<BR>> FILEGROWTH = 100),<BR>>
> (FILENAME='C:\Kim\SalesData2.ndf',<BR>> SIZE = 400MB,<BR>> MAXSIZE =
> 1200,<BR>> FILEGROWTH = 300),<BR>> FILEGROUP SalesHistoryFG<BR>> (NAME
> = SalesHistory1,<BR>> FILENAME='C:\Kim\SalesHistory1.ndf',<BR>>
> SIZE=100MB,<BR>> MAXSIZE=500,<BR>> FILEGROWTH=50)<BR>> LOG ON<BR>>
> (NAME=Archlog1,<BR>> FILENAME='C:\Kim\SalesLog.ldf',<BR>>
> SIZE=300MB,<BR>> MAXSIZE=800,<BR>> FILEGROWTH=100)<BR>> <BR>> I am
> using SSMS and typind this in the New Query Editor window.<BR>> But when I
> execute it...it gives me an error saying...<BR>> <BR>> Msg 1036, Level 16,
> State 2, Line 1<BR>> File option NAME is required in this CREATE/ALTER
> DATABASE statement.<BR>> But I already gave the database name as
> SALES1...what is the problem<BR>> here?<BR>> <BR>> Appreciate your
> help<BR>> <BR>> Thanks in advance!<BR>></FONT></BODY></HTML>
> --=_NextPart_000_07DC_01C7121B.7A817570--

Newbee questions

I am trying to execute these set of statements...
CREATE DATABASE Sales1
ON
PRIMARY(NAME=SalesPrimary,
FILENAME='C:\Kim\SalesPrimary.mdf',
SIZE = 500MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
(NAME = SalesData1,
FILENAME = 'C:\Kim\SalesData1.ndf',
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
(FILENAME='C:\Kim\SalesData2.ndf',
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
(NAME = SalesHistory1,
FILENAME='C:\Kim\SalesHistory1.ndf',
SIZE=100MB,
MAXSIZE=500,
FILEGROWTH=50)
LOG ON
(NAME=Archlog1,
FILENAME='C:\Kim\SalesLog.ldf',
SIZE=300MB,
MAXSIZE=800,
FILEGROWTH=100)
I am using SSMS and typind this in the New Query Editor window.
But when I execute it...it gives me an error saying...
Msg 1036, Level 16, State 2, Line 1
File option NAME is required in this CREATE/ALTER DATABASE statement.
But I already gave the database name as SALES1...what is the problem
here'
Appreciate your help
Thanks in advance!Just glancing, it looks like the NAME is missing for salesdata2.ndf
No idea if the rest is correct or not...
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com
"freeblue11" <freeblue11@.gmail.com> wrote in message
news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
>I am trying to execute these set of statements...
> CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=SalesPrimary,
> FILENAME='C:\Kim\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 200,
> FILEGROWTH = 20),
> FILEGROUP SalesFG
> (NAME = SalesData1,
> FILENAME = 'C:\Kim\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100),
> (FILENAME='C:\Kim\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300),
> FILEGROUP SalesHistoryFG
> (NAME = SalesHistory1,
> FILENAME='C:\Kim\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50)
> LOG ON
> (NAME=Archlog1,
> FILENAME='C:\Kim\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100)
> I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
> Appreciate your help
> Thanks in advance!
>|||Good formatting often makes things so easy to see. Notes inline...
CREATE DATABASE Sales1
ON PRIMARY
( NAME=SalesPrimary,
FILENAME='D:\Temp\SalesPrimary.mdf',
SIZE = 500MB,
MAXSIZE = 500, --Maxsize has to be at least the same as Size
FILEGROWTH = 20
),
FILEGROUP SalesFG
( NAME = SalesData1,
FILENAME = 'D:\Temp\SalesData1.ndf',
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100
),
( , --Missing Filename here
FILENAME='D:\Temp\SalesData2.ndf',
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300
),
FILEGROUP SalesHistoryFG
( NAME = SalesHistory1,
FILENAME='D:\Temp\SalesHistory1.ndf',
SIZE=100MB,
MAXSIZE=500,
FILEGROWTH=50
)
LOG ON
( NAME=Archlog1,
FILENAME='D:\Temp\SalesLog.ldf',
SIZE=300MB,
MAXSIZE=800,
FILEGROWTH=100
)
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"freeblue11" <freeblue11@.gmail.com> wrote in message news:1164656369.028134.98250@.j72g2000cw
a.googlegroups.com...
>I am trying to execute these set of statements...
>
> CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=SalesPrimary,
> FILENAME='C:\Kim\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 200,
> FILEGROWTH = 20),
> FILEGROUP SalesFG
> (NAME = SalesData1,
> FILENAME = 'C:\Kim\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100),
> (FILENAME='C:\Kim\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300),
> FILEGROUP SalesHistoryFG
> (NAME = SalesHistory1,
> FILENAME='C:\Kim\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50)
> LOG ON
> (NAME=Archlog1,
> FILENAME='C:\Kim\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100)
>
> I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
>
> Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
>
> Appreciate your help
>
> Thanks in advance!
>|||Kevin, Arnie
My oversite!!
Thank you very much!
Arnie Rowland wrote:
> Good formatting often makes things so easy to see. Notes inline...
> CREATE DATABASE Sales1
> ON PRIMARY
> ( NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 500, --Maxsize has to be at least the same as Size
> FILEGROWTH = 20
> ),
> FILEGROUP SalesFG
> ( NAME = SalesData1,
> FILENAME = 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100
> ),
> ( , --Missing Filename here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300
> ),
> FILEGROUP SalesHistoryFG
> ( NAME = SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50
> )
> LOG ON
> ( NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100
> )
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to th
e top yourself.
> - H. Norman Schwarzkopf
>
> "freeblue11" <freeblue11@.gmail.com> wrote in message news:1164656369.02813
4.98250@.j72g2000cwa.googlegroups.com...
> --=_NextPart_000_07DC_01C7121B.7A817570
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 5412
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
> <META content="MSHTML 6.00.5730.11" name=GENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY>
> <DIV><FONT face=Arial size=2>Good formatting often makes things so easy to
see.
> Notes inline...</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face="Courier New" size=2>CREATE DATABASE Sales1<BR> &
amp;nbsp; ON
> PRIMARY<BR> (
> NAME=SalesPrimary,<BR> &a
mp;nbsp;
> FILENAME='D:\Temp\SalesPrimary.mdf',<BR> &
;nbsp;
> SIZE = 500MB,<BR> &nb
sp; MAXSIZE =
> 500, --Maxsize has to be at least the same as
> Size<BR> &n
bsp; FILEGROWTH =
> 20<BR> ),<BR>&
amp;nbsp; FILEGROUP
> SalesFG<BR> (
NAME =
> SalesData1,<BR>  
; FILENAME =
> 'D:\Temp\SalesData1.ndf',<BR> &
nbsp;
> SIZE = 200MB,<BR> &nb
sp; MAXSIZE =
> 800,<BR> &n
bsp; FILEGROWTH =
> 100<BR> ),<BR>
> ( , --Missing Filename
> here<BR> &n
bsp;
> FILENAME='D:\Temp\SalesData2.ndf',<BR> &n
bsp;
> SIZE = 400MB,<BR> &nb
sp; MAXSIZE =
> 1200,<BR> &
nbsp; FILEGROWTH =
> 300<BR> ),<BR>
FILEGROUP
> SalesHistoryFG<BR> (&
;nbsp; NAME =
> SalesHistory1,<BR> &n
bsp;
> FILENAME='D:\Temp\SalesHistory1.ndf',<BR> &am
p;nbsp;
> SIZE=100MB,<BR>  
;
> MAXSIZE=500,<BR> &nbs
p;
> FILEGROWTH=50<BR> )<BR>&
amp;nbsp; LOG
> ON<BR> (
> NAME=Archlog1,<BR> &n
bsp;
> FILENAME='D:\Temp\SalesLog.ldf',<BR> &nbs
p;
> SIZE=300MB,<BR>  
;
> MAXSIZE=800,<BR> &nbs
p;
> FILEGROWTH=100<BR> )</FO
NT></DIV>
> <DIV><FONT face="Courier New" size=2></FONT> </DIV>
> <DIV><BR><FONT face=Arial size=2>-- <BR>Arnie Rowland, Ph.D.<BR>Westwood
> Consulting, Inc</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face=Arial size=2>Most good judgment comes from experience. <BR
>Most
> experience comes from bad judgment. <BR>- Anonymous</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face=Arial size=2>You can't help someone get up a hill without
> getting a little closer to the top yourself.<BR>- H. Norman
> Schwarzkopf</FONT></DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face=Arial size=2></FONT> </DIV>
> <DIV><FONT face=Arial size=2>"freeblue11" <</FONT><A
> href="http://links.10026.com/?link=mailto:freeblue11@.gmail.com"><FONT face=Arial
> size=2>freeblue11@.gmail.com</FONT></A><FONT face=Arial size=2>> wrote i
n
> message </FONT><A
> href="http://links.10026.com/?link=news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com"><FONT
> face=Arial
> size=2>news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com</FONT></A
><FONT
> face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>>I am trying
to
> execute these set of statements...<BR>> <BR>> CREATE DATABASE
> Sales1<BR>> ON<BR>> PRIMARY(NAME=SalesPrimary,<BR>>
> FILENAME='C:\Kim\SalesPrimary.mdf',<BR>> SIZE = 500MB,<BR>> MAXSIZE
=
> 200,<BR>> FILEGROWTH = 20),<BR>> FILEGROUP SalesFG<BR>> (NAME =
> SalesData1,<BR>> FILENAME = 'C:\Kim\SalesData1.ndf',<BR>> SIZE =
> 200MB,<BR>> MAXSIZE = 800,<BR>> FILEGROWTH = 100),<BR>>
> (FILENAME='C:\Kim\SalesData2.ndf',<BR>> SIZE = 400MB,<BR>> MAXSIZE =
> 1200,<BR>> FILEGROWTH = 300),<BR>> FILEGROUP SalesHistoryFG<BR>>
(NAME
> = SalesHistory1,<BR>> FILENAME='C:\Kim\SalesHistory1.ndf',<BR>>
> SIZE=100MB,<BR>> MAXSIZE=500,<BR>> FILEGROWTH=50)<BR>> LOG ON<BR>
> (NAME=Archlog1,<BR>> FILENAME='C:\Kim\SalesLog.ldf',<BR>>
> SIZE=300MB,<BR>> MAXSIZE=800,<BR>> FILEGROWTH=100)<BR>> <BR>>
I am
> using SSMS and typind this in the New Query Editor window.<BR>> But whe
n I
> execute it...it gives me an error saying...<BR>> <BR>> Msg 1036, Lev
el 16,
> State 2, Line 1<BR>> File option NAME is required in this CREATE/ALTER
> DATABASE statement.<BR>> But I already gave the database name as
> SALES1...what is the problem<BR>> here'<BR>> <BR>> Appreciate
your
> help<BR>> <BR>> Thanks in advance!<BR>></FONT></BODY></HTML>
> --=_NextPart_000_07DC_01C7121B.7A817570--

Newbee questions

I am trying to execute these set of statements...
CREATE DATABASE Sales1
ON
PRIMARY(NAME=SalesPrimary,
FILENAME='C:\Kim\SalesPrimary.mdf',
SIZE = 500MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
(NAME = SalesData1,
FILENAME = 'C:\Kim\SalesData1.ndf',
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
(FILENAME='C:\Kim\SalesData2.ndf',
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
(NAME = SalesHistory1,
FILENAME='C:\Kim\SalesHistory1.ndf',
SIZE=100MB,
MAXSIZE=500,
FILEGROWTH=50)
LOG ON
(NAME=Archlog1,
FILENAME='C:\Kim\SalesLog.ldf',
SIZE=300MB,
MAXSIZE=800,
FILEGROWTH=100)
I am using SSMS and typind this in the New Query Editor window.
But when I execute it...it gives me an error saying...
Msg 1036, Level 16, State 2, Line 1
File option NAME is required in this CREATE/ALTER DATABASE statement.
But I already gave the database name as SALES1...what is the problem
here'
Appreciate your help
Thanks in advance!Just glancing, it looks like the NAME is missing for salesdata2.ndf
No idea if the rest is correct or not...
--
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com
"freeblue11" <freeblue11@.gmail.com> wrote in message
news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
>I am trying to execute these set of statements...
> CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=SalesPrimary,
> FILENAME='C:\Kim\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 200,
> FILEGROWTH = 20),
> FILEGROUP SalesFG
> (NAME = SalesData1,
> FILENAME = 'C:\Kim\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100),
> (FILENAME='C:\Kim\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300),
> FILEGROUP SalesHistoryFG
> (NAME = SalesHistory1,
> FILENAME='C:\Kim\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50)
> LOG ON
> (NAME=Archlog1,
> FILENAME='C:\Kim\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100)
> I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
> Appreciate your help
> Thanks in advance!
>|||This is a multi-part message in MIME format.
--=_NextPart_000_07DC_01C7121B.7A817570
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Good formatting often makes things so easy to see. Notes inline...
CREATE DATABASE Sales1
ON PRIMARY
( NAME=3DSalesPrimary,
FILENAME=3D'D:\Temp\SalesPrimary.mdf',
SIZE =3D 500MB,
MAXSIZE =3D 500, --Maxsize has to be at least the same as Size
FILEGROWTH =3D 20
),
FILEGROUP SalesFG
( NAME =3D SalesData1,
FILENAME =3D 'D:\Temp\SalesData1.ndf',
SIZE =3D 200MB,
MAXSIZE =3D 800,
FILEGROWTH =3D 100
),
( , --Missing Filename here
FILENAME=3D'D:\Temp\SalesData2.ndf',
SIZE =3D 400MB,
MAXSIZE =3D 1200,
FILEGROWTH =3D 300
),
FILEGROUP SalesHistoryFG
( NAME =3D SalesHistory1,
FILENAME=3D'D:\Temp\SalesHistory1.ndf',
SIZE=3D100MB,
MAXSIZE=3D500,
FILEGROWTH=3D50
)
LOG ON
( NAME=3DArchlog1,
FILENAME=3D'D:\Temp\SalesLog.ldf',
SIZE=3D300MB,
MAXSIZE=3D800,
FILEGROWTH=3D100
)
-- Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill without getting a little closer to =the top yourself.
- H. Norman Schwarzkopf
"freeblue11" <freeblue11@.gmail.com> wrote in message =news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
>I am trying to execute these set of statements...
> > CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=3DSalesPrimary,
> FILENAME=3D'C:\Kim\SalesPrimary.mdf',
> SIZE =3D 500MB,
> MAXSIZE =3D 200,
> FILEGROWTH =3D 20),
> FILEGROUP SalesFG
> (NAME =3D SalesData1,
> FILENAME =3D 'C:\Kim\SalesData1.ndf',
> SIZE =3D 200MB,
> MAXSIZE =3D 800,
> FILEGROWTH =3D 100),
> (FILENAME=3D'C:\Kim\SalesData2.ndf',
> SIZE =3D 400MB,
> MAXSIZE =3D 1200,
> FILEGROWTH =3D 300),
> FILEGROUP SalesHistoryFG
> (NAME =3D SalesHistory1,
> FILENAME=3D'C:\Kim\SalesHistory1.ndf',
> SIZE=3D100MB,
> MAXSIZE=3D500,
> FILEGROWTH=3D50)
> LOG ON
> (NAME=3DArchlog1,
> FILENAME=3D'C:\Kim\SalesLog.ldf',
> SIZE=3D300MB,
> MAXSIZE=3D800,
> FILEGROWTH=3D100)
> > I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> > Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
> > Appreciate your help
> > Thanks in advance!
>
--=_NextPart_000_07DC_01C7121B.7A817570
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Good formatting often makes things so =easy to see. Notes inline...
CREATE DATABASE =Sales1 ON PRIMARY ( NAME=3DSalesPrimary, =FILENAME=3D'D:\Temp\SalesPrimary.mdf', &=nbsp; SIZE =3D 500MB, =MAXSIZE =3D 500, --Maxsize has to be at least the same as Size FILEGROWTH =3D 20 ), FILEGROUP SalesFG ( NAME =3D SalesData1, FILENAME ==3D 'D:\Temp\SalesData1.ndf', &n=bsp; SIZE =3D 200MB, =MAXSIZE =3D 800, FILEGROWTH =3D 100 =), ( , --Missing Filename here FILENAME=3D'D:\Temp\SalesData2.ndf', &nb=sp; SIZE =3D 400MB, =MAXSIZE =3D 1200, FILEGROWTH =3D =300 ), FILEGROUP SalesHistoryFG ( NAME =3D SalesHistory1, FILENAME=3D'D:\Temp\SalesHistory1.ndf', = SIZE=3D100MB, MAXSIZE=3D500, FILEGROWTH=3D50 ) LOG ON ( NAME=3DArchlog1, FILENAME=3D'D:\Temp\SalesLog.ldf',  =; SIZE=3D300MB, MAXSIZE=3D800, FILEGROWTH=3D100 )
-- Arnie Rowland, =Ph.D.Westwood Consulting, Inc
Most good judgment comes from =experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill =without getting a little closer to the top yourself.- H. Norman Schwarzkopf
"freeblue11" =wrote in message news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com=...>I =am trying to execute these set of statements...> > CREATE DATABASE Sales1> ON> PRIMARY(NAME=3DSalesPrimary,> FILENAME=3D'C:\Kim\SalesPrimary.mdf',> SIZE =3D 500MB,> =MAXSIZE =3D 200,> FILEGROWTH =3D 20),> FILEGROUP SalesFG> (NAME ==3D SalesData1,> FILENAME =3D 'C:\Kim\SalesData1.ndf',> SIZE ==3D 200MB,> MAXSIZE =3D 800,> FILEGROWTH =3D 100),> (FILENAME=3D'C:\Kim\SalesData2.ndf',> SIZE =3D 400MB,> =MAXSIZE =3D 1200,> FILEGROWTH =3D 300),> FILEGROUP =SalesHistoryFG> (NAME =3D SalesHistory1,> =FILENAME=3D'C:\Kim\SalesHistory1.ndf',> SIZE=3D100MB,> MAXSIZE=3D500,> FILEGROWTH=3D50)> =LOG ON> (NAME=3DArchlog1,> FILENAME=3D'C:\Kim\SalesLog.ldf',> SIZE=3D300MB,> MAXSIZE=3D800,> FILEGROWTH=3D100)> => I am using SSMS and typind this in the New Query Editor window.> But =when I execute it...it gives me an error saying...> > Msg 1036, =Level 16, State 2, Line 1> File option NAME is required in this =CREATE/ALTER DATABASE statement.> But I already gave the database name as SALES1...what is the problem> here'> > =Appreciate your help> > Thanks in advance!>

--=_NextPart_000_07DC_01C7121B.7A817570--|||Kevin, Arnie
My oversite!!
Thank you very much!
Arnie Rowland wrote:
> Good formatting often makes things so easy to see. Notes inline...
> CREATE DATABASE Sales1
> ON PRIMARY
> ( NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 500, --Maxsize has to be at least the same as Size
> FILEGROWTH = 20
> ),
> FILEGROUP SalesFG
> ( NAME = SalesData1,
> FILENAME = 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100
> ),
> ( , --Missing Filename here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300
> ),
> FILEGROUP SalesHistoryFG
> ( NAME = SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50
> )
> LOG ON
> ( NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100
> )
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the top yourself.
> - H. Norman Schwarzkopf
>
> "freeblue11" <freeblue11@.gmail.com> wrote in message news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
> >I am trying to execute these set of statements...
> >
> > CREATE DATABASE Sales1
> > ON
> > PRIMARY(NAME=SalesPrimary,
> > FILENAME='C:\Kim\SalesPrimary.mdf',
> > SIZE = 500MB,
> > MAXSIZE = 200,
> > FILEGROWTH = 20),
> > FILEGROUP SalesFG
> > (NAME = SalesData1,
> > FILENAME = 'C:\Kim\SalesData1.ndf',
> > SIZE = 200MB,
> > MAXSIZE = 800,
> > FILEGROWTH = 100),
> > (FILENAME='C:\Kim\SalesData2.ndf',
> > SIZE = 400MB,
> > MAXSIZE = 1200,
> > FILEGROWTH = 300),
> > FILEGROUP SalesHistoryFG
> > (NAME = SalesHistory1,
> > FILENAME='C:\Kim\SalesHistory1.ndf',
> > SIZE=100MB,
> > MAXSIZE=500,
> > FILEGROWTH=50)
> > LOG ON
> > (NAME=Archlog1,
> > FILENAME='C:\Kim\SalesLog.ldf',
> > SIZE=300MB,
> > MAXSIZE=800,
> > FILEGROWTH=100)
> >
> > I am using SSMS and typind this in the New Query Editor window.
> > But when I execute it...it gives me an error saying...
> >
> > Msg 1036, Level 16, State 2, Line 1
> > File option NAME is required in this CREATE/ALTER DATABASE statement.
> > But I already gave the database name as SALES1...what is the problem
> > here'
> >
> > Appreciate your help
> >
> > Thanks in advance!
> >
> --=_NextPart_000_07DC_01C7121B.7A817570
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 5412
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> &

>
>
>
>
>
> Good formatting often makes things so easy to see.
> Notes inline...
>
> CREATE DATABASE Sales1 ON
> PRIMARY (
> NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB, MAXSIZE => 500, --Maxsize has to be at least the same as
> Size FILEGROWTH => 20 ), FILEGROUP
> SalesFG ( NAME => SalesData1, FILENAME => 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB, MAXSIZE => 800, FILEGROWTH => 100 ),
> ( , --Missing Filename
> here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB, MAXSIZE => 1200, FILEGROWTH => 300 ), FILEGROUP
> SalesHistoryFG ( NAME => SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50 ) LOG
> ON (
> NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100 )
>
> -- Arnie Rowland, Ph.D.Westwood
> Consulting, Inc
>
> Most good judgment comes from experience. Most
> experience comes from bad judgment. - Anonymous
>
> You can't help someone get up a hill without
> getting a little closer to the top yourself.- H. Norman
> Schwarzkopf
>
>
> "freeblue11" < href="http://links.10026.com/?link=mailto:freeblue11@.gmail.com"> size=2>freeblue11@.gmail.com> wrote in
> message href="http://links.10026.com/?link=news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com"> face=Arial
> size=2>news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com face=Arial size=2>...>I am trying to
> execute these set of statements...> > CREATE DATABASE
> Sales1> ON> PRIMARY(NAME=SalesPrimary,>
> FILENAME='C:\Kim\SalesPrimary.mdf',> SIZE = 500MB,> MAXSIZE => 200,> FILEGROWTH = 20),> FILEGROUP SalesFG> (NAME => SalesData1,> FILENAME = 'C:\Kim\SalesData1.ndf',> SIZE => 200MB,> MAXSIZE = 800,> FILEGROWTH = 100),>
> (FILENAME='C:\Kim\SalesData2.ndf',> SIZE = 400MB,> MAXSIZE => 1200,> FILEGROWTH = 300),> FILEGROUP SalesHistoryFG> (NAME
> = SalesHistory1,> FILENAME='C:\Kim\SalesHistory1.ndf',>
> SIZE=100MB,> MAXSIZE=500,> FILEGROWTH=50)> LOG ON>
> (NAME=Archlog1,> FILENAME='C:\Kim\SalesLog.ldf',>
> SIZE=300MB,> MAXSIZE=800,> FILEGROWTH=100)> > I am
> using SSMS and typind this in the New Query Editor window.> But when I
> execute it...it gives me an error saying...> > Msg 1036, Level 16,
> State 2, Line 1> File option NAME is required in this CREATE/ALTER
> DATABASE statement.> But I already gave the database name as
> SALES1...what is the problem> here'> > Appreciate your
> help> > Thanks in advance!>

> --=_NextPart_000_07DC_01C7121B.7A817570--

Newbee question on Reporting Service

Hi,
I am new to Reporting Service, I came from Crystal Reports background.
Have 2 questions:
(1) The Reports cretated via report designer are not object oriented? They
are not exposed as classes, my concern is that I can not manipulate the
reports programatically.
(2) The Reports do not exposed events? This might sounds related to question
(1), but even in non OO world, reports expose events too, say MS Access.
TIAHi,
Were you able to find out if the reports expose any events? The 'OnInit'
event is the only one I know of. So are there any events similar to MS Access?
Thanks,
Honesto J Manlig
"Danny Ni" wrote:
> Hi,
> I am new to Reporting Service, I came from Crystal Reports background.
> Have 2 questions:
> (1) The Reports cretated via report designer are not object oriented? They
> are not exposed as classes, my concern is that I can not manipulate the
> reports programatically.
> (2) The Reports do not exposed events? This might sounds related to question
> (1), but even in non OO world, reports expose events too, say MS Access.
>
> TIA
>
>

newbee question on function

Hi,
I created some functions in SQL server 2000 server. Every time I use the
functions I created I have to prefix them with dbo., say dbo.myFunction. Is
there a way to get around it?
TIANope. Qualifying scalar UFD with owner is mandatory. In fact, owner qualifyi
ng in general is a very
good thing to do, so you should get into the habit of always doing it...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Danny Ni" <dnd@.yahoo.com> wrote in message news:%23KV4rzSaFHA.2128@.TK2MSFTNGP14.phx.gbl...

> Hi,
> I created some functions in SQL server 2000 server. Every time I use the
> functions I created I have to prefix them with dbo., say dbo.myFunction. I
s
> there a way to get around it?
> TIA
>

newbee question on cloning a database

Hi,
I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
efore I do that I would like to have a copy of CTX_dev, in case something
goes wrong .
My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
export CTX_stg to CTX_dev. However I don't have enough disk space in C:
drive, so is there away I can create a database in D: and then Export to it?
Or are there better ways to do this?
TIA
You can use BACKUP DATABASE to back it up to D:, do it through enterprise
manager or the syntax in Query Analyser...
BACKUP DATABASE CTX_dev TO DISK = 'd:\CTX_Dev.bak' WITH INIT
Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=21
(Create your own groups, Forum, FAQ's and a ton more)
|||why not use backup and restore?
It does sound to me like you have database change management problems -
perhaps we could help...
regards,
Mark Baekdal
www.dbghost.com
+44 (0)208 241 1762
Database change management for SQL Server
"Raymond Du" wrote:

> Hi,
> I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
> in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
> efore I do that I would like to have a copy of CTX_dev, in case something
> goes wrong .
> My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
> export CTX_stg to CTX_dev. However I don't have enough disk space in C:
> drive, so is there away I can create a database in D: and then Export to it?
> Or are there better ways to do this?
> TIA
>
>
|||Other options are log shipping or Replication

newbee question on cloning a database

Hi,
I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
efore I do that I would like to have a copy of CTX_dev, in case something
goes wrong .
My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
export CTX_stg to CTX_dev. However I don't have enough disk space in C:
drive, so is there away I can create a database in D: and then Export to it?
Or are there better ways to do this?
TIAYou can use BACKUP DATABASE to back it up to D:, do it through enterprise
manager or the syntax in Query Analyser...
BACKUP DATABASE CTX_dev TO DISK = 'd:\CTX_Dev.bak' WITH INIT
Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=21
(Create your own groups, Forum, FAQ's and a ton more)|||why not use backup and restore?
It does sound to me like you have database change management problems -
perhaps we could help...
regards,
Mark Baekdal
www.dbghost.com
+44 (0)208 241 1762
Database change management for SQL Server
"Raymond Du" wrote:

> Hi,
> I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
> in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
> efore I do that I would like to have a copy of CTX_dev, in case something
> goes wrong .
> My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
> export CTX_stg to CTX_dev. However I don't have enough disk space in C:
> drive, so is there away I can create a database in D: and then Export to i
t?
> Or are there better ways to do this?
> TIA
>
>|||Other options are log shipping or Replication

newbee question on cloning a database

Hi,
I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
efore I do that I would like to have a copy of CTX_dev, in case something
goes wrong .
My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
export CTX_stg to CTX_dev. However I don't have enough disk space in C:
drive, so is there away I can create a database in D: and then Export to it?
Or are there better ways to do this?
TIAYou can use BACKUP DATABASE to back it up to D:, do it through enterprise
manager or the syntax in Query Analyser...
BACKUP DATABASE CTX_dev TO DISK = 'd:\CTX_Dev.bak' WITH INIT
--
Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=21
(Create your own groups, Forum, FAQ's and a ton more)|||why not use backup and restore?
It does sound to me like you have database change management problems -
perhaps we could help...
regards,
Mark Baekdal
www.dbghost.com
+44 (0)208 241 1762
Database change management for SQL Server
"Raymond Du" wrote:
> Hi,
> I have 2 databases: CTX_stg and CTX_dev in a SQL sever. Each is about 3 GB
> in size, I am trying to copy all the content of CTX_stg to CTX_dev, but
> efore I do that I would like to have a copy of CTX_dev, in case something
> goes wrong .
> My plan is to use DTS Export wizard export CTX_dev to CTX_dev_bak, then
> export CTX_stg to CTX_dev. However I don't have enough disk space in C:
> drive, so is there away I can create a database in D: and then Export to it?
> Or are there better ways to do this?
> TIA
>
>|||Other options are log shipping or Replication

Newbee question about permissions and sp_OACreate

Hi,
I'm creating a trigger that shall monitor a table on inserts and if certain
conditions are met, it should send a mail the administrator.
I do not want to use SQLmail for many reasons so I'm using the extended
procedure sp_OACreate to create an instance of the CDO.Message object
The problem is that only symins can use the extended procedure
sp_OACreate, and of cause I do not want users to be symins.
I think I read or learned somewhere that stored procedures runs under the
security context of the user that created the procedure, so why can't I as
the symin create a my_sendmail procedure that uses the sp_OACreate
extended procedure and grant permission to all users to the my_sendmail
procedure?
Or, is there another way?
Regards,
Jorgen D.First of all, this excedes the purpose of triggers. What has sending mail go
t
to do with ACID? It would be much more efficient if you created a job to
monitor the table and log these special events in a separate table/file and
mail the report/warning.
Second, why is it not possible for you to use SQL Mail? It's far more
efficient than (ab)using sp_OA procedures. And it can be used by any user
without compromising the security.
How about notification services? If mailing these messages was requested by
a manager, you can be pretty sure, he'll start hating it after about a month
.
Either the messages will be too frequent or too infrequent and he'll still
need to keep statistics somewhere, somehow. But I'm just guessing here...
Anyway, seems to me that what you really need is some sort of logical event
logging. This IS the purpose of triggers - propagating changes in one table
to another.
Be careful out there...
ML|||Why do some people answer a question with more questions? (no, thanks for
your input)
My trigger do populate data to other tables (sending work orders to PDA’s,
via merge replication), and when done it’s important that the users
implicated (the ones that gets the work order) gets an mail/sms to inform
them about it (they should react to it immediately)
This mail shall originate form different senders, therefore not SQL-mail
which is based on a single profile (perhaps there is a way around that that
I
didn’t find)
Another reason not to use SQL-mail is in another scenario, that I’m not
going to explain in detail, but the mail should be HTML formatted report
larger than 8000 bytes.
Notification services? Hmmm, I’ll look into that, (as I don’t know what
that
is)
But to get back to my original question….. If I want to use an extended
procedure in my own procedure, how can I set permissions so the ordinary
mortal users can execute that?
Regards,
Jorgen D.
"ML" wrote:

> First of all, this excedes the purpose of triggers. What has sending mail
got
> to do with ACID? It would be much more efficient if you created a job to
> monitor the table and log these special events in a separate table/file an
d
> mail the report/warning.
> Second, why is it not possible for you to use SQL Mail? It's far more
> efficient than (ab)using sp_OA procedures. And it can be used by any user
> without compromising the security.
> How about notification services? If mailing these messages was requested b
y
> a manager, you can be pretty sure, he'll start hating it after about a mon
th.
> Either the messages will be too frequent or too infrequent and he'll still
> need to keep statistics somewhere, somehow. But I'm just guessing here...
> Anyway, seems to me that what you really need is some sort of logical even
t
> logging. This IS the purpose of triggers - propagating changes in one tabl
e
> to another.
> Be careful out there...
>
> ML|||Any user who needs to execute sp_OA procedures must have appropriate
privileges to do so.
I'm sorry, I'm simply curious as to what you're trying to do. You say
certain users must be notified (with a large report, even) of certain change
s
to yor data. And this must be done immediately after those changes were
commited. Why? Do this users then do something? Couldn't that be done
automatically?
It's like in that nuclear plant: "push this button when that light goes on"
- why not just automatically do whatever the button does when conditions are
met which normally tur the light on...?
Instead of sending huge reports you could simply send a link to the report
built by the SQL Reporting Services.
Consider the alternatives before you compromise security.
ML|||Some users are security guards which have to respond to alarms. When they ge
t
notified they should turn on their PDA and connect to the server to get
detailed information of the alarm (address, codes etc.). Other users are
doing emergency road help. So the notification is important to be timely.
They can’t ask the server/system to drive to an incident.
About the reports – They aren’t huge. A single HTML formatted page (tabl
es,
and colours) is larger than 8K which is the limit of SQL-mail, further more
I
can’t get SQL-mail to send in HTML. The reports are requested from the use
rs
PDA to be sent to the customers email. The reports are dynamically created o
n
the server and can’t be sent from the PDA (they don’t have the data)
Conclusion: Since I have to use CDO.Message I have to grant all users public
access to the master database, and then on the sp_OAxxxxx procedures, give
the users EXEC rights. What happened to the ideology “The code of a stored
procedure runs within the security context of the creator”?
"JorgenD" wrote:
> Why do some people answer a question with more questions? (no, thanks for
> your input)
> My trigger do populate data to other tables (sending work orders to PDA’
s,
> via merge replication), and when done it’s important that the users
> implicated (the ones that gets the work order) gets an mail/sms to inform
> them about it (they should react to it immediately)
> This mail shall originate form different senders, therefore not SQL-mail
> which is based on a single profile (perhaps there is a way around that tha
t I
> didn’t find)
> Another reason not to use SQL-mail is in another scenario, that I’m not
> going to explain in detail, but the mail should be HTML formatted report
> larger than 8000 bytes.
> Notification services? Hmmm, I’ll look into that, (as I don’t know wha
t that
> is)
> But to get back to my original question….. If I want to use an extended
> procedure in my own procedure, how can I set permissions so the ordinary
> mortal users can execute that?
> Regards,
> Jorgen D.
>
> "ML" wrote:
>|||You're describing a messaging and reporting system for which web services ar
e
the ideal solution. You have a central data server or a data warehouse and
several clients, that aren't capable of maintaining a 24/7 connection to HQ.
Wouldn't it be more efficient if the clients would only receive short
messages, rather than full reports? Upon the notification they could then
connect to the Report server to see the details of the arising situation and
then decide if they need to download them for off-line use.
That way you can allow access to the same data to the PDA users and to the
desktop users.
You might end up developing a messaging and reporting system using
webservices and smart clients. You could even earn $50 grand!!! :)
(http://www.csdevcompetition.com/)
Giving master database/extended procedure privileges to the Public role is a
bad idea. It is IMHO essential to use a custom role for this - with
explicitly limited privileges.
Also consider the fact that your inserts might slow down due to the needed
complexity of these triggers - that is if the conditions are met frequently.
Of course you'll need a lot of error-handling as well - you don't want to
lock up the server, do you?
ML|||Hi
Look at SQL Server Notification Services to kick of a process where you have
a .NET application send the mail via SMTP.
If you kick off an sp_OA* within a trigger, and it fails, you end up having
a rolled back transaction, possible some e-mails being sent about data that
no longer exists.
If you do not want to use NS, then in your trigger, write a row to another
table indicate that something must be done, and then have SQL Server Agent
process poll the table and send the e-mail.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"ML" wrote:

> You're describing a messaging and reporting system for which web services
are
> the ideal solution. You have a central data server or a data warehouse and
> several clients, that aren't capable of maintaining a 24/7 connection to H
Q.
> Wouldn't it be more efficient if the clients would only receive short
> messages, rather than full reports? Upon the notification they could then
> connect to the Report server to see the details of the arising situation a
nd
> then decide if they need to download them for off-line use.
> That way you can allow access to the same data to the PDA users and to the
> desktop users.
> You might end up developing a messaging and reporting system using
> webservices and smart clients. You could even earn $50 grand!!! :)
> (http://www.csdevcompetition.com/)
>
> Giving master database/extended procedure privileges to the Public role is
a
> bad idea. It is IMHO essential to use a custom role for this - with
> explicitly limited privileges.
> Also consider the fact that your inserts might slow down due to the needed
> complexity of these triggers - that is if the conditions are met frequentl
y.
> Of course you'll need a lot of error-handling as well - you don't want to
> lock up the server, do you?
>
> ML

Newbee Question

I have a table with the following fields for example:
VerifyCode1
VerifyCode2
VerifyCode3
VerifyCode4
VerifyCode5
When I run a query which links the two tables together, and say for example
a row has entries in the VerifyCode1 and VerifyCode2 fields, this row is
dropped from the query dataset.
How can I get all the rows to show if they have one entry or all five.
Thanks for the helpPossibly you require an outer join, but that's just a guess. If you need
more help please read the following article which explains how best to
specify your problem for others to understand:
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--

Newbee Question

Dear All,
What options are available for viewing the report in VB 6.0 application.
Best Regards
VJI sould think so, but not duone it myself. As it's just a cause of
calling an object.
Not sure if you'll beable to use the WebServices and SOAP side.|||You can use SOAP or the Web Service to view the report. One of the Service
Packs for SQL 2000 RS ( if I remember correctly) Also includes some controls
for viewing the reports, ( but I suspect they are DotNet versions.)
A simple thing to do might be simply to open a Windows window with IIS and
pass the URL to the report...Like you would include any web window in VB 6
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<ss> wrote in message news:usvjyWAaFHA.2756@.tk2msftngp13.phx.gbl...
> Dear All,
> What options are available for viewing the report in VB 6.0 application.
> Best Regards
> VJ

Newbee password question

Is there a way to retreive passords for SQL Server authenticated users from
a system table? I'd like to retreive the passwords for a handfull of SQL
Server users and place them in a database table (for application purposes).
I've looked for functions and stored procedures in the Books On Line, but
came up empty.
Thanks,
JoeSQL Server stores passwords using a one-way hash. Although you could
retrieve the hashed data from sysligns, the value is meaningless to your
application.
Hope this helps.
Dan Guzman
SQL Server MVP
"JRE" <nomail@.all> wrote in message
news:%232kk9yiLEHA.268@.TK2MSFTNGP10.phx.gbl...
> Is there a way to retreive passords for SQL Server authenticated users
from
> a system table? I'd like to retreive the passwords for a handfull of SQL
> Server users and place them in a database table (for application
purposes).
> I've looked for functions and stored procedures in the Books On Line, but
> came up empty.
> Thanks,
> Joe
>|||Thanks Dan,
I saw several articles describing adding or changing passwords...but not
fetching them. Oh well...I guess I'll have to think of an alternative
solution to what Im trying to do
Regards,
Joe
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:ePv63IlLEHA.1032@.tk2msftngp13.phx.gbl...
> SQL Server stores passwords using a one-way hash. Although you could
> retrieve the hashed data from sysligns, the value is meaningless to your
> application.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "JRE" <nomail@.all> wrote in message
> news:%232kk9yiLEHA.268@.TK2MSFTNGP10.phx.gbl...
> from
> purposes).
but[vbcol=seagreen]
>

Newbee needs help

Hi,
I have the following statement:
select
dbo.udfCustomerName(CustomerID)
, Count(*)
from
Orders
group by
CustomerID
If Orders table has 1 million rows, does udfCustomerName get executed 1
million times?
Or does SQL server do the grouping in CustomerID first then call udf
function?
How can I be sure? I tried to use Print @.CustomerID inside udfCustomerName,
but SQL server rejected.
TIAIt does the grouping first. You can check the query plan and see that the
function is activated in the last step.
Adi
"Raymond Du" <rdrd@.yahoo.com> wrote in message
news:%23WnqpdKdGHA.1204@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have the following statement:
> select
> dbo.udfCustomerName(CustomerID)
> , Count(*)
> from
> Orders
> group by
> CustomerID
> If Orders table has 1 million rows, does udfCustomerName get executed 1
> million times?
> Or does SQL server do the grouping in CustomerID first then call udf
> function?
> How can I be sure? I tried to use Print @.CustomerID inside
> udfCustomerName, but SQL server rejected.
> TIA
>

newbee - Where can I find sqlxmlbulkload

I want to import large XML files into my SQL 200 server. Several articles I
read all refer to the XML Bulk Load tool with references to the
msdn.microsoft.com/xml site
Here I find more articles on how to use this tool, but not the download
itsselt.
Where can I find this?It's included in SQLXML - the latest version is at
http://www.microsoft.com/downloads/...DisplayLang=en.
Cheers,
Graeme
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Nils" <Nils@.discussions.microsoft.com> wrote in message
news:25D3844C-B7E7-47FE-8A4D-644073B6E9CB@.microsoft.com...
I want to import large XML files into my SQL 200 server. Several articles I
read all refer to the XML Bulk Load tool with references to the
msdn.microsoft.com/xml site
Here I find more articles on how to use this tool, but not the download
itsselt.
Where can I find this?

newbee - Where can I find sqlxmlbulkload

I want to import large XML files into my SQL 200 server. Several articles I
read all refer to the XML Bulk Load tool with references to the
msdn.microsoft.com/xml site
Here I find more articles on how to use this tool, but not the download
itsselt.
Where can I find this?
It's included in SQLXML - the latest version is at
http://www.microsoft.com/downloads/d...isplayLang=en.
Cheers,
Graeme
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Nils" <Nils@.discussions.microsoft.com> wrote in message
news:25D3844C-B7E7-47FE-8A4D-644073B6E9CB@.microsoft.com...
I want to import large XML files into my SQL 200 server. Several articles I
read all refer to the XML Bulk Load tool with references to the
msdn.microsoft.com/xml site
Here I find more articles on how to use this tool, but not the download
itsselt.
Where can I find this?

Newbee

Hi All

just been given a project converting clipper app with Dbase files
into Windows using "CA Visual Objects"

Now my question: My objective is to keep the selling price of the app
as low as possible but I need SQL database.
MS SQL 2000 is 1st price I know but what els is available at minimal
cost. ?

Is MySql an option to look at ? and what pitfalls are there?

Gunterhttp://www.microsoft.com/sql/msde/

For what its worth my apps work with Oracle, MySQL and MSDE/SQL Server --
being able to utilize existing DB Server licensing is a big boon when it
comes to moving software.

"Gunter Dubber" <randdata@.icon.co.za> wrote in message
news:3ffda4a2.5352078@.news.tiscali.co.za...
> Hi All
> just been given a project converting clipper app with Dbase files
> into Windows using "CA Visual Objects"
> Now my question: My objective is to keep the selling price of the app
> as low as possible but I need SQL database.
> MS SQL 2000 is 1st price I know but what els is available at minimal
> cost. ?
> Is MySql an option to look at ? and what pitfalls are there?
> Gunter|||Hi

You may want to use MSDE as the database, but you will have to check the
licencing agreement to make sure you comply. This will give you the option
of upsizing to the Standard and Enterprise versions of SQL Server if
required.

You may want to check out:
http://www.microsoft.com/sql/evalua...w/default.asp#A

Also...your selling price will not be effected if you are selling into a
site that already has SQL server.

John

"Gunter Dubber" <randdata@.icon.co.za> wrote in message
news:3ffda4a2.5352078@.news.tiscali.co.za...
> Hi All
> just been given a project converting clipper app with Dbase files
> into Windows using "CA Visual Objects"
> Now my question: My objective is to keep the selling price of the app
> as low as possible but I need SQL database.
> MS SQL 2000 is 1st price I know but what els is available at minimal
> cost. ?
> Is MySql an option to look at ? and what pitfalls are there?
> Gunter