Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Tuesday, March 27, 2012

Basic Question about password and logon command

I have running SQL queries all day and have been getting tired of selecting the DATA SOURCE NAME and then having to type in the appropriate password. What can I add to my SQL command to do this for me?
Thanks for the help!
NormDo you mean like a connect line in your script?|||Originally posted by exdter
Do you mean like a connect line in your script?

Yes, exactly|||Is this what you mean?
The first line of your script should be
conn[ect] user/password/database
The problem with this is that your password won't be encrypted, so someone can see it.
I hope this helps.|||Originally posted by exdter
Is this what you mean?
The first line of your script should be
conn[ect] user/password/database
The problem with this is that your password won't be encrypted, so someone can see it.
I hope this helps.

Forgive my ignorance but I don't think I asked for the right thing.

Here's what I'm looking at....

I'm in Access and I run an SQL query such as:

select COUNT(*) from employee_data where title = 'Programmer'

and the next thing you know is a window pops up where I need to click on the "Machine Data Source" tab and then the appropriate "Data Source Name" which then has me type in my password.

Thanks for the help.

Norm|||Oh, sorry. I can't help with that one.
I don't know Access.

Basic Parameter

This is a beginning type of question - I am trying to set up a parameter that
will contain 5 numeric digits. As the user starts typing i.e. a 3 I would
like to see 30000 appear, then if they type a 1 then 31000 will appear, next
if they type a 2 then I would see 31200 then a 5 they would see 31250 and
lastly if they typed a 1 then 31251 would appear in the list and when they
hit enter that would be the number of the work order that appears.
Thank you.On Nov 8, 3:49 pm, NormaD <Nor...@.discussions.microsoft.com> wrote:
> This is a beginning type of question - I am trying to set up a parameter that
> will contain 5 numeric digits. As the user starts typing i.e. a 3 I would
> like to see 30000 appear, then if they type a 1 then 31000 will appear, next
> if they type a 2 then I would see 31200 then a 5 they would see 31250 and
> lastly if they typed a 1 then 31251 would appear in the list and when they
> hit enter that would be the number of the work order that appears.
> Thank you.
Unfortunately, this type of functionality does not exist in SSRS/
Reporting Services (aside from standard auto-complete in your browser,
which isn't quite the same thing). The best way to create this
functionality is to create a custom ASP.NET application that does this
via callback/postback. Sorry that I could not be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Sunday, March 25, 2012

Basic data type question

What type of field do I create for OLE objects? (text,
ntext...) What field size?
thksJanice,
text,ntext and image sare the BLOB data types in SQL Server.ntext can
support unicode data and thats the only difference between ntext and text
while image datatype is used to store binary data .text and image support
upto 2GB and there isnt any need to specify the field size while ntext, in
terms of storage size, is two times the number of characters entered.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Janice Gilbert" <jgilburt@.yahoo.com> wrote in message
news:080501c33f26$d85d0db0$a001280a@.phx.gbl...
> What type of field do I create for OLE objects? (text,
> ntext...) What field size?
> thks

Tuesday, March 20, 2012

BAFFLED! Why won't this code work?!?!

Aaron and Tibor - Thank you for your replys.
Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
thank you.
Tibor, so then making the entire table name a variable (rather than
just part of it) should solve the problem, right? The below code
attempts to make this change. Now getting the following error:
"Syntax error converting the varchar value 'tblIR_LB_' to a column of
data type smallint."
CREATE PROC CreateIRTables ( @.tblname varchar(50))
AS
DECLARE @.SQL varchar(999)
SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
[dteDate] [smalldatetime] NULL ,
[sglSTDEV(upper)] [float] NULL ,
[sglSTDEV(lower)] [float] NULL ,
[intMA] [smallint] NULL ,
[dblPL] [float] NULL ,
[dblSTDEV] [float] NULL ,
[dblIR] [float] NULL ,
[intTotalDays] [int] NULL ,
[intExposure] [int] NULL ) ON [PRIMARY]'
EXEC (@.SQL)
DECLARE @.i smallint
DECLARE @.tblname varchar(50)
SET @.i = 1
WHILE (@.i <= 32)
BEGIN
SET @.tblname = 'tblIR_LB_' + @.i
EXECUTE CreateIRTables @.tblname
SET @.i = @.i + 1
ENDEXACT SAME PROBLEM, you've just moved it to a different place! You're
trying to add an integer to a string. You can't do this!

> SET @.tblname = 'tblIR_LB_' + @.i
Should be
SET @.tblname = 'tblIR_LB_' + CONVERT(VARCHAR(12),@.i)|||i think you are chasing a red herring, but I wil point out this error :)
SET @.tblname = 'tblIR_LB_' + @.i
^ @.I is a small int
SET @.tblname = 'tblIR_LB_' + CAST(@.i As varchar)
My suggestion to see what is happening .... return your @.SQL as an output
paramer and print it each time.
if it *was* giving you the error on tblIR_LB_2 then I assume tblIR_LB_1
worked? So, see what is happening by looking at the @.SQL. PRINT it as an
output variable and run the code directly.
Good luck.
John Scragg
"Butaambala" wrote:

> Aaron and Tibor - Thank you for your replys.
> Aaron, the tbl-vs-tblname issue and data type were silly mistakes -
> thank you.
> Tibor, so then making the entire table name a variable (rather than
> just part of it) should solve the problem, right? The below code
> attempts to make this change. Now getting the following error:
> "Syntax error converting the varchar value 'tblIR_LB_' to a column of
> data type smallint."
> CREATE PROC CreateIRTables ( @.tblname varchar(50))
> AS
> DECLARE @.SQL varchar(999)
> SET @.SQL = 'CREATE TABLE [dbo].[' + @.tblname + '] (
> [dteDate] [smalldatetime] NULL ,
> [sglSTDEV(upper)] [float] NULL ,
> [sglSTDEV(lower)] [float] NULL ,
> [intMA] [smallint] NULL ,
> [dblPL] [float] NULL ,
> [dblSTDEV] [float] NULL ,
> [dblIR] [float] NULL ,
> [intTotalDays] [int] NULL ,
> [intExposure] [int] NULL ) ON [PRIMARY]'
> EXEC (@.SQL)
>
> DECLARE @.i smallint
> DECLARE @.tblname varchar(50)
> SET @.i = 1
> WHILE (@.i <= 32)
> BEGIN
> SET @.tblname = 'tblIR_LB_' + @.i
> EXECUTE CreateIRTables @.tblname
> SET @.i = @.i + 1
> END
>

Monday, March 19, 2012

Bad practice for data sources?

I'm just wondering if it is bad programming practice to have many data sources on one page. I need a "Matrix" type of page that grabs data from many tables and so far I have 5 data sources. Is this common or is there something I should be doing to make it more efficient?That's not unbelievable, I think the most I have in my pages currently is 4 or 5. Mostly for filling dropdowns, and then a grid control, and then maybe a couple more to fill dropdowns in the gridcontrol when it's in edit mode.

Bad page ID

<<Server: Msg 8946, Level 16, State 12, Line 2
Table error: Allocation page (1:6195408) has invalid
PFS_PAGE page header values.
Type is 0. Check type, object ID and page ID on the page.>>
The above error seems to indicate that I can check the
header values of this page.
How do I do that?
Many thanks.The message should really be "Have your support provider check the ..."
You can search for DBCC PAGE on the Net.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Karl" <kekurzenknabe@.hotmail.com> wrote in message news:2f6f01c373d6$f67b09c0$a601280a@.phx.gbl...
> <<Server: Msg 8946, Level 16, State 12, Line 2
> Table error: Allocation page (1:6195408) has invalid
> PFS_PAGE page header values.
> Type is 0. Check type, object ID and page ID on the page.>>
> The above error seems to indicate that I can check the
> header values of this page.
> How do I do that?
> Many thanks.|||Looks like you've got a corrupt PFS page. This problem cannot be
automatically repaired (even with REPAIR_ALLOW_DATA_LOSS) so you need to
restore your database from a backup after working out why the problem
occurred (check your event logs, the errorlog, run hardware diagnostics) -
or call PSS to help you.
--
Paul Randal
DBCC Technical Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se>
wrote in message news:eH7TZYhdDHA.416@.tk2msftngp13.phx.gbl...
> The message should really be "Have your support provider check the ..."
> You can search for DBCC PAGE on the Net.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at: http://groups.google.com/groups?oi=djq&as
ugroup=microsoft.public.sqlserver
>
> "Karl" <kekurzenknabe@.hotmail.com> wrote in message
news:2f6f01c373d6$f67b09c0$a601280a@.phx.gbl...
> > <<Server: Msg 8946, Level 16, State 12, Line 2
> > Table error: Allocation page (1:6195408) has invalid
> > PFS_PAGE page header values.
> > Type is 0. Check type, object ID and page ID on the page.>>
> >
> > The above error seems to indicate that I can check the
> > header values of this page.
> >
> > How do I do that?
> >
> > Many thanks.
>

Friday, February 24, 2012

BackupIoRequest::WaitForIoCompletion - Unable to find ryme or reason!

Event Type: Error
Event Source: MSSQLServer
Event Category: (6)
Event ID: 17055
Date: 8/11/2002
Time: 8:00:08 PM
User: xxxxxxxxxx
Computer: xxxxxxxxxx
Description:
18210 :
BackupIoRequest::WaitForIoCompletion: read failure on backup
device 'd:\mssql7\data\Debtors_Data.MDF'. Operating system error 1453
(Insufficient quota to complete the requested service.).

This is the event log view from a SQL7 No service pack server on a W2k server SP2.

The D: drive where the backup file is going has over 13GB free !

Has any one else had this error ? M$ have no information :(

Cheers

DaveRE:
read failure on backup device 'd:\mssql7\data\Debtors_Data.MDF'. Operating system error 1453 (Insufficient quota to complete the requested service.).
This is the event log view from a SQL7 No service pack server on a W2k server SP2.
The D: drive where the backup file is going has over 13GB free !
Has any one else had this error ? M$ have no information

Q1 Has any one else had this error ?
A1 This looks like it may be a disk quota related error.

Q2 The D: drive where the backup file is going has over 13GB free!
A2 Fine, but if disk quotas are enabled, how much is available on the D:\ drive for the service account under which sql server is running?

S1 Are you able to complete any (small) backup dumps? (If not, some DB may have already grown to meet an existing quota limit.)

S2 Try deleteing all existing backup files and then attempt a (very small) backup dump, say for master.|||Hi,

No Quota's are enabled

The 'Job' ran successfully the following morning after the initial error.

This morning (Tuesday) the Job ran successfully.

I am thinking that the Quota reference is 'system resources' rather than disk quota.

I think that even though the source is MSSQLSERVICE i believe its a W2K issue.

OS W2K SP2
1x 1Ghz CPU
Memory 2GB
Hardware RAID
2x Database.
Cataloging 3,2xx,xxx records (manual incremental population)

I have read where people have Service Packed there OS to SP3 but this still doesnt fix [there] problem

Dave|||RE:
Hi, No Quota's are enabled
The 'Job' ran successfully the following morning after the initial error.
This morning (Tuesday) the Job ran successfully.
I am thinking that the Quota reference is 'system resources' rather than disk quota. I think that even though the source is MSSQLSERVICE i believe its a W2K issue.

OS W2K SP2
1x 1Ghz CPU
Memory 2GB
Hardware RAID
2x Database.
Cataloging 3,2xx,xxx records (manual incremental population)

I have read where people have Service Packed there OS to SP3 but this still doesnt fix [there] problem Dave

Q1 [No Quota's are enabled]
A1 That's too bad it would have been an easy fix.

Q2 [I am thinking that the Quota reference is 'system resources' rather than disk quota. I think that even though the source is MSSQLSERVICE i believe its a W2K issue.]
A2 Well yes, kind of (probably); the API likely ends up calling the same lower level drivers in any case.

S1 The issue may also be related to driver corruption, driver coding issues / bugs and / or authentication and / or ACL issues. If you happen to have also very recently updated any disk / array drivers, you might consider either attempting to refresh the driver update(s) and / or undoing them?
As far as I understood there (were / are in 99 / 00?) some issues having to do with "IO set completion" that had / have something to do with switches between different levels of kernel drivers that array controller drivers initiate (maybe related, maybe not?).
As to authentication, I've seen (and experienced) problems with some network domains wherein every now and then the (domain controller?) decides the Sql Server / service account doesn't have the neccessary rights to dump wherever (usually, but not always, also accompanied by logon failures in the event log), which causes similar issues.|||Event Type: Error
Event Source: MSSQLServer
Event Category: (6)
Event ID: 17055
Date: 8/11/2002
Time: 8:00:08 PM
User: xxxxxxxxxx
Computer: xxxxxxxxxx
Description:
18210 :
BackupIoRequest::WaitForIoCompletion: read failure on backup
device 'd:\mssql7\data\Debtors_Data.MDF'. Operating system error 1453
(Insufficient quota to complete the requested service.).

This is the event log view from a SQL7 No service pack server on a W2k server SP2.

The D: drive where the backup file is going has over 13GB free !

Has any one else had this error ? M$ have no information :(

Cheers

Dave

Q1 This is the event log view from a SQL7 No service pack server?
A1 I missed that detail previously. If I read that correctly why is that? You may want to check out MS Q274310 (or "Why you may consider applying Service Pack 3 for Microsoft SQL Server 7.0")?

http://support.microsoft.com/default.aspx?scid=kb;EN-US;274310