Friday, March 30, 2012
Replacing Database Template values
databases, tables, views, etc.
When I do a replace template values on this particular template all values
get replaced except for the drop database line. The strange thing is if I
replace the values and then do replace values again it works?
Any suggestions on why this is happening and what I can do to resolve it.
/ ****************************************
********************************/
/* Name : <Database_Name ,VCHAR,'SP_Create_Database'>
*/
/* Version : <Version ,VCHAR,'1.0'>
*/
/* Author : <Author ,VCHAR,'Joseph Pruiett'>
*/
/* Initials : <Author_INT ,VCHAR,'JEP'>
*/
/* Date : <Date , date ,'04/29/2005'>
*/
/* Description : <Desc , CHAR,'TEST'>
*/
/ ****************************************
********************************/
/* <Date , date ,'04/29/2005'> : <Version ,VCHAR,'1.0'>: <Author
,VCHAR,'Joseph Pruiett'>: Description <Desc , CHAR,'TEST'> */
/ ****************************************
********************************/
/ ****************************************
********************************/
/* @.d_name -- Change data value for this to the name of Database */
/ ****************************************
********************************/
--Check to see if database exist
IF EXISTS (SELECT name
FROM master..sysdatabases
WHERE name = N'<@.d_name, sysname, new_db>')
BEGIN
DROP DATABASE <@.d_name, sysname, new_db>
END
GO
--Create database
CREATE DATABASE <@.d_name, sysname, new_db>
ON PRIMARY
(
NAME = <logical_file_name_1, , new_db_file_1>,
FILENAME = N'<os_file_name_1, , c:\program files\microsoft sql
server\mssql\data\new_db.mdf>',
SIZE = 1MB,
MAXSIZE = 200MB,
FILEGROWTH = 10%
),
(
NAME = <logical_file_name_2, , new_db_file_2>,
FILENAME = N'<os_file_name_2, , c:\program files\microsoft sql
server\mssql\data\new_db.ndf>',
SIZE = 1MB,
MAXSIZE = 200MB,
FILEGROWTH = 10%
),
LOG ON
(
NAME = <logical_log_file_name_1, , new_db_log_file_1>,
FILENAME = N'<os_log_file_name_1, , c:\program files\microsoft sql
server\mssql\data\new_db_log_1.ldf>',
SIZE = 1MB,
MAXSIZE = 200MB,
FILEGROWTH = 10%
)
GOYou can try to use a decent text editor to see if there are any hidden
characters. Textpad is a good one to try.
-oj
"JosephPruiett" <JosephPruiett@.discussions.microsoft.com> wrote in message
news:0FB8C772-DA23-4856-BD31-619C118D8664@.microsoft.com...
>I have been working on creating templates to have for when creating
> databases, tables, views, etc.
> When I do a replace template values on this particular template all values
> get replaced except for the drop database line. The strange thing is if I
> replace the values and then do replace values again it works?
> Any suggestions on why this is happening and what I can do to resolve it.
> / ****************************************
********************************/
> /* Name : <Database_Name ,VCHAR,'SP_Create_Database'>
> */
> /* Version : <Version ,VCHAR,'1.0'>
> */
> /* Author : <Author ,VCHAR,'Joseph Pruiett'>
> */
> /* Initials : <Author_INT ,VCHAR,'JEP'>
> */
> /* Date : <Date , date ,'04/29/2005'>
> */
> /* Description : <Desc , CHAR,'TEST'>
> */
> / ****************************************
********************************/
> /* <Date , date ,'04/29/2005'> : <Version ,VCHAR,'1.0'>: <Author
> ,VCHAR,'Joseph Pruiett'>: Description <Desc , CHAR,'TEST'> */
> / ****************************************
********************************/
> / ****************************************
********************************/
> /* @.d_name -- Change data value for this to the name of Database */
> / ****************************************
********************************/
> --Check to see if database exist
> IF EXISTS (SELECT name
> FROM master..sysdatabases
> WHERE name = N'<@.d_name, sysname, new_db>')
> BEGIN
> DROP DATABASE <@.d_name, sysname, new_db>
> END
> GO
> --Create database
> CREATE DATABASE <@.d_name, sysname, new_db>
> ON PRIMARY
> (
> NAME = <logical_file_name_1, , new_db_file_1>,
> FILENAME = N'<os_file_name_1, , c:\program files\microsoft sql
> server\mssql\data\new_db.mdf>',
> SIZE = 1MB,
> MAXSIZE = 200MB,
> FILEGROWTH = 10%
> ),
> (
> NAME = <logical_file_name_2, , new_db_file_2>,
> FILENAME = N'<os_file_name_2, , c:\program files\microsoft sql
> server\mssql\data\new_db.ndf>',
> SIZE = 1MB,
> MAXSIZE = 200MB,
> FILEGROWTH = 10%
> ),
> LOG ON
> (
> NAME = <logical_log_file_name_1, , new_db_log_file_1>,
> FILENAME = N'<os_log_file_name_1, , c:\program files\microsoft sql
> server\mssql\data\new_db_log_1.ldf>',
> SIZE = 1MB,
> MAXSIZE = 200MB,
> FILEGROWTH = 10%
> )
> GO
>
Wednesday, March 28, 2012
ReplaceSelectionFormula not working at all?
I will attached a TXT file of the code that calls the report, and the RPT file itself.
The behavior is the same for all 10 or so reports in the app???
Please help. thanks!i m using the the syntax ...
rpt.ReplaceSelectionFormula = "{tbl.field} = id" ...
and its working fine try this ...
hope this will work .. u missed equal to singn (=) before passing 'w' string to replaceSelectionFormula .. this may be error ...
..
mdiMain.CrystalReport1.ReportTitle = sl_short
mdiMain.CrystalReport1.ReplaceSelectionFormula w
************** w is usually equal to something like "{V_SCORE_BY_YEARMONTH.ResponseYear}=2007" *************
..|||When i use the symtax you recommened:
mdiMain.CrystalReport1.ReplaceSelectionFormula = w
I get an "Argument not optional" error.
It is working for me without the "=" is several other applications.
Monday, March 26, 2012
Replace zeros and nulls with 1 in table -- Using case, but not working
I'm doing calculations based on data in a table, but the data has some
zeros in the field I'm dividing by. I'm trying to write a script to
replace any field with 0 or null with 1, but it's not working. HEre's
what I've got:
Update A Set A.deptcode = A.deptcode,
A.type = A.Type,
A.Volume = (case A.Volume
When Null Then 1
When 0 then 1
Else A.Volume
End)
From Data_Unsorted A Join Data_Unsorted B On
A.deptcode = B.deptcode and A.type = B.Type
My table is data_unsorted and deptcode and type are my primary keys
Volume is the item I want to put 1 if null or zero, and I'd thing the
above statement would work, but it doesn't. This table has 383 rows,
and it says it updates 383 rows, but when I run the following query to
test:
select a.deptcode, a.type, a.volume
from data_unsorted a
where a.AveMonthVolume = 0 or a.AveMonthVOlume is null
It didn't work... still TONS of nulls and zero's. Is there a trick to
this?
Thanks,
Alex.Alex,
Try this:
update YourTable
set Col = 1
where Col = 0 or Col is null
Shervin
"Alex" <alex@.totallynerd.com> wrote in message
news:2ba4b4eb.0310091122.fc83cd5@.posting.google.co m...
> Hi folks,
> I'm doing calculations based on data in a table, but the data has some
> zeros in the field I'm dividing by. I'm trying to write a script to
> replace any field with 0 or null with 1, but it's not working. HEre's
> what I've got:
> Update A Set A.deptcode = A.deptcode,
> A.type = A.Type,
> A.Volume = (case A.Volume
> When Null Then 1
> When 0 then 1
> Else A.Volume
> End)
> From Data_Unsorted A Join Data_Unsorted B On
> A.deptcode = B.deptcode and A.type = B.Type
> My table is data_unsorted and deptcode and type are my primary keys
> Volume is the item I want to put 1 if null or zero, and I'd thing the
> above statement would work, but it doesn't. This table has 383 rows,
> and it says it updates 383 rows, but when I run the following query to
> test:
> select a.deptcode, a.type, a.volume
> from data_unsorted a
> where a.AveMonthVolume = 0 or a.AveMonthVOlume is null
> It didn't work... still TONS of nulls and zero's. Is there a trick to
> this?
> Thanks,
> Alex.|||Alex (alex@.totallynerd.com) writes:
> Update A Set A.deptcode = A.deptcode,
> A.type = A.Type,
> A.Volume = (case A.Volume
> When Null Then 1
> When 0 then 1
> Else A.Volume
> End)
> From Data_Unsorted A Join Data_Unsorted B On
> A.deptcode = B.deptcode and A.type = B.Type
You compare A.Volume to NULL, but NULL is never equal to NULL or
anything else. Write the CASE expresssion as.
CASE WHEN volume IS NULL THEN 1
WHEN volume = 0 THEN 1
ELSE volume
END
or
CASE coalesce(volume, 0) WHEN 0 THEN 1 ELSE volume END
The coalesce function returns the first non-NULL value in the list.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Friday, March 23, 2012
replace missing data
I am working with a database containing time series data. In many, cases there is missing data. For example, while there might be a value for 2001-01-01T23:00:00, there is none for 2001-01-01T23:0100 (one minute later). I would like to replace the missing data with data from the previous record (if the previous record is the same date). Is that possible with T-SQL?
Sure,
UPDATE SomeTable
FROM SomeTable ST
SET SomeColumnWhereDataisMissing =
(
Select TOP (1) SomeColumn From SomeTable ST2
WHERE ST2.TimeColumn < ST.TimeColumn
)
WHERE SomeColumnWhereDataisMissing IS NULL --Or whatever means that there is no data.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
Missing means there is no record for a specific datetime value. There is no null because the record does not exist.
|||
It sounds like you're looking for a list of missing dates. You can use an auxiliary numbers table to generate a list of dates and perform an OUTER JOIN against the table in question.
The following sample uses a table with one entry for each minute in a day. To me, it seems best to loop through this table on a daily basis rather than to create a date-only table that would be specific to your problem.
-- Create numbers table. You want this as a permanent table but I'm generating on-the-fly for this example.
DECLARE @.Nums TABLE (Val INT)
;WITH Numbers(n)
AS
(
SELECT 1 AS n
UNION ALL
SELECT (n + 1) AS n
FROM Numbers
WHERE
n < 1440 -- Minutes in a day
)
INSERT INTO @.Nums (Val)
SELECT n from Numbers
OPTION(MAXRECURSION 1440)
-- Create sample data
DECLARE @.Dates TABLE (PKey INT IDENTITY PRIMARY KEY, MyDate DATETIME)
INSERT INTO @.Dates (MyDate)
SELECT '2006-08-21 13:21:00'
UNION
SELECT '2006-08-21 13:22:00'
UNION
SELECT '2006-08-21 13:23:00'
UNION
SELECT '2006-08-21 13:25:00'
UNION
SELECT '2006-08-21 13:26:00'
UNION
SELECT '2006-08-21 13:30:00'
-
-- Find missing ranges.
-
DECLARE @.MinMinute INT
DECLARE @.MaxMinute INT
DECLARE @.CheckDate DATETIME -- This is the day that we're checking
SET @.CheckDate = '2006-08-21'
-- First and last time for the day of @.CheckDate
SELECT @.MinMinute = DATEDIFF(minute, @.CheckDate, MIN(MyDate)),
@.MaxMinute = DATEDIFF(minute, @.CheckDate, MAX(MyDate))
FROM @.Dates
WHERE MyDate BETWEEN @.CheckDate AND DATEADD(Day, 1, @.CheckDate)
-- Find all missing minutes in the sequence
SELECT DATEADD(minute, n.Val, @.CheckDate) AS MissingMinute, 'Missing' AS Status
FROM @.Nums n
LEFT JOIN @.Dates d ON DATEADD(minute, n.Val, @.CheckDate) = d.MyDate
WHERE n.Val BETWEEN @.MinMinute AND @.MaxMinute
and d.MyDate IS NULL
UNION ALL
SELECT MyDate, 'Exists' AS Status
FROM @.Dates
ORDER BY MissingMinute
Thanks to the following sources for information regarding auxiliary numbers tables
http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-numbers-table.html
http://codeinet.blogspot.com/2006/06/sql-numbers-table-using-common-table.html
|||Slight edit - the previous code to generate an auxiliary numbers table will only work on SQL Server 2005. Use the following for SQL 2000:
CREATE TABLE dbo.Numbers
(
Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
)
WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1440
BEGIN
INSERT dbo.Numbers DEFAULT VALUES
END
Wednesday, March 21, 2012
REPLACE Integers with Text Data
I am working with a database named “Documents” that contains 4 categories of text documents, each having its own number designation in an integer datatype column named SectionTypeId:
1 = Text
2 = Report
3 = Background
4 = Index
I would like to create a new column named “DocType” in which the integer data type for each document is replaced with a varchar data type letter (1 = T, 2 = R, 3 = B, 4 = I).I was able to easily create the new column and cast the data type from integer to varchar:
--CREATE NEW COLUMN “DocType” WITH VARCHAR DATATYPE
ALTER TABLE FullDocuments ADD DocType VARCHAR(1) NULL
Go
--UPDATE NEW COLUMN WITH CAST STRING
UPDATE FullDocuments SET DocType = CAST(SectionTypeID AS VARCHAR(1))
Go
But I have problems with the REPLACE method for replacing the numbers with letters.First I tried this based on the examples in MSDN Library:
--REPLACE NUMBERS WITH LETTERS
UPDATE Fulldocuments REPLACE (DocType,"1","T")
Which produced an error message: “Incorrect syntax near 'REPLACE'.”
Thinking that the datatype may be the problem, I tried this to convert to DT_WSTR data type prior to replace:
UPDATE Fulldocuments REPLACE ((DT_WSTR,1)DocType,"1","T")
Which produced the same error message: “Incorrect syntax near 'REPLACE'.”
I have never done a REPLACE before, so any suggestions for accomplishing this would be appreciated.
Your UPDATE statement syntax is incorrect. And the 2nd syntax where you are trying to cast to DT_WSTR is not a valid SQL syntax also. See SQL Server Books Online for the complete UPDATE statement syntax and examples. UPDATE statement consists of SET, FROM and WHERE clauses. You are missing the SET clause. And you should use single-quotes preferably for string literals otherwise you will get errors most of the time depending on your SET options. Modify your update statement to:
UPDATE Fulldocuments SET DocType = REPLACE (DocType,'1','T')
But it doesn't seem like you want to create this DocType column in the first place. You should create a separate lookup table that contains the ids and description or type. You can then join with that table based on your ID value to get the description. This is much more flexible approach that doing it your way.
|||Thanks for correcting my syntax and the advice about creating a separate lookup table.Replace function not working
I posted a request here and am still working on it when I landed on this bug.
select top 10 replace(comma_separated_string,',','giveaverylongp assagehere') from table
The function works fine if the comma separated string is small or if the passage is small. It fails for long passages..
Is this a mssql bug?What's long? Replace works fine for me on 8000. Does it break off at 1024 in the Analyzer, while it's len(..) says otherwise?sql
Tuesday, March 20, 2012
RepeatWith not working
I have listing with a few rectangles and one table in it.
One two recetangles at top of page I have set the RepeatWith to be set to
name of the table (table1).
When the table spans multiple pages, I would expect that the two rectangles
would be repeated at the top of the page.
This does not work. The RepeatWith property appears to have no effect.
Is there is good work-around or fix for this?
What I am trying to accomplish is having a few header values and a logo
repeated on all pages.
Thanks,
KevinI'm not sure how to use RepeatWith, but have you tried using a page
header? In the report designer, go to the Report menu, select Page
Header. Then put your logo etc in the page header area.
Eva Pierce Monsen
Kevin VanRiper wrote:
> Hi,
> I have listing with a few rectangles and one table in it.
> One two recetangles at top of page I have set the RepeatWith to be set to
> name of the table (table1).
> When the table spans multiple pages, I would expect that the two rectangles
> would be repeated at the top of the page.
> This does not work. The RepeatWith property appears to have no effect.
> Is there is good work-around or fix for this?
> What I am trying to accomplish is having a few header values and a logo
> repeated on all pages.
> Thanks,
> Kevin|||I tried Page Header but this does not allow values from my dataset to be
placed there.
I found on a MS blog a work-around to use a Report Parameter to be able to
place dataset value into Page Header but this did not update to correct /
current value of the listing but remained with the value of the first
record.
"Eva Pierce Monsen" <eva.monsen@.gmail.com> wrote in message
news:1150921305.672198.191490@.i40g2000cwc.googlegroups.com...
> I'm not sure how to use RepeatWith, but have you tried using a page
> header? In the report designer, go to the Report menu, select Page
> Header. Then put your logo etc in the page header area.
> Eva Pierce Monsen
> Kevin VanRiper wrote:
>> Hi,
>> I have listing with a few rectangles and one table in it.
>> One two recetangles at top of page I have set the RepeatWith to be set to
>> name of the table (table1).
>> When the table spans multiple pages, I would expect that the two
>> rectangles
>> would be repeated at the top of the page.
>> This does not work. The RepeatWith property appears to have no effect.
>> Is there is good work-around or fix for this?
>> What I am trying to accomplish is having a few header values and a logo
>> repeated on all pages.
>> Thanks,
>> Kevin
>
RepeatOnNewPage
that I want repeated on each page. It doesn't seem to be working. it
displays on the first page and that's it... Any ideas...?
TIA,
DanWhich property have you set to true..'
there is a 'RepeatOnNewPage' property which will set for the whole page
header. you don't really set them one by one. you can click this on the most
left of your header row. one thing to indicate that you are clicking the
right thing is that, it will select the whole row, and show the
RepeatOnNewPage property.
"alien2_51" <dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion> wrote
in message news:O8Xo6gjfEHA.632@.TK2MSFTNGP12.phx.gbl...
> I have this property set to true for several table header rows in a table
> that I want repeated on each page. It doesn't seem to be working. it
> displays on the first page and that's it... Any ideas...?
> TIA,
> Dan
>|||The property name is RepeatOnNewPage, I have it set to true and it's not
repeating, displays only on the first page...
Dan
"Daniel" <danielk@.adstream.com.au> wrote in message
news:OJ8Pg7ofEHA.2896@.TK2MSFTNGP11.phx.gbl...
> Which property have you set to true..'
> there is a 'RepeatOnNewPage' property which will set for the whole page
> header. you don't really set them one by one. you can click this on the
most
> left of your header row. one thing to indicate that you are clicking the
> right thing is that, it will select the whole row, and show the
> RepeatOnNewPage property.
>
> "alien2_51" <dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion>
wrote
> in message news:O8Xo6gjfEHA.632@.TK2MSFTNGP12.phx.gbl...
> > I have this property set to true for several table header rows in a
table
> > that I want repeated on each page. It doesn't seem to be working. it
> > displays on the first page and that's it... Any ideas...?
> >
> > TIA,
> >
> > Dan
> >
> >
>|||Does that table only have items on the first page? If so that is your
problem. What it really should say is repeat on every page which has
items in this table.
"alien2_51" <dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion> wrote in message news:<evwuUEvfEHA.592@.TK2MSFTNGP11.phx.gbl>...
> The property name is RepeatOnNewPage, I have it set to true and it's not
> repeating, displays only on the first page...
> Dan
>
> "Daniel" <danielk@.adstream.com.au> wrote in message
> news:OJ8Pg7ofEHA.2896@.TK2MSFTNGP11.phx.gbl...
> > Which property have you set to true..'
> > there is a 'RepeatOnNewPage' property which will set for the whole page
> > header. you don't really set them one by one. you can click this on the
> most
> > left of your header row. one thing to indicate that you are clicking the
> > right thing is that, it will select the whole row, and show the
> > RepeatOnNewPage property.
> >
> >
> >
> > "alien2_51" <dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion>
> wrote
> > in message news:O8Xo6gjfEHA.632@.TK2MSFTNGP12.phx.gbl...
> > > I have this property set to true for several table header rows in a
> table
> > > that I want repeated on each page. It doesn't seem to be working. it
> > > displays on the first page and that's it... Any ideas...?
> > >
> > > TIA,
> > >
> > > Dan
> > >
> > >
> >
> >
Monday, March 12, 2012
Repeating headers on subreports
table. I pass in the appropriate parameters and everything is working well
with the subreports in terms of the data. I have created a group header for
the subreports and turned on the repeat on new page option. This is the area
that is causing me grief. The group header shows up on the first page fine,
but if the subreport spills over to another page, the group header is not
repeated. Is this because The subreport technically only occupies one row of
the table?I would suspect that is the case, since you wouldn't normally expect a
single table row to span multiple pages...
--
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
"Clark Kent" <ClarkKent@.discussions.microsoft.com> wrote in message
news:BFDFA52D-315E-448A-A30D-44FD18B3EB96@.microsoft.com...
>I have three subreports that are sitting in the detail section of a grouped
> table. I pass in the appropriate parameters and everything is working well
> with the subreports in terms of the data. I have created a group header
> for
> the subreports and turned on the repeat on new page option. This is the
> area
> that is causing me grief. The group header shows up on the first page
> fine,
> but if the subreport spills over to another page, the group header is not
> repeated. Is this because The subreport technically only occupies one row
> of
> the table?
Wednesday, March 7, 2012
Repair Master db
bigger issue. Of course, I was not smart enough to backup the db before
touching it...
I have a new instance of SQL Server 2000 running on a Windows 2003 machine.
I ran into some issues with logins and, following instructions from an
article I found, I was trying to delete a single row from the
master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
statement and ended up deleting everything in that table. Now I can't
connect at all.
Is there any solution besides reinstalling SQL Server?
Thank You,
Jason Williard
Read up on rebuildm.exe in Books Online.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jason Williard" <jason@.pcsafe.net> wrote in message news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com...
> Today, while working on repairing another issue, I managed to cause an even bigger issue. Of
> course, I was not smart enough to backup the db before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003 machine. I ran into some issues
> with logins and, following instructions from an article I found, I was trying to delete a single
> row from the master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the statement
> and ended up deleting everything in that table. Now I can't connect at all.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>
|||You can run Rebuildm.exe in the \80\tools\binn to rebuild master database.
-oj
"Jason Williard" <jason@.pcsafe.net> wrote in message
news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com...
> Today, while working on repairing another issue, I managed to cause an
> even bigger issue. Of course, I was not smart enough to backup the db
> before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003
> machine. I ran into some issues with logins and, following instructions
> from an article I found, I was trying to delete a single row from the
> master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
> statement and ended up deleting everything in that table. Now I can't
> connect at all.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>
Repair Master db
bigger issue. Of course, I was not smart enough to backup the db before
touching it...
I have a new instance of SQL Server 2000 running on a Windows 2003 machine.
I ran into some issues with logins and, following instructions from an
article I found, I was trying to delete a single row from the
master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
statement and ended up deleting everything in that table. Now I can't
connect at all.
Is there any solution besides reinstalling SQL Server?
Thank You,
Jason WilliardRead up on rebuildm.exe in Books Online.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jason Williard" <jason@.pcsafe.net> wrote in message news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com...
> Today, while working on repairing another issue, I managed to cause an even bigger issue. Of
> course, I was not smart enough to backup the db before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003 machine. I ran into some issues
> with logins and, following instructions from an article I found, I was trying to delete a single
> row from the master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the statement
> and ended up deleting everything in that table. Now I can't connect at all.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>|||You can run Rebuildm.exe in the \80\tools\binn to rebuild master database.
--
-oj
"Jason Williard" <jason@.pcsafe.net> wrote in message
news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com...
> Today, while working on repairing another issue, I managed to cause an
> even bigger issue. Of course, I was not smart enough to backup the db
> before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003
> machine. I ran into some issues with logins and, following instructions
> from an article I found, I was trying to delete a single row from the
> master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
> statement and ended up deleting everything in that table. Now I can't
> connect at all.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>
Repair Master db
bigger issue. Of course, I was not smart enough to backup the db before
touching it...
I have a new instance of SQL Server 2000 running on a Windows 2003 machine.
I ran into some issues with logins and, following instructions from an
article I found, I was trying to delete a single row from the
master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
statement and ended up deleting everything in that table. Now I can't
connect at all.
Is there any solution besides reinstalling SQL Server?
Thank You,
Jason WilliardRead up on rebuildm.exe in Books Online.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jason Williard" <jason@.pcsafe.net> wrote in message news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com
..
> Today, while working on repairing another issue, I managed to cause an eve
n bigger issue. Of
> course, I was not smart enough to backup the db before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003 machine
. I ran into some issues
> with logins and, following instructions from an article I found, I was try
ing to delete a single
> row from the master.sysxlogins table. Well, I failed to add "WHERE name =
''" to the statement
> and ended up deleting everything in that table. Now I can't connect at al
l.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>|||You can run Rebuildm.exe in the \80\tools\binn to rebuild master database.
-oj
"Jason Williard" <jason@.pcsafe.net> wrote in message
news:6KKdnVSBcNmIjLnfRVn-tA@.comcast.com...
> Today, while working on repairing another issue, I managed to cause an
> even bigger issue. Of course, I was not smart enough to backup the db
> before touching it...
> I have a new instance of SQL Server 2000 running on a Windows 2003
> machine. I ran into some issues with logins and, following instructions
> from an article I found, I was trying to delete a single row from the
> master.sysxlogins table. Well, I failed to add "WHERE name = ''" to the
> statement and ended up deleting everything in that table. Now I can't
> connect at all.
> Is there any solution besides reinstalling SQL Server?
> Thank You,
> Jason Williard
>