Need Help Getting Unique Daily Traffic Numbers

Sep 7, 2007

I have a database of details of users that visit my site. Among other things, it saves the ipaddress and the date/time of the visit. I would like to be able to determine the unique visitors (by ipaddress) that i have on any given day. The problem though is that the data is saved as a date and a time, thus when I try and determine the unique visitors, since they are all a different time, MSSQL thinks they are all unique visitors. Any ideas how I can get around this without acctually modifying the data in the underlying table?

View 1 Replies


ADVERTISEMENT

Generate Unique Numbers

May 1, 2008

Hi

Hi

I am using sqlserver 2005 and want to generate unique numbers for all the records in a table using sql.

Something like table A has


Code:

FRUITS
-------------
Oranges
Mangoes
Apricots
....

I want to write a sql query that does something like

SELECT convert(varchar(8),getdate(),12)+'000001' my_number,
fruits
from table A

so the output is


[code]
my_number Fruits
080501000001 Oranges
080501000002 Mangoes
080501000003 Apricots
[code]

is there a way to do this without resorting to identity columns

View 3 Replies View Related

Generate Unique Numbers For Each Record

May 1, 2008

Hi

I am using sqlserver 2005 and want to generate unique numbers for all the records in a table using sql.

Something like table A has



FRUITS
-------------
Oranges
Mangoes
Apricots
....



I want to write a sql query that does something like

SELECT convert(varchar(8),getdate(),12)+'000001' my_number,
fruits
from table A

so the output is


my_number Fruits
080501000001 Oranges
080501000002 Mangoes
080501000003 Apricots
....


regards
Hrishy

View 4 Replies View Related

Assigning Unique Sequence Numbers Across Different Tables

Oct 11, 2007

I have a procedure which updates a sequence number in a table such as the one below.


Seq Sequence_Id

------ ------------------
NextNum 1


This is the procedure ...

create procedure DBO.MIG_SYS_NEXTVAL(@sequence varchar(10), @sequence_id int)
as
begin

update mig_sys_sequences
set
@sequence_id = sequence_id = sequence_id + 1
where
seq = 'CSN'

return(@sequence_id)
end


The purpose of this is to generate a sequential number each time the procedure is called. This number would then be used in a number of different tables to allocate a unique id so that the id is unique across the different tables.


1). What is the most efficient way of allocating these unique ids? The tables that I plan to update will already be populated with data.

2). How would I call the above procedure from an UPDATE statement?

Many thanks,

Fred

View 1 Replies View Related

SQL Server 2012 :: Use Unique Custom Error Numbers For THROW Statements?

Apr 20, 2015

My team is starting to implement error handling in our sprocs. One question we have is whether or not to use unique error numbers for custom errors (ie Errors we throw after doing some sort of validity check, not SQL Server errors). For example, we might check the value of a parameter and then throw an error that says "Parameter State_Date must be less than today, please retry".

We are using SQL Server 2012 and will be using the THROW statement, not RAISERROR, so we don't HAVE to put the numbers in sys.messages. Also, we are going to log the errors in a table, along with the error message, sproc name, line number, etc.

Is it useful to maintain a custom list of error numbers and messages? Or is it just as useful to use one standard error number and add a custom error message (which we can then search for in our code, or use the sproc name & line number we logged)? And if it is worth maintaining a list of numbers plus messages, should we go ahead and put them in sys.messages?

View 2 Replies View Related

Formatting Numbers In A Mixed Column (numbers In Some Cells Strings In Other Cells) In Excel As Numbers

Feb 1, 2007

I have a report with a column which contains either a string such as "N/A" or a number such as 12. A user exports the report to Excel. In Excel the numbers are formatted as text.

I already tried to set the value as CDbl which returns error for the cells containing a string.

The requirement is to export the column to Excel with the numbers formatted as numbers and the strings such as "N/A' in the same column as string.

Any suggestions?



View 1 Replies View Related

Ip Traffic..

Sep 21, 2000

What sort of traffic would be going on between the machine I am on Enterprise Manager and have a server registered (my local machine) to the actual SQL server? I haven't logged onto the actual SQL machine I only have it listed as a registered server and it's sitting there in the list with it's little green "started" icon.

I'm asking because i'm getting accused for a server going down. I opened my EM around the same time as this SQL server went down and some network people see my machine talking to the SQL server at the same time.

Any ideas? Thanks...

View 4 Replies View Related

Tcp Traffic

Jul 20, 2005

Hi,The application setup is: Access frontend + ODBC (TCP/IP) + MSSQL7Few days ago i was informed that the app generates high networktraffic. Thusi started to look for some savings.I found out (sniffer) that even if the client is idle every 30sek. aTCP packet comes from client to server, then answer goes back. Thepacket seems to be empty (TCP data is 1 byte: 0x00), the answer isempty as well. Seems like kind of watchdog. And it does not seem to berelated to ODBC refresh and any other option possible for setup inAccess client (I set those settings to different that 30sek. values,and 30 sek. traffic still exists).Does anybody know what those packets are for, what module isresponsible for them and how to change interval?My best regards for anybody reading this post,Mirek

View 6 Replies View Related

Query Analyzer Shows Negative Numbers As Positive Numbers

Jul 20, 2005

Why does M$ Query Analyzer display all numbers as positive, no matterwhether they are truly positive or negative ?I am having to cast each column to varchar to find out if there areany negative numbers being hidden from me :(I tried checking Tools/Options/Connections/Use Regional Settings bothon and off, stopping and restarting M$ Query Analyer in betwixt, butno improvement.Am I missing some other option somewhere ?

View 7 Replies View Related

Database Traffic

Sep 21, 2006

I am having a problem and this may be more of a network issue bandwidth issue: When I ping from one of my dataservers to another dataserver it takes 10ms. However, if I ping from a fileserver to a dataserver it takes 1ms. Also, if I ping from a Citrix server to another Citrix server or one of the data servers, it also takes 10ms. What are my options?

View 1 Replies View Related

I Need To Update A Table With Random Numbers Or Sequential Numbers

Mar 11, 2008



I have a table with a column ID of ContentID. The ID in that column is all NULLs. I need a way to change those nulls to a number. It does not matter what type of number it is as long as they are different. Can someone point me somewhere with a piece of T-SQL that I could use to do that. There are over 24000 rows so cursor change will not be very efficient.

Thanks for any help

View 6 Replies View Related

Routing SQL Traffic And Replication

Oct 15, 1999

Can anyone HELP!!
I have a system set up with 2 servers, the master server replicating the data to the backup server. Each server has two network cards, 1 which links directly to the other server.
The problem is the replication is being routed round the network making the direct link useless.
How can this be ammended!!
They are both logging into the same primary controler.

I am open to sugestions

View 1 Replies View Related

Emulate Production Traffic

Nov 2, 2007

OK, I'm troubleshooting a performance issue on one of our production servers, but I really can't t-shoot and tweak in real-time, so I took a snapshot of "a day in the life of" my production server using the profiler.

I want to run the sql commands I collected on another server I set up identical to production, and play around there.

Does anyone know of a good tool to "replay" those captured commands onot another server?

___________________________
Geek At Large

View 2 Replies View Related

Mirroring Dedicated Traffic

Oct 27, 2006

We are using the following configuration:



2 stand alone Windows 2003 servers 64 bit.

Each have two Gig Network cards configured with different IP addresses.

Each running multiple instances of SQL Server 64.

I am trying to set up a mirror where mirroring traffic between servers will be dedicated to a secondary IP address on the second NIC.

I am also trying to avoid Windows authentication.

Interesting enough: Security Configuration screen suggesting you to use fully qualified TCP addresses and, at the same time, does not give you such an option...

Would someone please point me in the right direction?

Thank you.

View 11 Replies View Related

Encrypt/ Decrypt Network Traffic.

Aug 8, 2006

I can sucessfully encrypt/ decrypt 1 column, but Im under the impression there is also a way to encrypt the data being sent over the network by using a certificate? I can find lots of info, but no starting point or clear cut instructions. Could someone please assist?

TIA, cfr

View 2 Replies View Related

Forward All SQL Traffic Through A Single Point.

Jun 15, 2007

Hello, we are trying to find a way to send all SQL traffic from multiple machines in a DMZ trough only one point. This way the firewall doesn't need to be opened to each and every machine.

This may be a simple question but I have never done it before. Any recommendations?

Thanks in advance.

View 4 Replies View Related

SQL To List Technicians And Traffic Controllers

Sep 26, 2007

Query(a report) to list the technicians/traffic controllers separately with following details.

EmployeeId,Name,Salary,Address,UnionId, and the most recent medical examination date for traffic controllers

Employee (EmployeeId(p),Name,Salary,Tpye).
MedicalExamination(MedicalNo(p),EmployeeId,MedicalDate)
EmployeeUnion(EmployeeId(p),UnionId(p))

"Type" field in Employee table tells whether its a technicians or a traffic controller.only traffic controllers has medical examination.

View 1 Replies View Related

SQL To List Technicians And Traffic Controllers

Sep 26, 2007

Query(a report) to list the technicians/traffic controllers separately with following details.

EmployeeId,Name,Salary,Address,UnionId, and the most recent medical examination date for traffic controllers

Employee (EmployeeId(p),Name,Salary,Tpye).
MedicalExamination(MedicalNo(p),EmployeeId,MedicalDate)
EmployeeUnion(EmployeeId(p),UnionId(p))

"Type" field in Employee table tells whether its a technicians or a traffic controller.only traffic controllers has medical examination.

View 1 Replies View Related

SQL Authentication Traffic For Mixed Mode

Aug 19, 2005

Hello,

View 4 Replies View Related

DB Engine :: Monitoring Data Traffic Over 24h Period

Nov 13, 2015

I looking for a way of measuring how many MB of outbound SQL data is being transferred during the course of a day from an OLTP instance.  Data is pulled from this server by a DW in the same domain and adhoc via a linked server. I'm looking at perfmon but nit sure if this is the correct tool and if so which counters to use.  I'm looking for the total MB/GB over the period not the MB per sec. 

View 2 Replies View Related

Recommended Setup For NIC Heartbeats / Mirroring Traffic

Jun 6, 2007

Would anyone have a suggestion on how to setup a partner to partner NIC configuration for heartbeats/mirroring traffic? I've been told this is the recommended setup but have not found much on how to do it. We currently have a teamed NIC config for redundancy, but would like to have a separate set of NICs on each partner so that mirroring traffic is not interrupted by any regular network traffic.



We also have a witness running in full safety mode. Does this mean partnerA and partner B both need NICs with a crossover cable between them AND is it recommended for the witness to also have extra NICs to both partnerA and partnerB (w/ crossover cables)?



Any suggestions/help/links on properly configuring this would be appreciated.

View 1 Replies View Related

SQL 2012 :: Separate Vlan For Replication Traffic On AlwaysOn?

Jun 3, 2015

Ive read a few docs and i have some doubts about the implementation i ll make.

I will setup a FCI between ServerA and ServerB. So my databases will be running on server A or on ServerB. they will be replicated using AllwaysON to ServerC.

Because ill use a diferent vlan for AllwaysON replication iam having some doubts on how can i set the endpoints...

For example.

I ll have the following ips configured for AllwaysON replication on Server A, Server B and Server C 10.10.240.1/10.10.240.2/10.10.240.3

Database teste will be running on serverA. the endpoint configured will be 10.10.240.1 but when database fails over to Server B (using FCI) the ip configured there will be 10.10.240.2... so AO replication will stop working.

I tough on associating a virtual ip to the AllwaysON cluster resource but Microsoft doesn't recommend to alter AllwaysON cluster resource.

How can i implement this configuration?

View 4 Replies View Related

SQL On Another Server, Two NICS, How Do I Use A Crossover Cable To Dedicate Traffic?

Oct 21, 2007



I have been told that I need to setup a crossover cable between a Server that has an application to have a dedicated NIC (using a crossover cable) to a server that has SQL 2005 Sp2 for fast access. How is htis done as far as SQL Properties, and NIC Settings, How do I make sure SQL will transmit using that 2nd NIC?

Thanks,
David Baur

View 1 Replies View Related

Generate List Of All Numbers (numbers Not In Use)

Feb 21, 2007

I have an 'ID' column. I'm up to about ID number 40000, but not all are in use, so ID 4354 might not be in any row. I want a list of all numbers which aren't in use. I want to write something like this:

select [numbers from 0 to 40000] where <number> not in (select distinct id from mytable)


but don't know how. Any clues?

View 1 Replies View Related

Dataflow To Excel - Convert Numbers Stored As Text To Numbers Excel Cell Error

Mar 27, 2007

I'm trying to write data to excel from an ssis component to a excel destination.

Even thought I'm writing numerics, every cell gets this error with a green tag:

Convert numbers stored as text to numbers

Excel Cells were all pre-formated to accounting 2 decimal, and if i manually type the exact data Im sending it formats just fine.

I'm hearing this a common problem -

On another project I was able to find a workaround for the web based version of excel, by writing this to the top of the file:

<style>.text { mso-number-format:@; } </style>

is there anything I can pre-set in excel (cells are already formated) or write to my file so that numerics are seen as numerics and not text.

Maybe some setting in my write drivers - using sql servers excel destination.


So close.. Thanks for any help or information.

View 1 Replies View Related

SQL Server 2012 :: Failing On Update With Unique Index Error (Not Unique)

Jul 5, 2015

This index is not unique

ix_report_history_creative_id

Msg 2601, Level 14, State 1, Procedure DFP_report_load, Line 161
Cannot insert duplicate key row in object 'dbo.DFP_Reports_History' with unique index 'ix_report_history_creative_id'.

The duplicate key value is (40736326382, 1, 2015-07-03, 67618862, 355324).
Msg 3621, Level 0, State 0, Procedure DFP_report_load, Line 161

The statement has been terminated.

Exception in Task: Cannot insert duplicate key row in object 'dbo.DFP_Reports_History' with unique index 'ix_report_history_creative_id'. The duplicate key value is (40736326382, 1, 2015-07-03, 67618862, 355324).

The statement has been terminated.

View 6 Replies View Related

SQL Server Admin 2014 :: Huge Traffic Between Share Point Front End Servers To Content Database?

Feb 20, 2014

We have a Customized share point application with Very minimal data usage and we have used only 5 to 6 lists and libraries only in the share point.

Configuration is

Clients -- fire wall --- Load Balancer ---- WF1 and WF2 --- SQL DB

ROUTING IS VIA FIRE WALL.

SUDDENLY THE SITE GOT DEAD SLOW AND UNABLE TO TRACE THE PROBLEM AS EVERY THING LOOKS FINE.

Checked with the firewall Team and they stated its fine from their end & even we have verified the counters, CPU, Memory & Page life expectancy, buffer counters all looks good and even we do not have huge data in the database. We have only 50 concurrent users are working...

View 2 Replies View Related

What Is The Difference Between A UNIQUE INDEX And A UNIQUE CONSTRAINT?

Sep 22, 2004

A UNIQUE INDEX must inherently impose a unique constraint and a UNIQUE CONSTRAINT is most likely implemented via a UNIQUE INDEX. So what is the difference? When you create in Enterprise Manager you must select one or the other.

View 8 Replies View Related

Unique Constraint Vs Unique Index In MS SQL 2000

Jul 20, 2005

HelloWhat should I use for better perfomance sinceunique constraint always use index ?ThanksKamil

View 5 Replies View Related

Unique Constraint And Unique Index, What's The Difference?

Jun 24, 2006

What's the difference in the effect of the followings:
CREATE UNIQUE NONCLUSTERED INDEX
and
ALTER TABLE dbo.titles ADD CONSTRAINT
titleind UNIQUE NONCLUSTERED

I found there're two settings in Indexs/Keys dialog box of the management studio, Is Unique, and Type. The DDL statements above are generated by setting Is Unique to yes plus Type to Index, and just Type to Unique Key, respectively. What's the difference between them?

View 1 Replies View Related

Unique Index Vs Unique Constraint

Mar 7, 2001

Hi everyone,
I need urgent help to resolve this issue...
As far as the performance goes which one is better..
Unique Index(col1, col2) OR Unique constraint(col1, col2) ?
Unique constraint automatically adds a unique index
and unique index takes care of uniqueness then whats the use of unique constraint ?

Which one do one use ?

thanks
sonali

View 4 Replies View Related

Unique Constraint Vs Unique Index

Jan 20, 2006

BOL says a unique constraint is preferred over a unique index. It also states that a unique constraint creates a unique index. What then is the difference between the two, and why is a constraint preferred over the index?

View 2 Replies View Related

Unique Index Vs Unique Constraints

Mar 26, 2008



hi team,
.Can i create umique constraint with out unique index.when i am creating a unique constraint sql creates a unique index (default) can i have only unique constraint ?

View 12 Replies View Related







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