Hi TEAM,
we are configuring logshipping successfully but when ever run the backup job we getting bellow error message
Hi TEAM,
we are configuring logshipping successfully but when ever run the backup job we getting bellow error message
We are using sp_trace_getdata to run a trace against SQL Server. Unforutnately this call seems to be undocumented.
Where does this call store the trace data it produces? Does it write to a buffer in memory?
We are also hitting trace rollover events. Is there a way to increase the buffer size sp_trace_getdata uses to try to limit these?
Hi All,
I have a SSIS Package Maintenance plan to execute DBCC checkDB for UserDB on my server.
The Job as suddenly failed now.
Executing the query "dbcc checkdb('MYD?Name') with no_infomsgs" failed with the following error: "Could not find database ''MYD?Name''.
Actually for one of my DB in name one character is being replaced by ? due to which this is not able to find that database
Ex. My original database name: mydb123
replaced DB m?db123 if you can see now y character has been replaced by ?
Any help would be greatly appreciated. Thank you
Thanks & Regards,
Manjunath C Bhat,
http://manjunathcbhat.blogspot.com
http://manjunathcbhat.wordpress.com
Hi Team,
In my environment we have windows server 2003. In that windows SQLSERVER 2008 R2 was installed.Recently we have upgraded Windows server 2003 to Windows Server 2008 (We have done Inplace OS Upgradation).
After Upgraded to windows server 2008 , We are unable to start the SQLSERVER Services.
We are getting the below SidebySide Error in Eventviewer :
-------------------------------------------------------------------------------
Activation context generation failed for "c:\program files\microsoft sql server\mssql10_50.mssqlserver\mssql\binn\sqlservr.exe. Dependency Assembly Microsoft.VC80.ATL.processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found.
Note : PFA Screenshot of the above error.
Could you please provide the solution for the above issue.
Thanks and Regards,
Venkat
Venkat Thota
USE [dumptest]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_SetFixVer]
(
@ProblemID int,
@NewFixVersionID int
)
AS
BEGIN
UPDATE [dbo].[Problems] set FixVer = @NewFixVersionID where ProblemID = @ProblemID
RETURN 0
END
GO
include("dbopen.php");
print "newfixver is {$_POST['newfixver']}<br>";
//Debug
$qry = "exec sp_SetFixVer {$_REQUEST['prob']}, {$_POST['newfixver']}";
print "The query to execute is $qry";
$stmt = mssql_init("sp_SetFixVer");
if($stmt &&
mssql_bind($stmt, "@ProblemID", $_REQUEST['prob'], SQLINT4, false) &&
mssql_bind($stmt, "@NewFixVersionID", $_POST['newfixver'], SQLINT4, false))
{
$res = mssql_execute($stmt);
//Debug
print "The result is $res<br>";
}
include("dbclose.php");
USE [dumptest]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Problems](
[ProblemID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](100) NULL,
[IssueState] [tinyint] NOT NULL,
[Issue] [int] NULL,
[FixVer] [int] NULL,
[ProductID] [int] NOT NULL,
[NeedDumpDate] [datetime] NULL,
[FirstVersionID] [int] NULL,
[LastVersionID] [int] NULL,
[DumpsCount] [int] NOT NULL,
[Author] [int] NULL,
[TTRecordID] [int] NULL,
[TTLastStudyTime] [datetime] NULL,
[FixDate] [datetime] NULL,
[KlavaDetected] [tinyint] NOT NULL,
CONSTRAINT [PK_Problem] PRIMARY KEY CLUSTERED
(
[ProblemID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Problems] WITH CHECK ADD CONSTRAINT [FK_Problem_Product] FOREIGN KEY([ProductID])
REFERENCES [dbo].[Products] ([ProductID])
GO
ALTER TABLE [dbo].[Problems] CHECK CONSTRAINT [FK_Problem_Product]
GO
ALTER TABLE [dbo].[Problems] WITH CHECK ADD CONSTRAINT [FK_Problems_FirstVersion] FOREIGN KEY([FirstVersionID])
REFERENCES [dbo].[Versions] ([VersionID])
GO
ALTER TABLE [dbo].[Problems] CHECK CONSTRAINT [FK_Problems_FirstVersion]
GO
ALTER TABLE [dbo].[Problems] WITH CHECK ADD CONSTRAINT [FK_Problems_IssueStates] FOREIGN KEY([IssueState])
REFERENCES [dbo].[IssueStates] ([StateID])
GO
ALTER TABLE [dbo].[Problems] CHECK CONSTRAINT [FK_Problems_IssueStates]
GO
ALTER TABLE [dbo].[Problems] WITH CHECK ADD CONSTRAINT [FK_Problems_LastVersion] FOREIGN KEY([LastVersionID])
REFERENCES [dbo].[Versions] ([VersionID])
GO
ALTER TABLE [dbo].[Problems] CHECK CONSTRAINT [FK_Problems_LastVersion]
GO
ALTER TABLE [dbo].[Problems] WITH CHECK ADD CONSTRAINT [FK_Problems_Versions] FOREIGN KEY([FixVer])
REFERENCES [dbo].[Versions] ([VersionID])
GO
ALTER TABLE [dbo].[Problems] CHECK CONSTRAINT [FK_Problems_Versions]
GO
ALTER TABLE [dbo].[Problems] ADD DEFAULT ((0)) FOR [DumpsCount]
GO
USE [dumptest]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Versions](
[VersionID] [int] IDENTITY(1,1) NOT NULL,
[Major] [smallint] NOT NULL,
[Minor] [smallint] NOT NULL,
[Build] [smallint] NOT NULL,
[Compilation] [smallint] NOT NULL,
[InstCount] [int] NULL,
[DumpsCount] [int] NOT NULL,
[TTProductID] [int] NOT NULL,
[ProductID] [int] NULL,
[Hotfix] [smallint] NOT NULL,
[VersionType] [tinyint] NOT NULL,
[Product] AS (case when [Major]=(0) AND [Minor]=(0) AND [Build]=(0) AND [Compilation]=(1) then 'AVBases' else (((CONVERT([varchar],[Major],0)+'.')+CONVERT([varchar],[Minor],0))+'.')+CONVERT([varchar],[Build],0) end) PERSISTED,
[VersionString] AS (case when [VersionType]=(1) then ((((((CONVERT([varchar],[Major],0)+'.')+CONVERT([varchar],[Minor],0))+'.')+CONVERT([varchar],[Build],0))+'.')+case when [Compilation]=(-1) then 'next' when [Compilation]=(-2) then 'inprogress' else CONVERT([varchar],[Compilation],0) end)+case when [Hotfix]=(0) then '' else char([Hotfix]) end when [VersionType]=(2) then case when [Major]=(1900) then 'Unknown' else CONVERT([varchar],dateadd(second,[Hotfix],dateadd(hour,[Compilation],dateadd(day,[Build]-(1),dateadd(month,[Minor]-(1),CONVERT([varchar],[Major],0)+'0101')))),(120)) end else '' end),
CONSTRAINT [PK_Versions] PRIMARY KEY CLUSTERED
(
[VersionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Versions] ADD CONSTRAINT [DF_Versions_Major] DEFAULT ((0)) FOR [Major]
GO
ALTER TABLE [dbo].[Versions] ADD CONSTRAINT [DF_Versions_Minor] DEFAULT ((0)) FOR [Minor]
GO
ALTER TABLE [dbo].[Versions] ADD CONSTRAINT [DF_Versions_Build] DEFAULT ((0)) FOR [Build]
GO
ALTER TABLE [dbo].[Versions] ADD CONSTRAINT [DF_Versions_Compilation] DEFAULT ((0)) FOR [Compilation]
GO
ALTER TABLE [dbo].[Versions] ADD DEFAULT ((0)) FOR [DumpsCount]
GO
ALTER TABLE [dbo].[Versions] ADD DEFAULT ((0)) FOR [TTProductID]
GO
ALTER TABLE [dbo].[Versions] ADD DEFAULT ((0)) FOR [Hotfix]
GO
ALTER TABLE [dbo].[Versions] ADD DEFAULT ((1)) FOR [VersionType]
GO
Please see below. There is some kind of communication problem when I try to access "(localdb)\Projects" using the ability to connect to SQL Server as a drive, and then ultimately later (e.g. $server = Get-Item .) as a Smo Server object.
With localdb, it fails about 8 times, then suddenly actually works. It's painfully slow.
I am trying to do this, to, for example, write a script that can unregister a series of DACs all at once, but this is my root problem right now.
Any ideas?
Notice below, on the last line, it finally comes back and works.
Thanks,
Ryan
PS C:\Users\rwhite> cd sqlserver:sql\"(localdb)\projects"when i try to connect Database engine using windows autentication i get following error.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)
Thaks in advance
Hi,
I am trying to insert a sectional CSV file into database using a format file. my CSV file looks like:
Section::Test
Column1,Column2
1,2
Section::Test2
Sec2Col1,Sec2Col2,sec3col3,sec4col4,sec5col5
1,2,3,4,2
2,3,4,5,3
4,5,6,5,6
Section::Test3
newCol1,newCol2,newcol3,newcol4
2,3,4,2
3,4,5,3
Section::Test4
Col1,col2,col3
2,2,2
3,4,5
5,4,6
but it is throwing an error while inserting the 2nd,3rd and 4th sections into their respective tables.
Msg 4832, Level 16, State 1, Line 2
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7301, Level 16, State 2, Line 2
Cannot obtain the required interface ("IID_IColumnsInfo") from OLE DB provider "BULK" for linked server "(null)".
Thank you
Hi,
I have an issue with bulk insert where it picks wrong rows for insertion from a CSV file with sections in it.
my file looks like
Section::Test
Column1,Column2
1,2
Section::Test2
Sec2Col1,Sec2Col2,sec3col3,sec4col4,sec5col5
1,2,3,4,2
2,3,4,5,3
4,5,6,5,6
Section::Test3
newCol1,newCol2,newcol3,newcol4
2,3,4,2
3,4,5,3
Section::Test4
Col1,col2,col3
2,2,2
3,4,5
5,4,6
i get the issue while inserting the second section,third section and fourth section into the database.
using a format file for this gives me
Msg 4832, Level 16, State 1, Line 1Please check and revert.
thank you
HI TO ALL,
1. WHEN MSDB & MODEL DB CRASHED BEFORE TAKING BACKUP WHAT ACTION SHOULD BE TAKEN IN PRODUCTION LEVEL?
2. HOW MANY DATA FILES AND LOG FILES CAN BE CREATED FOR 1 SERVER / 1 DATABASE IN PRODUCTION ?
3 . IN PRODUCTION WE CAN SHRINK THE TEMP DB / ANY OTHER SYSTEM DB'S? IF SO HOW?
4. IN PRODUCTION LEVEL WHAT IS THE DAILY ACTIVITIES OF SQL DBA?
5. HOW MANY WAYS (NOT LIKE FULL,DIFF,T-LOG) CAN WE TAKE BACKUP OF A DATABASE?
THANKS IN ADVANCE
M.KIRAN KUMAR
Hi,
I am currently at loss how I will be able to generate the productcategory_key and productsubcategory_key for dbo.dw. To generate, for productcategory_key, the combination of product + productcategory matters. To generate the productsubcategory_key, the combination of product+productcategory+productsubcategory matters.
I have included the desired result (dbo.dw) that I want to achieve. Pardon me that I am short of knowledge how to script it. Tried rank()/row_number(), but that's not the result that I want to have.
Please help!
CREATE TABLE [dbo].[staging](
[product] [nvarchar](50) NULL,
[productcategory] [nvarchar](50) NULL,
[productsubcategory] [nvarchar](50) NULL,
[others] [nvarchar](50) NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[dw](
[id] [int] IDENTITY(1,1) NOT NULL,
[product] [nvarchar](50) NULL,
[productcategory_key] [int] NULL,
[productcategory] [nvarchar](50) NULL,
[productsubcategory_key] [int] NULL,
[productsubcategory] [nvarchar](50) NULL,
[others] [nvarchar](50) NULL
) ON [PRIMARY]
cherriesh
TechNet Wiki is partnering with... YOU!
Give us some juicy technical content and we might big you up!
It really is that simple!
Show us your forum solutions or drop us some nifty snippets and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!
This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!
If you spend any amount of time crafting an awesome answer to a forum question, or just learnt something new, then why not get the most back for your efforts, by posting it to TechNet Wiki.
1) Please copy over any solutions and revelations to TechNet Wiki.
2) Add a link to it on THIS WIKI PAGE, so we know you've contributed
3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.
If you win, we will sing your praises, similar to the weekly contributor awards, however once "on our radar" and making your mark, you will probably be interviewed for your greatness, and eventually even invited into other TechNet/MSDN circles!
Either way, winning this award in your favoured technology can only be very good for your career! ;)
Feel free to ask any questions below.
#PEJL Got a good solution? If you invest your time in coding an elegant/novel or large answer on these MSDN forums, why not copy it over to our belovedTechNet Wiki, for future generations to benefit from!
HI TO ALL,
1. What is a Dead lock victim?
2. WHERE N HOW CAN I FIND (Alert me when someone responds to this post) OPTION IN MS SQL SERVER SITE.(I ALREADY CREATE AN A/C BUT I WANT ALERTS THROUGH MAIL.)
PLS REP ME
THANKS IN ADVANCE
M.KIRAN KUMAR
Note,
I am not talking about a clustered index against a non-cluster index, I mean a clustered index comparing to no index at all for inserting performance.
I saw lots of links as below said that, a clustered index has better performance against no index even for insert operation, due
to IAM/PFS/bitmap/..., but with my testing, seems no index is faster than cluster index, what's the problem?
http://stackoverflow.com/questions/7264820/removing-a-primary-key-clustered-index-to-increase-insert-performance
http://support.microsoft.com/kb/297861
my test scripts:
-------------------------------------------
--prepare table with clustered index
CREATE TABLE [dbo].[BigTable_CI](
[id] [int] IDENTITY(1,1) NOT NULL,
[BigChar] [char](4100) NOT NULL
)
GO
CREATE CLUSTERED INDEX CIX_BigTable_CI
ON BigTable_CI(id)
GO
ALTER TABLE [dbo].[BigTable_CI]
ADD CONSTRAINT [DF_BigTable_BigChar_CI] DEFAULT ('a') FOR [BigChar]
GO
CREATE PROCEDURE [dbo].[AddDataToBigTable_CI]
(@NumberOfRows bigint)
AS
SET NOCOUNT ON;
DECLARE @Counter int = 0;
DECLARE @Start datetime = GETDATE();
DECLARE @End datetime;
DECLARE @ElapsedTime int = 0;
DECLARE @RowsPerSecond int = 0;
WHILE (@Counter < @NumberOfRows)
BEGIN
INSERT INTO dbo.BigTable_CI DEFAULT VALUES;
SELECT @Counter += 1;
END;
-- Calculate elapsed time and rows/second
SET @End = GETDATE();
SET @ElapsedTime = CONVERT(INTEGER, DATEDIFF (second, @Start, @End));
SET @RowsPerSecond = @NumberOfRows/@ElapsedTime;
-- Record results in local table
INSERT INTO dbo.Results
(StartTime, EndTime, ElapsedTime, NumberOfRows, RowsPerSecond)
VALUES (@Start, @End, @ElapsedTime, @NumberOfRows, @RowsPerSecond);
RETURN;
-------------------------------------------
--prepare table without any index at all.
CREATE TABLE [dbo].[BigTable_NI](
[id] [int] IDENTITY(1,1) NOT NULL,
[BigChar] [char](4100) NOT NULL
)
GO
ALTER TABLE [dbo].[BigTable_NI]
ADD CONSTRAINT [DF_BigTable_BigChar_NI] DEFAULT ('a') FOR [BigChar]
GO
CREATE PROCEDURE [dbo].[AddDataToBigTable_NI]
(@NumberOfRows bigint)
AS
SET NOCOUNT ON;
DECLARE @Counter int = 0;
DECLARE @Start datetime = GETDATE();
DECLARE @End datetime;
DECLARE @ElapsedTime int = 0;
DECLARE @RowsPerSecond int = 0;
WHILE (@Counter < @NumberOfRows)
BEGIN
INSERT INTO dbo.BigTable_NI DEFAULT VALUES;
SELECT @Counter += 1;
END;
-- Calculate elapsed time and rows/second
SET @End = GETDATE();
SET @ElapsedTime = CONVERT(INTEGER, DATEDIFF (second, @Start, @End));
SET @RowsPerSecond = @NumberOfRows/@ElapsedTime;
-- Record results in local table
INSERT INTO dbo.Results
(StartTime, EndTime, ElapsedTime, NumberOfRows, RowsPerSecond)
VALUES (@Start, @End, @ElapsedTime, @NumberOfRows, @RowsPerSecond);
RETURN;
-------------------------------------------
--prepare the results table
create table dbo.Results
(
StartTime datetime,
EndTime datetime,
ElapsedTime int,
NumberOfRows int,
RowsPerSecond int
)
-------------------------------------------
--run scripts:
exec [dbo].[AddDataToBigTable_NI] 1000000
exec [dbo].[AddDataToBigTable_CI] 1000000
Hi,
I need to know if the XactSequence number in the profiler can ever be the same for 2 separate transations. It is also used in the ALL_HEADERS section of TDS packets as a transaction identifier.
I cannot find anywhere that suggests if they are globally unique or not, and if my tests are correct i am seeing them repeat roughly every 15 minutes under very heavy traffic.
Thanks for your time.
Dear Friends,
I have two separate nodes of SQL Server2012 installed on two Virtual servers. Their names are SQLDB1 and SQLDB2.
Now when I open the SQLDB1 Management studio, I can connect to both servers from the same Object explorer, But when i go to another SQLDB2 i cannot connect to SQLDB1. it gives Time out error.
Although my SQL Services are running, Moreover the remote connection on both servers are also enabled. Can any body help me out.
Azwar
Hello gurus,
I was able to trace my SQL Server using the server side trace method and the trace is already complete. The bad news is that I am not able to open the trace file using the profiler. The error says I do not have access authorization. But how come I do not have access authorization when I am the one who created the trace? Or is the account used to open the file the one belonging to the profiler client or my account?
If it is the account belonging to the profiler that does not have access authorization, how can I make sure the profiler client has the right account to open the trace file?
ebro
Hi
I am trying to insert a .CSV file with sectional division of data in it. i am unable to insert the row, which i want to pick and insert as the row numbers are not taken as in the .CSV file
Please advice if u have any suggestion or is it the case of row terminator not ending the rows
Thank you
Hi All,
I have very old SQL Server 2000 database where the size on disk is very low and data file is increasing day by day. What should i do to reduce the size of datafile. Should i shrink the datafile. Is it a recommended to do so. Please convey your suggestions.
Thanks,
Venkat.