Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts

Monday, March 26, 2012

Reseting the Auto-Number for a table back to zero and Compact/Repair or Unload/Reload for

After deleting all the test data from all tables in a SQL 2000 database, is there a way to reset all the auto-incrementing fields back to zero in one shot? In Access, you can run the Compact and Repair option. Also, in Sybase SQL, there was an "unload/reload" option to reduce the database size. Is there a similar function in SQL2000? Thanks for all the help

Try to use truncate instead of delete to remove records from your table, it will remove records and reset identity fields to starting values.

Thanks

Wednesday, March 21, 2012

Reserver Characters

When saving characters to text or char fields are there any reserved
characters which i should watch out for when using ODBC to store data to SQL
2000 server.
I MySql you have to add and escape character before before the character to
avoid problems.
Regards
Jeff
--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004THe only character is the quote.. SQL Strings are quoted... Just double the
quote ( 2 single quotes) to include a single quote in a quoted string.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jeff Williams" <jeff.williams@.hardsoft.com.au> wrote in message
news:eX08dq47DHA.1804@.TK2MSFTNGP12.phx.gbl...
> When saving characters to text or char fields are there any reserved
> characters which i should watch out for when using ODBC to store data to
SQL
> 2000 server.
> I MySql you have to add and escape character before before the character
to
> avoid problems.
> Regards
> Jeff
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004
>

Reserver Characters

When saving characters to text or char fields are there any reserved
characters which i should watch out for when using ODBC to store data to SQL
2000 server.
I mysql you have to add and escape character before before the character to
avoid problems.
Regards
Jeff
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004THe only character is the quote.. SQL Strings are quoted... Just double the
quote ( 2 single quotes) to include a single quote in a quoted string.
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jeff Williams" <jeff.williams@.hardsoft.com.au> wrote in message
news:eX08dq47DHA.1804@.TK2MSFTNGP12.phx.gbl...
> When saving characters to text or char fields are there any reserved
> characters which i should watch out for when using ODBC to store data to
SQL
> 2000 server.
> I mysql you have to add and escape character before before the character
to
> avoid problems.
> Regards
> Jeff
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004
>

Friday, March 9, 2012

Requery Parameter Fields

I have a report that runs on a number of parameter date fields (coverted to string). At present, the report automatically defaults to MAX value of a date. The syntax for that particular element/dataset is

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
FROM tbl_src_date

What I am looking to acheive is that if I was to modify the parameter to allow the user to specifiy a date from that particular field (rather than default to MAX), how could I get the subsequent parameter boxes to requery automatically. The code I use for the other 5 parameter fields is;

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
, CONVERT(char(11), dateadd(mm,-1, MAX(src_date))) AS src_date_pre
FROM tbl_src_date

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
, CONVERT(char(11), dateadd(mm,-2, MAX(src_date))) AS src_date_pre2
FROM tbl_src_date

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
, CONVERT(char(11), dateadd(mm,-3, MAX(src_date))) AS src_date_pre3
FROM tbl_src_date

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
, CONVERT(char(11), dateadd(mm,-4, MAX(src_date))) AS src_date_pre4
FROM tbl_src_date

SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur
, CONVERT(char(11), dateadd(mm,-5, MAX(src_date))) AS src_date_pre5
FROM tbl_src_date

If it makes a difference I am using SS-RS 2005.

Regards

Make them source from a dataset which has a dependency on the Parameter. This will create a hierarchy, whereas the first parameter value (e.g. a datetime picker has to be selected first)

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

Wednesday, March 7, 2012

Repoting Services

I have a question.

Can I hide columns or fields , when there are too many fields in the data set . I want to take all fields but hide some in preview tab.Please somebody help me on this.

Thanks

Sudha

You can set the Hidden property to true. you can do this at the column level, and it will not show up.

BobP