...(don't leave the window open)
loop through each file
in log location path "G:\SQLData\MSSQL11.MSSQLSERVER\MSSQL\LOG"
files having pattern *_*_*_*.txt
and last modifed at current day - 30 days
Replaces STDERR with STDOUT (to have all output at single location)
If file exists...
Which version of SQL Server you are using?
Did you give a try to Pivot operator?
By "I need it all together" if you mean to have all six resultset / recordssets together in one single resultset, then you can use Union All.
M2C...
Regards,
"Dream not what makes your sleep a pleasure, but...
I think insert statement missing TrackingDate, hence the variable @TrackingDate has null value.
When you concatenate values for @Message variable, it becomes null. Try changing variable assignment for @Message like this.
Set @Message = @FileNumber + ' / ' + @BoxNumber + ' / ' +...
...severity.
execute below code and study the procedure execution with error handling
CREATE PROC ErrSev16_one
AS
BEGIN
DECLARE @ERR INT
SELECT * FROM SDSCallDetailAA
SELECT @ERR = @@ERROR
IF @ERR <> 0
BEGIN
PRINT 'ERROR OCCURED A'
END
END
go
CREATE PROC ErrSev16_TWO
AS
BEGIN...
Generate the script for the table (including default and other constraints) and post it here.. we will create the table at our end and see the behaviour.
Do you have any trigger on the table?
Regards,
Regards,
"Dream not what makes your sleep a pleasure, but what makes you work
hard to...
Hi,
In SQL 2008 how can we notify connected client when there is update on perticular or all tables data. including which table's data updated through which client...
I read that this can be done using Policy based management as SSNS has been removed from SQL 2008... but I can see table Facet...
Which version of SQL Server you are using? if its 2005 then you can give a try to following code...
SELECT * INTO #Test FROM Property WHERE 1 = 0
BULK INSERT #Test
FROM 'c:\PristineTest.txt'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
;With Test as...
Hi Guys,
Below is the link of the question posted on MSDN SQL Forum. Question posted is about SQL Agents behaviour when changed system calendar date to backward.
I could not get proper forum for SQL Server Agent related queries, I am sure could get direction from this forum...
on the flash I could think of adding new field of uid.. which can enable to have multiple categories for a single user and each category can have as many as details that user uploads..
Regards,
"Dream not what makes your sleep a pleasure, but what makes you work
hard to achieve it and...
If we assume that the X will be the appropriate value for A or P.. you can get the datetime parsed through following syntax...
Declare @ADate varchar(20)
Select @ADate = '20080111 0815a'
Select @ADate = Stuff(Stuff(Upper(@ADate),14, 0, ' ') + 'M', 12, 0, ':')
Select Convert(datetime...
...= b.Warranty_Reg_Id
Inner Join AEO_DEVL_SEQFLEXT C on b.Engine_Serial_No = c.ENG_SERIAL_NUM
b..Engine_Model_Code = c.ENG_MODEL_CD
**This is not tested.. if you get any error do fix and run it.
HTH.
Regards,
"Dream not what makes your sleep a pleasure, but what makes you work...
Hi..
I dont have any idea how your procedure processes the users table.. but if you are storing the datetime that the users table and using that value in your next process as start date then you should not be in trouble..
Regards,
"Dream not what makes your sleep a pleasure, but what...
Did you try listing the column names in insert/exec statement, with the fields that procedure returns the values for and later update the additional field with separate update with your variable value..
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO #DistinctProductVersions (VersionNumber...
...so.Xtype = ''P''
and PatIndex( @String, sc.Text) > 0
Order By so.Name
Select @RecCount = @@RowCount
If @RecCount > 0
Begin
Select @Message=''* ''+ convert(varchar(8),@RecCount) + '' Stored procedure(s) found in database ? having the string "'' + @String + ''" *''
Select @ul =...
Hi..
You need to concatenate the database where you are printing the message that says your '* Stored procedures containing...'
Change the following line in your procedure sp_FindSP
SELECT @msg=''* Stored procedures containing string "'' + @s + ''='' +
convert(varchar(8),@@rowcount) + ''...
Also can be achieve the same using union and aggregate functions..
Select min(Value) MinDate, max(Value) MaxDate
From (Select Field1 as Value From table1
Union all Select Field2 from table1
Union all select field3 from table1
Union all select field4 from table1) a
Regards,
"There...
Have a look on datediff function..you can use this function with your date column and getdate function ..
Regards,
"There are no secrets to success. It is the result of preparation, hard work, and learning from failure." -- Colin Powell
Try following query .. .(I have not checked the query as I dont have data.)
SELECT ISNULL( M.TeamMemberID, '') TeamMemberID,
T.TreatmentID TreatMentID,
ISNULL( P.ProductType, '') ProductType,
T.Treatment Treatment
FROM tblTreatment T (NOLOCK)
LEFT OUTER JOIN tblProductTypeTreatment PT...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.