This is what I could understand from above command...
Start cmd command window
with Echo turned off
execute the command and quit (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...
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 + ' / ' +...
this might be because of the error severety level is 16, that means the error can be corrected by developer and SQL server terminates the program here. EVEN TRY.. CATCH block will behave same.
Try raising error of low severity.
execute below code and study the procedure execution with error...
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...
Hi..
Try something like below..
UPDATE A
Set a.Primary_Vendor = c.Primary_Vendor
From Warranty_Registration A
Inner Join Inserted B On a.Warranty_Reg_Id = 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...
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...
I am sorry.. there were some hardcodes in above code.. here is the w/o h/c ..
:)
exec sp_MSforeachdb
'Declare @String varchar(255), @Message varchar(1000), @ul varchar(1000), @RecCount int
Select @String = ''#Tab1''
Select @String =''%'' + @String+ ''%'',
@RecCount = 0
Print ''?''
Select...
Since you are running the code from one database and using the four part object naming for sys tables.. you can not get the corerct database for db_name()..
Try this..
exec sp_MSforeachdb
'Declare @String varchar(255), @Message varchar(1000), @ul varchar(1000), @RecCount int
Select @String =...
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.