Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Friday, March 30, 2012

Renaming A Server

I have created a Database Instance. However the Server Instance is now
called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
to be called RMUK7. Is there any way of renaming this as it could prove
problematic with our installed Apps.
Thanks in advance
Mark
You cannot rename an instance. You can install a new instance with desired name and move over the
data. Or you can specify a client alias (specify version and where client app is executed for
details).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"MarkS" <MarkS@.discussions.microsoft.com> wrote in message
news:A2D7F5E7-20D6-4416-A070-D90E7A76BC98@.microsoft.com...
>I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark
|||Hi
"MarkS" wrote:

> I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark
It sounds like you are wanting to install a default instance on the server?
Does a defauilt instance exist? This will have the same name as the server or
(local) or . If you are using SQL Express you can only install a named
instance!
John
sql

Wednesday, March 28, 2012

Renaming A Server

I have created a Database Instance. However the Server Instance is now
called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
to be called RMUK7. Is there any way of renaming this as it could prove
problematic with our installed Apps.
Thanks in advance
MarkYou cannot rename an instance. You can install a new instance with desired name and move over the
data. Or you can specify a client alias (specify version and where client app is executed for
details).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"MarkS" <MarkS@.discussions.microsoft.com> wrote in message
news:A2D7F5E7-20D6-4416-A070-D90E7A76BC98@.microsoft.com...
>I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark|||Hi
"MarkS" wrote:
> I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Instance
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark
It sounds like you are wanting to install a default instance on the server?
Does a defauilt instance exist? This will have the same name as the server or
(local) or . If you are using SQL Express you can only install a named
instance!
John

Renaming A Server

I have created a Database Instance. However the Server Instance is now
called RMUK7\RMUK7. I would ideally like this Server Registration \ Instanc
e
to be called RMUK7. Is there any way of renaming this as it could prove
problematic with our installed Apps.
Thanks in advance
MarkYou cannot rename an instance. You can install a new instance with desired n
ame and move over the
data. Or you can specify a client alias (specify version and where client ap
p is executed for
details).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"MarkS" <MarkS@.discussions.microsoft.com> wrote in message
news:A2D7F5E7-20D6-4416-A070-D90E7A76BC98@.microsoft.com...
>I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Insta
nce
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark|||Hi
"MarkS" wrote:

> I have created a Database Instance. However the Server Instance is now
> called RMUK7\RMUK7. I would ideally like this Server Registration \ Insta
nce
> to be called RMUK7. Is there any way of renaming this as it could prove
> problematic with our installed Apps.
> Thanks in advance
> Mark
It sounds like you are wanting to install a default instance on the server?
Does a defauilt instance exist? This will have the same name as the server o
r
(local) or . If you are using SQL Express you can only install a named
instance!
John

Renaming a DTS package

I would like to rename a DTS package I've created, but I can't seem to find a way to do so.
Is there a table that contains all the packages with there properties somewhere? Thanks for the replyOriginally posted by WhiZa
I would like to rename a DTS package I've created, but I can't seem to find a way to do so.

Is there a table that contains all the packages with there properties somewhere? Thanks for the reply

Hello WhiZa.

Open that DTS package and save it as another DTS name. Then delete the original DTS package if you do not wish to keep it.

Best regards
Teck Boon

Monday, March 26, 2012

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.|||To add to Jj's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.
you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.
|||To add to Jj's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Rename MDF file

Is there a way to rename the mdf and ldf files associated with a databse.
Also can I rename the fil nemae that is created for these when the databse
gets created.you can detach the database
rename the files
attach the database by specifying the new file names
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.|||To add to Jéjé's response, you can rename logical file names with ALTER
DATABASE. For example:
ALTER DATABASE MyDatabase
MODIFY FILE(
NAME='MyOldLogicalName',
NEWNAME='MyNewLogicalName')
See the Books online for more information.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:25A21625-0C18-465F-ADCF-D0AB6B66F002@.microsoft.com...
> Is there a way to rename the mdf and ldf files associated with a databse.
> Also can I rename the fil nemae that is created for these when the databse
> gets created.

Friday, March 23, 2012

Rename File

I have a text file (*.txt) created from a DTS Package. I need to change the
file name after it is created to add the current timestamp in the file name
(i.e. date and time).
Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt
'
Is there a way I can do this ?. T-SQL syntax from DTS package ?
Thanks for any help.You can do it before creating it.
How can I change the filename for a text file connection?
http://www.sqldts.com/default.aspx?200
AMB
"DXC" wrote:

> I have a text file (*.txt) created from a DTS Package. I need to change th
e
> file name after it is created to add the current timestamp in the file nam
e
> (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.t
xt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.|||Thanks for the info but I am not a VB or ActixeX expert. Any idea on the
usage of the script '
Thanks.
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> You can do it before creating it.
> How can I change the filename for a text file connection?
> http://www.sqldts.com/default.aspx?200
>
> AMB
> "DXC" wrote:
>|||you might be able to use xp_cmdshell and pass in the rename of the file just
like you would from dos.
so you already know the path the the file and the name of the file. you just
need to create a varchar with the correct formatted date/time in the name
and pass the entire rename/move command to xp_cmdshell just like from dos.
that's really about the easiest way to do this imo.
DXC wrote:

> I have a text file (*.txt) created from a DTS Package. I need to change
> the file name after it is created to add the current timestamp in the file
> name (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it
> 'Myfile0506051022.txt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.
new|||Thanks. I am already using something like this:
declare @.rename varchar(255)
select @.rename =
'ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '.BAK'
exec master..xp_cmdshell @.rename
to get rid of the timestamp but I don't know how to include the timestamp in
an existin file. I tried something like this but it did not work:
declare @.rename varchar(255)
declare @.filename datetime
Set @.filename = (LEFT(GETDATE(), 12) )
select @.rename =
'ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '@.filename'
+ '.BAK'
exec master..xp_cmdshell @.rename
Thanks..........
"beginthreadex" wrote:

> you might be able to use xp_cmdshell and pass in the rename of the file ju
st
> like you would from dos.
> so you already know the path the the file and the name of the file. you ju
st
> need to create a varchar with the correct formatted date/time in the name
> and pass the entire rename/move command to xp_cmdshell just like from dos.
> that's really about the easiest way to do this imo.
>
> DXC wrote:
>
> --
> new
>|||'***************************************
*******************************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'***************************************
*********************************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc = "\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf = fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMM
DDHHMMSS
'Sub Comment(af)
' Dim tsa
' Const ForAppending = 8
' set tsa=saf.OpenAsTextStream(ForAppending)
' tsa.writeline cstr(systime)
' tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(syst
ime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & c
str(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)|||'***************************************
*******************************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'***************************************
*********************************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc = "\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf = fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMM
DDHHMMSS
'Sub Comment(af)
' Dim tsa
' Const ForAppending = 8
' set tsa=saf.OpenAsTextStream(ForAppending)
' tsa.writeline cstr(systime)
' tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(syst
ime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & c
str(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)

Rename File

I have a text file (*.txt) created from a DTS Package. I need to change the
file name after it is created to add the current timestamp in the file name
(i.e. date and time).
Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt'
Is there a way I can do this ?. T-SQL syntax from DTS package ?
Thanks for any help.
You can do it before creating it.
How can I change the filename for a text file connection?
http://www.sqldts.com/default.aspx?200
AMB
"DXC" wrote:

> I have a text file (*.txt) created from a DTS Package. I need to change the
> file name after it is created to add the current timestamp in the file name
> (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.
|||Thanks for the info but I am not a VB or ActixeX expert. Any idea on the
usage of the script ?
Thanks.
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> You can do it before creating it.
> How can I change the filename for a text file connection?
> http://www.sqldts.com/default.aspx?200
>
> AMB
> "DXC" wrote:
|||you might be able to use xp_cmdshell and pass in the rename of the file just
like you would from dos.
so you already know the path the the file and the name of the file. you just
need to create a varchar with the correct formatted date/time in the name
and pass the entire rename/move command to xp_cmdshell just like from dos.
that's really about the easiest way to do this imo.
DXC wrote:

> I have a text file (*.txt) created from a DTS Package. I need to change
> the file name after it is created to add the current timestamp in the file
> name (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it
> 'Myfile0506051022.txt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.
new
|||Thanks. I am already using something like this:
declare @.rename varchar(255)
select @.rename =
'ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '.BAK'
exec master..xp_cmdshell @.rename
to get rid of the timestamp but I don't know how to include the timestamp in
an existin file. I tried something like this but it did not work:
declare @.rename varchar(255)
declare @.filename datetime
Set @.filename = (LEFT(GETDATE(), 12) )
select @.rename =
'ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '@.filename'
+ '.BAK'
exec master..xp_cmdshell @.rename
Thanks..........
"beginthreadex" wrote:

> you might be able to use xp_cmdshell and pass in the rename of the file just
> like you would from dos.
> so you already know the path the the file and the name of the file. you just
> need to create a varchar with the correct formatted date/time in the name
> and pass the entire rename/move command to xp_cmdshell just like from dos.
> that's really about the easiest way to do this imo.
>
> DXC wrote:
>
> --
> new
>
|||'************************************************* *********************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'************************************************* ***********************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc="\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf=fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMMDDHHMMSS
'Sub Comment(af)
'Dim tsa
'Const ForAppending = 8
'set tsa=saf.OpenAsTextStream(ForAppending)
'tsa.writeline cstr(systime)
'tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(systime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & cstr(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)
|||'************************************************* *********************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'************************************************* ***********************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc="\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf=fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMMDDHHMMSS
'Sub Comment(af)
'Dim tsa
'Const ForAppending = 8
'set tsa=saf.OpenAsTextStream(ForAppending)
'tsa.writeline cstr(systime)
'tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(systime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & cstr(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)

Rename File

I have a text file (*.txt) created from a DTS Package. I need to change the
file name after it is created to add the current timestamp in the file name
(i.e. date and time).
Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt'
Is there a way I can do this ?. T-SQL syntax from DTS package ?
Thanks for any help.You can do it before creating it.
How can I change the filename for a text file connection?
http://www.sqldts.com/default.aspx?200
AMB
"DXC" wrote:
> I have a text file (*.txt) created from a DTS Package. I need to change the
> file name after it is created to add the current timestamp in the file name
> (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.|||Thanks for the info but I am not a VB or ActixeX expert. Any idea on the
usage of the script '
Thanks.
"Alejandro Mesa" wrote:
> You can do it before creating it.
> How can I change the filename for a text file connection?
> http://www.sqldts.com/default.aspx?200
>
> AMB
> "DXC" wrote:
> > I have a text file (*.txt) created from a DTS Package. I need to change the
> > file name after it is created to add the current timestamp in the file name
> > (i.e. date and time).
> > Ex: The filename is 'Myfile.txt' and I need to make it 'Myfile0506051022.txt'
> >
> > Is there a way I can do this ?. T-SQL syntax from DTS package ?
> >
> > Thanks for any help.|||you might be able to use xp_cmdshell and pass in the rename of the file just
like you would from dos.
so you already know the path the the file and the name of the file. you just
need to create a varchar with the correct formatted date/time in the name
and pass the entire rename/move command to xp_cmdshell just like from dos.
that's really about the easiest way to do this imo.
DXC wrote:
> I have a text file (*.txt) created from a DTS Package. I need to change
> the file name after it is created to add the current timestamp in the file
> name (i.e. date and time).
> Ex: The filename is 'Myfile.txt' and I need to make it
> 'Myfile0506051022.txt'
> Is there a way I can do this ?. T-SQL syntax from DTS package ?
> Thanks for any help.
--
new|||Thanks. I am already using something like this:
declare @.rename varchar(255)
select @.rename ='ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '.BAK'
exec master..xp_cmdshell @.rename
to get rid of the timestamp but I don't know how to include the timestamp in
an existin file. I tried something like this but it did not work:
declare @.rename varchar(255)
declare @.filename datetime
Set @.filename = (LEFT(GETDATE(), 12) )
select @.rename ='ren "\\172.22.16.12\D$\Program Files\Microsoft SQL
Server\MSSQL\Backup\MYDB1\MYDB1*.BAK" '
+ 'MYDB1'
+ '@.filename'
+ '.BAK'
exec master..xp_cmdshell @.rename
Thanks..........
"beginthreadex" wrote:
> you might be able to use xp_cmdshell and pass in the rename of the file just
> like you would from dos.
> so you already know the path the the file and the name of the file. you just
> need to create a varchar with the correct formatted date/time in the name
> and pass the entire rename/move command to xp_cmdshell just like from dos.
> that's really about the easiest way to do this imo.
>
> DXC wrote:
> > I have a text file (*.txt) created from a DTS Package. I need to change
> > the file name after it is created to add the current timestamp in the file
> > name (i.e. date and time).
> > Ex: The filename is 'Myfile.txt' and I need to make it
> > 'Myfile0506051022.txt'
> >
> > Is there a way I can do this ?. T-SQL syntax from DTS package ?
> >
> > Thanks for any help.
> --
> new
>|||'**********************************************************************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'************************************************************************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc = "\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf = fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMMDDHHMMSS
'Sub Comment(af)
' Dim tsa
' Const ForAppending = 8
' set tsa=saf.OpenAsTextStream(ForAppending)
' tsa.writeline cstr(systime)
' tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(systime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & cstr(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)|||'**********************************************************************
' Visual Basic ActiveX Script
' Author: Keith Kosmicki
' Date 10 May 2005
' Purpose: Change file name after its been exported to Date Time Stamp
'************************************************************************
Function Main()
Main = DTSTaskExecResult_Success
End Function
Dim StrAccessSrc, StrNew, fso, sf, systime
StrAccessSrc = "\\Web1\ftp\Prime Vendor\test1"
Set fso = CreateObject("Scripting.FileSystemObject")
set saf = fso.GetFile(StrAccessSrc)
systime=now()
'Call Comment(ssf) 'ADD A TIMESTAMP AT THE END OF THE FILE SPECIFIED
Call RenameSFile(saf) 'RENAME THE SOURCE FILE WITH THE DATE FORMAT OF YYYYMMDDHHMMSS
'Sub Comment(af)
' Dim tsa
' Const ForAppending = 8
' set tsa=saf.OpenAsTextStream(ForAppending)
' tsa.writeline cstr(systime)
' tsa.close
'End Sub
Sub RenameSFile(sf)
StrNew=sf.ParentFolder &"\Customer-" & cstr(year(systime)) & cstr(month(systime)) & cstr(day(systime)) & cstr(hour(systime)) & cstr(minute(systime)) & cstr(second(systime))
sf.move StrNew
End Sub
Best,
Kos
User submitted from AEWNET (http://www.aewnet.com/)sql

Wednesday, March 21, 2012

Rename a server

Hi I am running MSSQL2000 and recently installed the server software and
created a server. Just wondering if anyone knows how to change the server
name?
I did a google search and found that after the server is renamed one should
open Query analyzer and use sp_dropserver and sp_addserver
thanks.
Paul G
Software engineer.Paul wrote:
> Hi I am running MSSQL2000 and recently installed the server software
> and created a server. Just wondering if anyone knows how to change
> the server name?
> I did a google search and found that after the server is renamed one
> should open Query analyzer and use sp_dropserver and sp_addserver
> thanks.
> Paul G
> Software engineer.
See "Renaming a Server" in BOL.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||http://www.karaszi.com/SQLServer/info_change_server_name.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:2865418F-08B0-4BA2-BFCB-4295BD73115D@.microsoft.com...
> Hi I am running MSSQL2000 and recently installed the server software and
> created a server. Just wondering if anyone knows how to change the server
> name?
> I did a google search and found that after the server is renamed one should
> open Query analyzer and use sp_dropserver and sp_addserver
> thanks.
> Paul G
> Software engineer.

Tuesday, March 20, 2012

Removing White Space

I have created a report with a drill down button for each unique record. However, when the nodes are not expanded (the default), the report displays with large amounts of white space (varying according to how much space is required once the node is fully expanded). Is there any way to remove this whitespace? Thanks in advance.

I've seen this before where I explicitly set the group header for the inner group to be invisible, but i accidentally left the footer visible. Got the exact same symptom.

Hope that's useful.

|||

I tried this but unfortunately it didn't work - all my group headings are set to invisible... (when i initially load the report, I only view the resource names, no other information - indicating that they are set to invisible)

|||You need to make sure you are hiding the groups, not the individual rows inside the group. Edit the group properties and set the visibility there.

Monday, March 12, 2012

Removing Replication Triggers.

Does anyone know how to remove 'Replication Triggers'?

I have a database created by export of data object. This process does not export any system tables to do with replication but there still seems to be something in the database which references them. There is no poblem if I backup and restore the dataabse.

Any advice?

Thanks Edno such monkey as a replication trigger. My guess here is that you replicating a table with triggers associated with it and when the publisher was defined the table in question had a trigger that did not have the trigger defined with the NOT FOR REPLICATION option and now you are getting conflicts.

If this is the case, ALTER TRIGGER should set you on the right path. Look up it's arguments in Books Online.

If this is not the case, why do you think triggers are the problem?

Friday, March 9, 2012

removing parameters

I created a report and gave a column a parameter in the data definition.
When I do a preview it gives a textbox to enter the parameter. Works fine.
I don't like the name of the parameter and change it in the data definition.
Now when I do a preview, I get two textboxes for parameters, one for the old
name and one for the new name. I only have one parameter, but it is showing
two prompts. How do I get rid of the textbox prompt for the old one?
Thanks,
Leon.You remove the "display" parameters in the Report, Report Parameters dialog.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Chuck Gosslin" <powerb@.inel.gov> wrote in message news:OOlU0fHhEHA.3520@.TK2MSFTNGP10.phx.gbl...
> I created a report and gave a column a parameter in the data definition.
> When I do a preview it gives a textbox to enter the parameter. Works fine.
> I don't like the name of the parameter and change it in the data definition.
> Now when I do a preview, I get two textboxes for parameters, one for the old
> name and one for the new name. I only have one parameter, but it is showing
> two prompts. How do I get rid of the textbox prompt for the old one?
> Thanks,
> Leon.
>

Removing Page breaks in HTML

Hi,
I've created a report which displays in the Report Viewer as several pages which the user must page through to see all data rather than scrolling down the browser. Can the Page Breaks be removed altogether? I've used the MHTML render format but it's still got the page header and footer repeated multiple times.
Thanks
MattSet the page length to something really long.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:66B4BB75-6347-4E11-B34F-DE71AEF8E8CC@.microsoft.com...
> Hi,
> I've created a report which displays in the Report Viewer as several pages
which the user must page through to see all data rather than scrolling down
the browser. Can the Page Breaks be removed altogether? I've used the MHTML
render format but it's still got the page header and footer repeated
multiple times.
> Thanks
> Matt|||Is it possible to do this and still render page breaks when exporting to say PDF for example?
I have a report like this as well, and it would be nice if the user could scroll down to compare data on the web page, but if they decide to export to PDF to save the report or print it, it would be nice if page breaks would still work.
Setting the page length to some large value will screw up the page breaks in the other formats.
This should be an option. On the report properties "Render page breaks in HTML?" True/False.
Joe
"Chris Hays [MSFT]" wrote:
> Set the page length to something really long.
> --
> This post is provided 'AS IS' with no warranties, and confers no rights. All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach of
> children under 3.
> "Matt" <Matt@.discussions.microsoft.com> wrote in message
> news:66B4BB75-6347-4E11-B34F-DE71AEF8E8CC@.microsoft.com...
> > Hi,
> > I've created a report which displays in the Report Viewer as several pages
> which the user must page through to see all data rather than scrolling down
> the browser. Can the Page Breaks be removed altogether? I've used the MHTML
> render format but it's still got the page header and footer repeated
> multiple times.
> >
> > Thanks
> > Matt
>
>|||There's currently no way to have different default page lengths for
different renderers.
You can, however, pass the page length to the PDF renderer as a URL
parameter to override the long page length default.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:1C625C8C-0A5C-4B96-8C8B-633029E81041@.microsoft.com...
> Is it possible to do this and still render page breaks when exporting to
say PDF for example?
> I have a report like this as well, and it would be nice if the user could
scroll down to compare data on the web page, but if they decide to export to
PDF to save the report or print it, it would be nice if page breaks would
still work.
> Setting the page length to some large value will screw up the page breaks
in the other formats.
> This should be an option. On the report properties "Render page breaks in
HTML?" True/False.
> Joe
>
> "Chris Hays [MSFT]" wrote:
> > Set the page length to something really long.
> >
> > --
> > This post is provided 'AS IS' with no warranties, and confers no rights.
All
> > rights reserved. Some assembly required. Batteries not included. Your
> > mileage may vary. Objects in mirror may be closer than they appear. No
user
> > serviceable parts inside. Opening cover voids warranty. Keep out of
reach of
> > children under 3.
> > "Matt" <Matt@.discussions.microsoft.com> wrote in message
> > news:66B4BB75-6347-4E11-B34F-DE71AEF8E8CC@.microsoft.com...
> > > Hi,
> > > I've created a report which displays in the Report Viewer as several
pages
> > which the user must page through to see all data rather than scrolling
down
> > the browser. Can the Page Breaks be removed altogether? I've used the
MHTML
> > render format but it's still got the page header and footer repeated
> > multiple times.
> > >
> > > Thanks
> > > Matt
> >
> >
> >|||Hi Chris,
The maximum report page length is 4064 mm in the Report PageSize Height. Is
that the page length you mean?
Regards Magnus
"Chris Hays [MSFT]" wrote:
> Set the page length to something really long.
> --
> This post is provided 'AS IS' with no warranties, and confers no rights. All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach of
> children under 3.
> "Matt" <Matt@.discussions.microsoft.com> wrote in message
> news:66B4BB75-6347-4E11-B34F-DE71AEF8E8CC@.microsoft.com...
> > Hi,
> > I've created a report which displays in the Report Viewer as several pages
> which the user must page through to see all data rather than scrolling down
> the browser. Can the Page Breaks be removed altogether? I've used the MHTML
> render format but it's still got the page header and footer repeated
> multiple times.
> >
> > Thanks
> > Matt
>
>

Removing Older Backups?

With SQL Server 2000 I created a backup disk file (and job) for full
database backups performed daily (which are appended), and a backup disk
file (and job) for log backups performed every hour (also appended). Because
of disk space constraints (on a dedicated server), I would like to remove
older backups from each of these backup files. For example, instead of
having seven (or 180) days of full backups and seven (or 180) days of log
backups on my local disk (the server is backed up to tape nightly), I would
like to automatically keep only the last three days of full backups and only
the transaction logs that came after the first of the three full backups.
I have not discovered a way to automatically create backups as separate
file, each labeled and time-stamped that I could periodically delete, if
there is not a way to do the above with single appended files.
So, how does one extract the older backups out of these single files with
appended backups? Is there a way to configure that with EM, or does it
require SQL scripting?
Thanks for any help.Hi,
Take a look into the maintenance plan in Enterprise manager. Maintenance
plan allow you to archive the backup files
based on te frequency you provide.
Thanks
Hari
SQL Server MVP
"Don Miller" <nospam@.nospam.com> wrote in message
news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended).
> Because
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I
> would
> like to automatically keep only the last three days of full backups and
> only
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>|||Don,
You can achieve this with the Maintenance Plan wizard although it has some
limitations and not very flexible. If you want to create your own jobs you
can use this sample as a start. It shows how to generate a new file name for
each backup and a sample on how to remove older backup files as well.
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Don Miller" <nospam@.nospam.com> wrote in message
news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended).
> Because
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I
> would
> like to automatically keep only the last three days of full backups and
> only
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>|||Thanks for the script. I'll take a close look at it.
I did experiment with the Maintenance Plan wizard and instead of appending
the backups and logs to the same file, it creates those separate
time-stamped files. I'll probably go with this because I can more easily
deal (and understand) with many time-stamped files rather than one file with
the logs and such enclosed in some proprietary manner.
I'm also looking at SQL Sentry as you suggested. Thanks.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OSEqsLiyGHA.3440@.TK2MSFTNGP06.phx.gbl...
> Don,
> You can achieve this with the Maintenance Plan wizard although it has some
> limitations and not very flexible. If you want to create your own jobs you
> can use this sample as a start. It shows how to generate a new file name
for
> each backup and a sample on how to remove older backup files as well.
>
> -- Do a backup and create a separate file for each day of the
> eek --
> DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
> IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
> DROP TABLE #DBs
> CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
> [Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
> [Status] VARCHAR(1000), [Compatibility_Level] INT)
> INSERT INTO #DBs EXEC sp_helpdb
>
> DECLARE cur_DBs CURSOR STATIC LOCAL
> FOR SELECT [Name]
> FROM #DBs
> WHERE [DBID] IN (5,6)
> OPEN cur_DBs
> FETCH NEXT FROM cur_DBs INTO @.DBName
> WHILE @.@.FETCH_STATUS = 0
> BEGIN
> SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
> CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
> CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
> CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
> SET @.Name = @.DBName + N' Full Backup'
> BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
> NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
> RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
> FETCH NEXT FROM cur_DBs INTO @.DBName
> END
> CLOSE cur_DBs
> DEALLOCATE cur_DBs
> ----
> -- Removing Older Backup Files --
> DECLARE @.Error INT, @.D DATETIME
> SET @.D = CAST('20020801 15:00:00' AS DATETIME)
> EXEC @.Error = remove_old_log_files @.D
> SELECT @.Error
> ----
> -- *** Procedure to remove old backups **** --
> CREATE PROCEDURE remove_old_log_files
> @.DelDate DATETIME
> AS
> SET NOCOUNT ON
> DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
> DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
> SET DATEFORMAT MDY
>
> IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
> DROP TABLE #DirList
> CREATE TABLE #dirlist (FName VARCHAR(1000))
> CREATE TABLE #Errors (Results VARCHAR(1000))
> -- Insert the results of the dir cmd into a table so we can scan it
> INSERT INTO #dirlist (FName)
> exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
> SET @.Error = @.@.ERROR
> IF @.Error <> 0
> BEGIN
> SET @.Msg = 'Error while getting the filenames with DIR '
> GOTO On_Error
> END
> --SELECT * FROM #dirList
> -- Remove the garbage
> DELETE #dirlist WHERE
> SUBSTRING(FName,1,2) < '00' OR
> SUBSTRING(FName,1,2) > '99' OR
> FName IS NULL
>
> -- Create a cursor and for each file name do the processing.
> -- The files will be processed in date order.
> DECLARE curDir CURSOR READ_ONLY LOCAL
> FOR
> SELECT SUBSTRING(FName,40,40) AS FName
> FROM #dirlist
> WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
> AND SUBSTRING(FName,40,40) LIKE '%.TRN'
> OPEN curDir
> FETCH NEXT FROM curDir INTO @.Fname
> WHILE (@.@.fetch_status = 0)
> BEGIN
>
> -- Delete the old backup files
> SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
> INSERT INTO #Errors (Results)
> exec master..xp_cmdshell @.Delete
>
> IF @.@.RowCount > 1
> BEGIN
> SET @.Error = -1
> SET @.Msg = 'Error while Deleting file ' + @.FName
> GOTO On_Error
> END
>
> -- PRINT @.Delete
> PRINT 'Deleted ' + @.FName + ' at ' +
> CONVERT(VARCHAR(28),GETDATE(),113)
> FETCH NEXT FROM curDir INTO @.Fname
> END
> CLOSE curDir
> DEALLOCATE curDir
> DROP TABLE #DirList
> DROP TABLE #Errors
> RETURN @.Error
> On_Error:
> BEGIN
> IF @.Error <> 0
> BEGIN
> SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
> RAISERROR(@.Msg,12,1)
> RETURN @.Error
> END
> END
> GO
>
> --
> Andrew J. Kelly SQL MVP
> "Don Miller" <nospam@.nospam.com> wrote in message
> news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
> > With SQL Server 2000 I created a backup disk file (and job) for full
> > database backups performed daily (which are appended), and a backup disk
> > file (and job) for log backups performed every hour (also appended).
> > Because
> > of disk space constraints (on a dedicated server), I would like to
remove
> > older backups from each of these backup files. For example, instead of
> > having seven (or 180) days of full backups and seven (or 180) days of
log
> > backups on my local disk (the server is backed up to tape nightly), I
> > would
> > like to automatically keep only the last three days of full backups and
> > only
> > the transaction logs that came after the first of the three full
backups.
> >
> > I have not discovered a way to automatically create backups as separate
> > file, each labeled and time-stamped that I could periodically delete, if
> > there is not a way to do the above with single appended files.
> >
> > So, how does one extract the older backups out of these single files
with
> > appended backups? Is there a way to configure that with EM, or does it
> > require SQL scripting?
> >
> > Thanks for any help.
> >
> >
>|||Don Miller wrote:
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended). Because
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I would
> like to automatically keep only the last three days of full backups and only
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>
Have a look at this script:
http://realsqlguy.com/serendipity/archives/11-Send-In-Backup!.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Removing Older Backups?

With SQL Server 2000 I created a backup disk file (and job) for full
database backups performed daily (which are appended), and a backup disk
file (and job) for log backups performed every hour (also appended). Because
of disk space constraints (on a dedicated server), I would like to remove
older backups from each of these backup files. For example, instead of
having seven (or 180) days of full backups and seven (or 180) days of log
backups on my local disk (the server is backed up to tape nightly), I would
like to automatically keep only the last three days of full backups and only
the transaction logs that came after the first of the three full backups.
I have not discovered a way to automatically create backups as separate
file, each labeled and time-stamped that I could periodically delete, if
there is not a way to do the above with single appended files.
So, how does one extract the older backups out of these single files with
appended backups? Is there a way to configure that with EM, or does it
require SQL scripting?
Thanks for any help.Hi,
Take a look into the maintenance plan in Enterprise manager. Maintenance
plan allow you to archive the backup files
based on te frequency you provide.
Thanks
Hari
SQL Server MVP
"Don Miller" <nospam@.nospam.com> wrote in message
news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended).
> Because
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I
> would
> like to automatically keep only the last three days of full backups and
> only
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>|||Don,
You can achieve this with the Maintenance Plan wizard although it has some
limitations and not very flexible. If you want to create your own jobs you
can use this sample as a start. It shows how to generate a new file name for
each backup and a sample on how to remove older backup files as well.
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Don Miller" <nospam@.nospam.com> wrote in message
news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended).
> Because
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I
> would
> like to automatically keep only the last three days of full backups and
> only
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>|||Thanks for the script. I'll take a close look at it.
I did experiment with the Maintenance Plan wizard and instead of appending
the backups and logs to the same file, it creates those separate
time-stamped files. I'll probably go with this because I can more easily
deal (and understand) with many time-stamped files rather than one file with
the logs and such enclosed in some proprietary manner.
I'm also looking at SQL Sentry as you suggested. Thanks.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OSEqsLiyGHA.3440@.TK2MSFTNGP06.phx.gbl...
> Don,
> You can achieve this with the Maintenance Plan wizard although it has some
> limitations and not very flexible. If you want to create your own jobs you
> can use this sample as a start. It shows how to generate a new file name
for
> each backup and a sample on how to remove older backup files as well.
>
> -- Do a backup and create a separate file for each day of the
> eek --
> DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
> IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
> DROP TABLE #DBs
> CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
> [Owner] VARCHAR(20),[DBID] INT, [Created] VARC
HAR(14),
> [Status] VARCHAR(1000), [Compatibility_Level] INT)
> INSERT INTO #DBs EXEC sp_helpdb
>
> DECLARE cur_DBs CURSOR STATIC LOCAL
> FOR SELECT [Name]
> FROM #DBs
> WHERE [DBID] IN (5,6)
> OPEN cur_DBs
> FETCH NEXT FROM cur_DBs INTO @.DBName
> WHILE @.@.FETCH_STATUS = 0
> BEGIN
> SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
> CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
> CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
> CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
> SET @.Name = @.DBName + N' Full Backup'
> BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
> NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
> RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
> FETCH NEXT FROM cur_DBs INTO @.DBName
> END
> CLOSE cur_DBs
> DEALLOCATE cur_DBs
> ----
> -- Removing Older Backup Files --
> DECLARE @.Error INT, @.D DATETIME
> SET @.D = CAST('20020801 15:00:00' AS DATETIME)
> EXEC @.Error = remove_old_log_files @.D
> SELECT @.Error
> ----
> -- *** Procedure to remove old backups **** --
> CREATE PROCEDURE remove_old_log_files
> @.DelDate DATETIME
> AS
> SET NOCOUNT ON
> DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
> DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
> SET DATEFORMAT MDY
>
> IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
> DROP TABLE #DirList
> CREATE TABLE #dirlist (FName VARCHAR(1000))
> CREATE TABLE #Errors (Results VARCHAR(1000))
> -- Insert the results of the dir cmd into a table so we can scan it
> INSERT INTO #dirlist (FName)
> exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
> SET @.Error = @.@.ERROR
> IF @.Error <> 0
> BEGIN
> SET @.Msg = 'Error while getting the filenames with DIR '
> GOTO On_Error
> END
> --SELECT * FROM #dirList
> -- Remove the garbage
> DELETE #dirlist WHERE
> SUBSTRING(FName,1,2) < '00' OR
> SUBSTRING(FName,1,2) > '99' OR
> FName IS NULL
>
> -- Create a cursor and for each file name do the processing.
> -- The files will be processed in date order.
> DECLARE curDir CURSOR READ_ONLY LOCAL
> FOR
> SELECT SUBSTRING(FName,40,40) AS FName
> FROM #dirlist
> WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
> AND SUBSTRING(FName,40,40) LIKE '%.TRN'
> OPEN curDir
> FETCH NEXT FROM curDir INTO @.Fname
> WHILE (@.@.fetch_status = 0)
> BEGIN
>
> -- Delete the old backup files
> SET @.Delete = 'DEL "C:\Backups' + @.FName + '"'
> INSERT INTO #Errors (Results)
> exec master..xp_cmdshell @.Delete
>
> IF @.@.RowCount > 1
> BEGIN
> SET @.Error = -1
> SET @.Msg = 'Error while Deleting file ' + @.FName
> GOTO On_Error
> END
>
> -- PRINT @.Delete
> PRINT 'Deleted ' + @.FName + ' at ' +
> CONVERT(VARCHAR(28),GETDATE(),113)
> FETCH NEXT FROM curDir INTO @.Fname
> END
> CLOSE curDir
> DEALLOCATE curDir
> DROP TABLE #DirList
> DROP TABLE #Errors
> RETURN @.Error
> On_Error:
> BEGIN
> IF @.Error <> 0
> BEGIN
> SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
> RAISERROR(@.Msg,12,1)
> RETURN @.Error
> END
> END
> GO
>
> --
> Andrew J. Kelly SQL MVP
> "Don Miller" <nospam@.nospam.com> wrote in message
> news:utNmj6WyGHA.2392@.TK2MSFTNGP03.phx.gbl...
remove[vbcol=seagreen]
log[vbcol=seagreen]
backups.[vbcol=seagreen]
with[vbcol=seagreen]
>|||Don Miller wrote:
> With SQL Server 2000 I created a backup disk file (and job) for full
> database backups performed daily (which are appended), and a backup disk
> file (and job) for log backups performed every hour (also appended). Becau
se
> of disk space constraints (on a dedicated server), I would like to remove
> older backups from each of these backup files. For example, instead of
> having seven (or 180) days of full backups and seven (or 180) days of log
> backups on my local disk (the server is backed up to tape nightly), I woul
d
> like to automatically keep only the last three days of full backups and on
ly
> the transaction logs that came after the first of the three full backups.
> I have not discovered a way to automatically create backups as separate
> file, each labeled and time-stamped that I could periodically delete, if
> there is not a way to do the above with single appended files.
> So, how does one extract the older backups out of these single files with
> appended backups? Is there a way to configure that with EM, or does it
> require SQL scripting?
> Thanks for any help.
>
Have a look at this script:
http://realsqlguy.com/serendipity/a...-Send-In-Backup!.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Removing log files from SQL Database

Need help .

There are 3 log files attached to a SQL Database . I would like to remove one of them as it was created by Previous DBA for temp use (Don'r ask me why?) If I run DBCC ShrinkFile with EMPTYFILE , would it let me drop that file or is there any command to do it? OR is it not possible at allYes, you can even do it using SQL Enterprise Mangler (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howtosql/ht_7_design_28mx.asp) if you like!

-PatP|||This is what I needed

Removing Items for the Report Server

I ran into a problem today where there were some user directories I needed
to delete but could not. All of them were created with NT AUTHORITY\SYSTEM.
Even as an Admin with all rights, the server will not let me remove them. Is
there another way around this?
BartI have the same problem and would appreciate if anyone knows the answer
to this.

Wednesday, March 7, 2012

Removing IDENTITY from a tabe column

Hi Guys,
I have created a table containg a column with IDENTITY keyword. I have data
in the table. Now i need to alter this table without IDENTITY for that
column. Please help me get a sql script to do this one.
The creation scirpt for the table is :
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[EventLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[EventLog];
CREATE TABLE [dbo].[EventLog] (
[RecordId] [int] IDENTITY (1, 1) NOT NULL ,
[eventId] [int] NOT NULL ,
[eventType] [int] NOT NULL ,
[eventDateTime] [datetime] NULL ,
[AimNumber] [int] NULL ,
[eventMsg] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[opId] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[comments] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[eventProperties] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
) ON [PRIMARY];
ALTER TABLE [dbo].[EventLog] WITH NOCHECK ADD
CONSTRAINT [PK_EventLog] PRIMARY KEY CLUSTERED
(
[RecordId]
) ON [PRIMARY] ;
Now i need script for altering the just identity column.'?
HariHi,
You need to drop and create the table to remove IDENTITY property.
If you use Enterprise manager it internally copy the data outside,script the
schema, modify the script to remove identity
and create the table back and load data.
Thanks
Hari
SQL Server MVP
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:F8F07062-110A-4E07-8526-5D93E3B6C063@.microsoft.com...
> Hi Guys,
> I have created a table containg a column with IDENTITY keyword. I have
> data
> in the table. Now i need to alter this table without IDENTITY for that
> column. Please help me get a sql script to do this one.
> The creation scirpt for the table is :
> if exists (select * from dbo.sysobjects where id => object_id(N'[dbo].[EventLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [dbo].[EventLog];
> CREATE TABLE [dbo].[EventLog] (
> [RecordId] [int] IDENTITY (1, 1) NOT NULL ,
> [eventId] [int] NOT NULL ,
> [eventType] [int] NOT NULL ,
> [eventDateTime] [datetime] NULL ,
> [AimNumber] [int] NULL ,
> [eventMsg] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [opId] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [comments] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [eventProperties] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS
> NULL
> ) ON [PRIMARY];
> ALTER TABLE [dbo].[EventLog] WITH NOCHECK ADD
> CONSTRAINT [PK_EventLog] PRIMARY KEY CLUSTERED
> (
> [RecordId]
> ) ON [PRIMARY] ;
>
> Now i need script for altering the just identity column.'?
> Hari|||Here's the script:
ALTER TABLE dbo.EventLog ADD NewRecordID int NULL
GO
UPDATE dbo.EventLog SET NewRecordID = RecordId
GO
ALTER TABLE dbo.EventLog DROP CONSTRAINT PK_EventLog
GO
ALTER TABLE dbo.EventLog DROP COLUMN RecordId
GO
EXEC sp_rename 'EventLog.NewRecordID', 'RecordId'
GO
ALTER TABLE dbo.EventLog ALTER COLUMN RecordId int NOT NULL
GO
ALTER TABLE dbo.EventLog ADD CONSTRAINT PK_EventLog PRIMARY KEY CLUSTERED
(RecordId) ON [PRIMARY]
GO
Make sure there's nobody making changes to this data while you are running
this script.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Hari" <Hari@.discussions.microsoft.com> wrote in message
news:F8F07062-110A-4E07-8526-5D93E3B6C063@.microsoft.com...
Hi Guys,
I have created a table containg a column with IDENTITY keyword. I have data
in the table. Now i need to alter this table without IDENTITY for that
column. Please help me get a sql script to do this one.
The creation scirpt for the table is :
if exists (select * from dbo.sysobjects where id =object_id(N'[dbo].[EventLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[EventLog];
CREATE TABLE [dbo].[EventLog] (
[RecordId] [int] IDENTITY (1, 1) NOT NULL ,
[eventId] [int] NOT NULL ,
[eventType] [int] NOT NULL ,
[eventDateTime] [datetime] NULL ,
[AimNumber] [int] NULL ,
[eventMsg] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[opId] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[comments] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[eventProperties] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
) ON [PRIMARY];
ALTER TABLE [dbo].[EventLog] WITH NOCHECK ADD
CONSTRAINT [PK_EventLog] PRIMARY KEY CLUSTERED
(
[RecordId]
) ON [PRIMARY] ;
Now i need script for altering the just identity column.'?
Hari|||Thank you verymuch for your suggetion.
Hari
"Narayana Vyas Kondreddi" wrote:
> Here's the script:
> ALTER TABLE dbo.EventLog ADD NewRecordID int NULL
> GO
> UPDATE dbo.EventLog SET NewRecordID = RecordId
> GO
> ALTER TABLE dbo.EventLog DROP CONSTRAINT PK_EventLog
> GO
> ALTER TABLE dbo.EventLog DROP COLUMN RecordId
> GO
> EXEC sp_rename 'EventLog.NewRecordID', 'RecordId'
> GO
> ALTER TABLE dbo.EventLog ALTER COLUMN RecordId int NOT NULL
> GO
> ALTER TABLE dbo.EventLog ADD CONSTRAINT PK_EventLog PRIMARY KEY CLUSTERED
> (RecordId) ON [PRIMARY]
> GO
> Make sure there's nobody making changes to this data while you are running
> this script.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Hari" <Hari@.discussions.microsoft.com> wrote in message
> news:F8F07062-110A-4E07-8526-5D93E3B6C063@.microsoft.com...
> Hi Guys,
> I have created a table containg a column with IDENTITY keyword. I have data
> in the table. Now i need to alter this table without IDENTITY for that
> column. Please help me get a sql script to do this one.
> The creation scirpt for the table is :
> if exists (select * from dbo.sysobjects where id => object_id(N'[dbo].[EventLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [dbo].[EventLog];
> CREATE TABLE [dbo].[EventLog] (
> [RecordId] [int] IDENTITY (1, 1) NOT NULL ,
> [eventId] [int] NOT NULL ,
> [eventType] [int] NOT NULL ,
> [eventDateTime] [datetime] NULL ,
> [AimNumber] [int] NULL ,
> [eventMsg] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [opId] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [comments] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [eventProperties] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS
> NULL
> ) ON [PRIMARY];
> ALTER TABLE [dbo].[EventLog] WITH NOCHECK ADD
> CONSTRAINT [PK_EventLog] PRIMARY KEY CLUSTERED
> (
> [RecordId]
> ) ON [PRIMARY] ;
>
> Now i need script for altering the just identity column.'?
> Hari
>
>