Showing posts with label specifying. Show all posts
Showing posts with label specifying. Show all posts

Wednesday, March 28, 2012

its been a while since Ive used sql....

...and I was using mySql b4, but on ms sql server when you create a table whats the syntax for specifying a field that auto increments for each new record added?

'm trying the following:

1> create table maillist(id autoincrement(), email varchar)
2> go
Msg 170, Level 15, State 1, Server ****, Line 1
Line 1: Incorrect syntax near ')'.
1>IDENTITY is the keyword used in SQL Server


CREATE TABLE [dbo].[Debug] (
[DebugID] [int] IDENTITY (1, 1) NOT NULL ,
[DateEntered] [datetime] NULL ,
[Message] [nvarchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

|||i take it

dbo = the db name

debug = the table

dbugid = my field name

int = type

what is: on [primary]?|||what does the (1,1) signify?|||The seed value and incremental step for the identity column. (e.g starts from 1 and increases 1 at a time 1,2,3,4,5...)|||ahhh

I getcha :)|||dbo is the owner of the table (dbo is best).
Debug is the table.
debugid is the field name.

Primary is the file group (you can normally ignore it, this is script generated by the Enterprise Manager).

Monday, March 19, 2012

Issues Filtering a chart

I am trying to filter a series in a chart by specifying
a paramter. I am showing a chart where the data
returned from the SP has many employees, but I only
want the employee specified in the parameter. However,
when I enter the following:

=Parameters!employee_id.Value

into the filters tab for the employee series, the chart
is blank and I know for sure that there is data for the
employee I have specified in the parameter because
when I remove the filter, that employee shows up in
the legend along with 20 others.

This should be simple and it's driving me nuts!
Can someone point out what I'm doing wrong?

Turns out the SSRS "like" operator does not
ignore spaces like SQL does. I had spaces
coming back at the end of each employee so
I had to modify the above as follows:
=Parameters!employee_id.Value + "*"