Recently Indexed Messages:-



SQL Server 2012 :: Inserting Dummy Records Using Loop Statement

Jul 17, 2015

I have the following attributes in this Table A.

1) Location_ID (int)
2) Serial_Number (nvarchar(Max))
3) KeyID (nvarchar(max)
4) Reference_Address (nvarchar(max)
5) SourceTime (datetime)
6) SourceValue (nvarchar)

I am trying to create 1000000 dummy records in this this table A.How do i go about do it? I would like my data to be something like this

LOCATION_ID
1

Serial Number
SN-01

KeyID
E1210

Reference_Address
83

SourceTime
2015-05-21 00:00:00 000

SourceValue
6200

View 7 Replies

How To Avoid Duplicate Data

May 7, 2015

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sectionexpenses]
(@sectionname varchar(30),
@ExpensesName varchar(max),

[code]....

View 3 Replies

DB Engine :: Backup Encryption With Compression With Date Format

Jul 31, 2015

Current  am using the below script it is  working fine i need use ENCRYPTION script  where i should add this 

NOREWIND, NOUNLOAD, COMPRESSION,
 ENCRYPTION(ALGORITHM = AES_256,
SERVER CERTIFICATE = [BackupCertificate]),  STATS = 10
USE [master]
GO

[code]...

View 3 Replies

SQL Server 2008 :: Perform Checksum Based On The Source Table Data?

Aug 10, 2015

I'm trying to load data from old SQL server 2000 to new SQL server 2014. I need to do a checksum to check if all the source data is loaded in the target database(SQL server 2014). I've created the insert statement for the same which works. I need to use checksum to make sure all the source rows are loaded in the target table. I haven't done checksum before.

Here is my insert statement:

INSERT INTO [Test].[dbo].[Order_tab]
([rec_id]
,[date_loaded]
,[Name1]
,[Name2]
,[Address1]
,[Address2]

[code]....

View 2 Replies

SQL Server 2012 :: How To Capture CPU And Memory Usage For A Stored Procedure

Jan 19, 2015

I have around 100 packages (all [packages run at same time) each package calls a stored Procedure once the Stored proc Execution is completed the package will write the log information into a log table, here how can i capture the CPU and Memory usage for execution of each stored proc.

View 2 Replies

How To Find Count From Multiple Column

Mar 24, 2014

let us suppose

ID | companycode | year | name | State
1 | 01 | 2013 | xyz | D
1 | 01 | 2013 |abs | S
23| 02 | 2014 | age | D
2 | 01 | 2013 | XYZ | D
1 | 01 | 2013 | abh | D
7 | 13 | 2014 | adi | C
7 | 13 | 2014 | adi | C
7 | 13 | 2013 | adi | C
7 | 13 | 2014 | adi | C
7 | 13 | 2013 | adp | C
7 | 13 | 2014 | abp | C

and we want like this

ID | companycode | year | countname | State
1 | 01 | 2013 | 2 | D
23| 02 | 2014 | 1 | D
1 | 01 | 2013 | 1 | s
2 | 01 | 2013 | 1 | D
7 | 13 | 2013 | 2 | C
7 | 13 | 2014 | 4 | c

View 4 Replies

SQL 2012 :: How To Download Data From Server In UNIX

Dec 6, 2014

I know that SQL Server runs on Windows Server, is it possible to download data in UNIX using shell script? does SQL Server has any binary or command line client for any operating system other than Windows?

View 5 Replies

Time Range Set By Query

May 7, 2014

I have a query to determine the time range like following

SET @StartDate = CAST (DATEDIFF(d, 0, DATEADD(d, 1 - day(getdate()), getdate()))as datetime)
SET @EndDate = GetDate()

What time range that query set ??

View 3 Replies

Recovery :: UPDATE Table And OUTPUT Clause To Capture Some Of Columns

May 28, 2015

I am trying to update a table and then also use OUTPUT clause to capture some of the columns. The code that I am using is something like the one below

UPDATE s
SET Exception_Ind = 1
OUTPUT s.Master_Id, s.TCK_NR
INTO #temp2
FROM Master_Summary s
INNER JOIN Exception d
ON d.Id = LEFT(s.Id, 8)
AND d.Barcode_Num = s.TCK_NR
WHERE s.Exception_Ind IS NULL

The above code is throwing an error as follows:

Msg 4104, Level 16, State 1, Procedure Process_Step3, Line 113
The multi-part identifier "s.Master_Id" could not be bound.
Msg 4104, Level 16, State 1, Procedure Process_Step3, Line 113
The multi-part identifier "s.TCK_NR" could not be bound.

View 5 Replies

T-SQL (SS2K8) :: Split Value Into Two Columns

Mar 30, 2015

I want to display full name column as FirstName and LastName.

Eg if Full Name is Abhas Jadhav then i want to convert it into FirstName- Abhas and LastName - Jadhav

i.e. Before Space is FirstName and After Space is LastName.

View 9 Replies

Reporting Services :: Add Formula To Formula Bar In Excel

Sep 1, 2015

In SQL reporting, How do I add the formula in the Formula bar?All the data is coming from a sproc.

View 3 Replies

How To Get Time Spent Inside And Outside

Mar 26, 2014

I have a simple table (SQL Server 2005) which stores employees clock-ins and clock-outs throughout the day:

+------------------------------------------+
¦ Employee ¦ PunchDateTime ¦ ActionType ¦
¦----------+------------------+------------¦
¦ John ¦ 2014/03/26 08:00 ¦ IN ¦
¦ Mark ¦ 2014/03/26 08:12 ¦ IN ¦
¦ John ¦ 2014/03/26 08:50 ¦ OUT ¦
¦ John ¦ 2014/03/26 09:29 ¦ IN ¦
¦ Mark ¦ 2014/03/26 10:35 ¦ OUT ¦
¦ John ¦ 2014/03/26 10:55 ¦ OUT ¦
¦ Mark ¦ 2014/03/26 11:42 ¦ IN ¦
¦ John ¦ 2014/03/26 12:38 ¦ IN ¦
¦ John ¦ 2014/03/26 16:21 ¦ OUT ¦
¦ Mark ¦ 2014/03/26 16:49 ¦ OUT ¦
+------------------------------------------+

I want build a query that calculates time spent in and out. The end result should look like this:

+-------------------------------------------------------------+
¦ Employee ¦ PunchDateTime ¦ ActionType ¦ TimeIn ¦ TimeOut ¦
¦----------+------------------+------------+--------+---------¦
¦ John ¦ 2014/03/26 08:00 ¦ IN ¦ - ¦ - ¦
¦ Mark ¦ 2014/03/26 08:12 ¦ IN ¦ - ¦ - ¦
¦ John ¦ 2014/03/26 08:50 ¦ OUT ¦ 00:40 ¦ - ¦
¦ John ¦ 2014/03/26 09:29 ¦ IN ¦ - ¦ 00:39 ¦
¦ Mark ¦ 2014/03/26 10:35 ¦ OUT ¦ 02:23 ¦ - ¦
¦ John ¦ 2014/03/26 10:55 ¦ OUT ¦ 01:26 ¦ - ¦
¦ Mark ¦ 2014/03/26 11:42 ¦ IN ¦ - ¦ 01:07 ¦
¦ John ¦ 2014/03/26 12:05 ¦ IN ¦ - ¦ 01:10 ¦
¦ John ¦ 2014/03/26 16:21 ¦ OUT ¦ 04:16 ¦ - ¦
¦ Mark ¦ 2014/03/26 16:49 ¦ OUT ¦ 05:07 ¦ - ¦
+-------------------------------------------------------------+

I need the total time spent IN and total time spent OUT, for each day.

The time spent will be calculated only for valid pairs of INs and OUTs, eliminating those that can't be paired (two or more consecutive INs/OUTs).

The results need to be by user, per one day. If the interval is longer than one day, the total time spent must be calculated for each day.

View 20 Replies

Generate Script Of All Indexes In A Particular Database In Format

Jul 15, 2015

I am in need to generate script of all the indexes in a particular database in the format "if not exist ....create index" format.I tried to google this I get for missing indexes, fragmentation level all that extra stuff, I need only in the format of "The script should be in "if not exist ....create index" format for a single database.

View 6 Replies

Reporting Services :: Creating A Child Column Group In A Table?

Nov 9, 2015

I have the following column values (which represent the hours in a day) - 

I want to be able to create a "child group" which would create 15 minute interval values under each hour, like - 

0   15   30    45    60 

So these would repeat under, each "hour" column value.

How can I do this ?

View 7 Replies

Reporting Services :: Space Between Every Account Number

May 8, 2015

How could I enter finger space between every account numbers ?

View 4 Replies



Copyrights 2005-15 www.BigResource.com, All rights reserved