Showing posts with label advance. Show all posts
Showing posts with label advance. Show all posts

Tuesday, March 20, 2012

adding subreports to master report at runtime

Hi guys,

Is it possible at runtime to decide what subreports you want in your master report. Is this possible in RS?. Many Thanks in advance.

It is possible to add or remove remove reports from reporting services at runtime. Though you can have all of them in your main report and controls its visibility using expressions.

Shyam

|||Many thanks for your response, but is there a way of dynamically adding multiple subreports to a master report without placing them all in a master and controlling visibility?|||

There was a typo in my earlier message. I actually meant that it is NOT possible to add or remove subreports from a main report at runtime. I'm afraid I may have to repeat it now.

Shyam

|||

Ok thanks, setting the visibilty does work, and is a current solution to the problem for now. Maybe the next version can deal with this. Many thanks for your response.

Kenny

|||Can you please mark this post as answered? Just click on Mark as Answer buttonsql

Sunday, March 11, 2012

Adding RDL to manager via .NET

Hi
is it possible to add a RDL-Report via a Window-Application to the report manager?
Thanks in advance!
Regards
AlexConsier using an RSS file with RS.exe, if you're okay with doing this via command-line
--
Message posted via http://www.sqlmonster.com

adding query results to email body using CDOSYSmail

Thanks in advance - Steve.
I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to preclude
using SQL Mail (as far as I know). So I've been working on using CDOSYSmail
to send email, and attachment, and the results from a stored procedure (a
set of queries that generates 6 summary reports with varying columns). I've
inserted the results from the stored procedure into a table called, results
varchar(4000).
I'm trying to insert the results from 'sproc_name' into the body of an email
and could use some help.
The stored procedure, 'usp_send_cdosysmail' is working fine except I can't
get the results from another stored procedure into the body of an email. The
table 'result' is one column varchar(4000); I'd prefer just executing the
'sproc_name' and avoid the cursor since i'm new to cursors. I receive the
error below:
Server: Msg 170, Level 15, State 1, Line 17
Line 17: incorrect syntax near @.body1
declare @.Body1 varchar(4000)
set @.Body1 = ''
declare r_cursor cursor for
select result from test.dbo.result
open r_cursor
declare @.r_return cursor
exec db_name.dbo.sproc_name @.r_return = OUTPUT
while (@.@.fetch_status=0)
begin
fetch next from @.r_return
end
close r_cursor
@.body1 = @.r_return
deallocate r_cursor
exec master..usp_send_cdosysmail
@.from='user1@.domain.com',
@.to ='user2@.domain.com',
@.subject ='Test',
@.body = @.body1,
@.attachments = 'C:\test.txt',
@.smtpserver = 'mailserver.domain.com',
@.bodytype ='TEXTBody' -- 'HTMLBody'Hi Steve
Assuming your result table is declared as something like:
CREATE TABLE dbo.result ( id int not null identity, result varchar(400))
Then each row returned from your stored procedure will be a separate row in
dbo.result. You can then cursor through the table and get each row.
INSERT INTO dbo.result (result)
EXEC dbo.sproc_name
DECLARE @.Body1 varchar(4000)
DECLARE @.lineresult varchar(400)
SET @.Body1 = ''
DECLARE r_cursor CURSOR FOR
SELECT result FROM dbo.result ORDER BY id
OPEN r_cursor
FETCH NEXT FROM r_cursor INTO @.Body1
WHILE @.@.FETCH_STATUS=0
BEGIN
FETCH NEXT FROM r_cursor INTO @.lineresult
SET @.Body1 = @.Body1 + CHAR(13) + CHAR(10) + @.lineresult
END
CLOSE r_cursor
DEALLOCATE r_cursor
John
"Steve" wrote:

> Thanks in advance - Steve.
> I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to preclu
de
> using SQL Mail (as far as I know). So I've been working on using CDOSYSma
il
> to send email, and attachment, and the results from a stored procedure (a
> set of queries that generates 6 summary reports with varying columns). I'v
e
> inserted the results from the stored procedure into a table called, result
s
> varchar(4000).
> I'm trying to insert the results from 'sproc_name' into the body of an ema
il
> and could use some help.
> The stored procedure, 'usp_send_cdosysmail' is working fine except I can't
> get the results from another stored procedure into the body of an email. T
he
> table 'result' is one column varchar(4000); I'd prefer just executing the
> 'sproc_name' and avoid the cursor since i'm new to cursors. I receive the
> error below:
> Server: Msg 170, Level 15, State 1, Line 17
> Line 17: incorrect syntax near @.body1
> declare @.Body1 varchar(4000)
> set @.Body1 = ''
> declare r_cursor cursor for
> select result from test.dbo.result
> open r_cursor
> declare @.r_return cursor
> exec db_name.dbo.sproc_name @.r_return = OUTPUT
>
> while (@.@.fetch_status=0)
> begin
> fetch next from @.r_return
> end
> close r_cursor
> @.body1 = @.r_return
> deallocate r_cursor
> exec master..usp_send_cdosysmail
> @.from='user1@.domain.com',
> @.to ='user2@.domain.com',
> @.subject ='Test',
> @.body = @.body1,
> @.attachments = 'C:\test.txt',
> @.smtpserver = 'mailserver.domain.com',
> @.bodytype ='TEXTBody' -- 'HTMLBody'
>
>|||Hi John - big thanks!
I did not have an id property, only a column entitled results with datatype
varchar(4000).
Cursors need an id column (i'm familiar w/ the identity property - very
handy).
For my education, wow do the char(13) an char(10) work inconjunction with
@.body1 and @.lineresult to concatenate all the rows together? I interpret
@.body1 as being all the previous rows and @.lineresult being the current row,
but don't understand how char(13) and char(10) impact the query?
Thanks!
Steve
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:81EFD80A-10CE-4308-B710-7ABB7E79FD53@.microsoft.com...
> Hi Steve
> Assuming your result table is declared as something like:
> CREATE TABLE dbo.result ( id int not null identity, result varchar(400))
> Then each row returned from your stored procedure will be a separate row
in[vbcol=seagreen]
> dbo.result. You can then cursor through the table and get each row.
> INSERT INTO dbo.result (result)
> EXEC dbo.sproc_name
> DECLARE @.Body1 varchar(4000)
> DECLARE @.lineresult varchar(400)
> SET @.Body1 = ''
> DECLARE r_cursor CURSOR FOR
> SELECT result FROM dbo.result ORDER BY id
> OPEN r_cursor
> FETCH NEXT FROM r_cursor INTO @.Body1
> WHILE @.@.FETCH_STATUS=0
> BEGIN
> FETCH NEXT FROM r_cursor INTO @.lineresult
> SET @.Body1 = @.Body1 + CHAR(13) + CHAR(10) + @.lineresult
> END
> CLOSE r_cursor
> DEALLOCATE r_cursor
> John
> "Steve" wrote:
>
preclude[vbcol=seagreen]
CDOSYSmail[vbcol=seagreen]
(a[vbcol=seagreen]
I've[vbcol=seagreen]
results[vbcol=seagreen]
email[vbcol=seagreen]
can't[vbcol=seagreen]
The[vbcol=seagreen]
the[vbcol=seagreen]
the[vbcol=seagreen]|||Hi
The id column will be necessary if you want to keep the order the same as
the order returned by the stored procedure. The CHAR(13) and CHAR(10) are to
add a carriage return and linefeed into your results, they have no impact on
the query as they are not part of it. If you don't need them then they can b
e
omitted, but then the columns may not align.
@.Body1 was the variable you used for the email body, if you return more than
one line then the cursor will loop through subsequent lines by returning the
m
in @.lineresult and then appending them to @.Body1. The first line returned ca
n
go straight into @.Body1.
I am not sure how big the body of your text could be, but if it is 4000
characters it may not be large enough for your needs. You may want to look a
t
creating a DTS package to create the files and (say) using XPSMTP to send it
http://www.sqldev.net/xp/xpsmtp.htm. It may be better to put the results int
o
a spreadsheet rather than leaving them as text, DTS can do this. See books
online for more information on DTS and check out
http://www.sqldts.com/default.aspx
John
"Steve" wrote:

> Hi John - big thanks!
> I did not have an id property, only a column entitled results with datatyp
e
> varchar(4000).
> Cursors need an id column (i'm familiar w/ the identity property - very
> handy).
> For my education, wow do the char(13) an char(10) work inconjunction with
> @.body1 and @.lineresult to concatenate all the rows together? I interpret
> @.body1 as being all the previous rows and @.lineresult being the current ro
w,
> but don't understand how char(13) and char(10) impact the query?
> Thanks!
> Steve
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:81EFD80A-10CE-4308-B710-7ABB7E79FD53@.microsoft.com...
> in
> preclude
> CDOSYSmail
> (a
> I've
> results
> email
> can't
> The
> the
> the
>
>

adding query results to email body using CDOSYSmail

Thanks in advance - Steve.
I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to preclude
using SQL Mail (as far as I know). So I've been working on using CDOSYSmail
to send email, and attachment, and the results from a stored procedure (a
set of queries that generates 6 summary reports with varying columns). I've
inserted the results from the stored procedure into a table called, results
varchar(4000).
I'm trying to insert the results from 'sproc_name' into the body of an email
and could use some help.
The stored procedure, 'usp_send_cdosysmail' is working fine except I can't
get the results from another stored procedure into the body of an email. The
table 'result' is one column varchar(4000); I'd prefer just executing the
'sproc_name' and avoid the cursor since i'm new to cursors. I receive the
error below:
Server: Msg 170, Level 15, State 1, Line 17
Line 17: incorrect syntax near @.body1
declare @.Body1 varchar(4000)
set @.Body1 = ''
declare r_cursor cursor for
select result from test.dbo.result
open r_cursor
declare @.r_return cursor
exec db_name.dbo.sproc_name @.r_return = OUTPUT
while (@.@.fetch_status=0)
begin
fetch next from @.r_return
end
close r_cursor
@.body1 = @.r_return
deallocate r_cursor
exec master..usp_send_cdosysmail
@.from='user1@.domain.com',
@.to ='user2@.domain.com',
@.subject ='Test',
@.body = @.body1,
@.attachments = 'C:\test.txt',
@.smtpserver = 'mailserver.domain.com',
@.bodytype ='TEXTBody' -- 'HTMLBody'Hi Steve
Assuming your result table is declared as something like:
CREATE TABLE dbo.result ( id int not null identity, result varchar(400))
Then each row returned from your stored procedure will be a separate row in
dbo.result. You can then cursor through the table and get each row.
INSERT INTO dbo.result (result)
EXEC dbo.sproc_name
DECLARE @.Body1 varchar(4000)
DECLARE @.lineresult varchar(400)
SET @.Body1 = ''
DECLARE r_cursor CURSOR FOR
SELECT result FROM dbo.result ORDER BY id
OPEN r_cursor
FETCH NEXT FROM r_cursor INTO @.Body1
WHILE @.@.FETCH_STATUS=0
BEGIN
FETCH NEXT FROM r_cursor INTO @.lineresult
SET @.Body1 = @.Body1 + CHAR(13) + CHAR(10) + @.lineresult
END
CLOSE r_cursor
DEALLOCATE r_cursor
John
"Steve" wrote:
> Thanks in advance - Steve.
> I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to preclude
> using SQL Mail (as far as I know). So I've been working on using CDOSYSmail
> to send email, and attachment, and the results from a stored procedure (a
> set of queries that generates 6 summary reports with varying columns). I've
> inserted the results from the stored procedure into a table called, results
> varchar(4000).
> I'm trying to insert the results from 'sproc_name' into the body of an email
> and could use some help.
> The stored procedure, 'usp_send_cdosysmail' is working fine except I can't
> get the results from another stored procedure into the body of an email. The
> table 'result' is one column varchar(4000); I'd prefer just executing the
> 'sproc_name' and avoid the cursor since i'm new to cursors. I receive the
> error below:
> Server: Msg 170, Level 15, State 1, Line 17
> Line 17: incorrect syntax near @.body1
> declare @.Body1 varchar(4000)
> set @.Body1 = ''
> declare r_cursor cursor for
> select result from test.dbo.result
> open r_cursor
> declare @.r_return cursor
> exec db_name.dbo.sproc_name @.r_return = OUTPUT
>
> while (@.@.fetch_status=0)
> begin
> fetch next from @.r_return
> end
> close r_cursor
> @.body1 = @.r_return
> deallocate r_cursor
> exec master..usp_send_cdosysmail
> @.from='user1@.domain.com',
> @.to ='user2@.domain.com',
> @.subject ='Test',
> @.body = @.body1,
> @.attachments = 'C:\test.txt',
> @.smtpserver = 'mailserver.domain.com',
> @.bodytype ='TEXTBody' -- 'HTMLBody'
>
>|||Hi John - big thanks!
I did not have an id property, only a column entitled results with datatype
varchar(4000).
Cursors need an id column (i'm familiar w/ the identity property - very
handy).
For my education, wow do the char(13) an char(10) work inconjunction with
@.body1 and @.lineresult to concatenate all the rows together? I interpret
@.body1 as being all the previous rows and @.lineresult being the current row,
but don't understand how char(13) and char(10) impact the query?
Thanks!
Steve
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:81EFD80A-10CE-4308-B710-7ABB7E79FD53@.microsoft.com...
> Hi Steve
> Assuming your result table is declared as something like:
> CREATE TABLE dbo.result ( id int not null identity, result varchar(400))
> Then each row returned from your stored procedure will be a separate row
in
> dbo.result. You can then cursor through the table and get each row.
> INSERT INTO dbo.result (result)
> EXEC dbo.sproc_name
> DECLARE @.Body1 varchar(4000)
> DECLARE @.lineresult varchar(400)
> SET @.Body1 = ''
> DECLARE r_cursor CURSOR FOR
> SELECT result FROM dbo.result ORDER BY id
> OPEN r_cursor
> FETCH NEXT FROM r_cursor INTO @.Body1
> WHILE @.@.FETCH_STATUS=0
> BEGIN
> FETCH NEXT FROM r_cursor INTO @.lineresult
> SET @.Body1 = @.Body1 + CHAR(13) + CHAR(10) + @.lineresult
> END
> CLOSE r_cursor
> DEALLOCATE r_cursor
> John
> "Steve" wrote:
> > Thanks in advance - Steve.
> >
> > I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to
preclude
> > using SQL Mail (as far as I know). So I've been working on using
CDOSYSmail
> > to send email, and attachment, and the results from a stored procedure
(a
> > set of queries that generates 6 summary reports with varying columns).
I've
> > inserted the results from the stored procedure into a table called,
results
> > varchar(4000).
> >
> > I'm trying to insert the results from 'sproc_name' into the body of an
email
> > and could use some help.
> >
> > The stored procedure, 'usp_send_cdosysmail' is working fine except I
can't
> > get the results from another stored procedure into the body of an email.
The
> > table 'result' is one column varchar(4000); I'd prefer just executing
the
> > 'sproc_name' and avoid the cursor since i'm new to cursors. I receive
the
> > error below:
> >
> > Server: Msg 170, Level 15, State 1, Line 17
> > Line 17: incorrect syntax near @.body1
> >
> > declare @.Body1 varchar(4000)
> > set @.Body1 = ''
> > declare r_cursor cursor for
> > select result from test.dbo.result
> > open r_cursor
> >
> > declare @.r_return cursor
> > exec db_name.dbo.sproc_name @.r_return = OUTPUT
> >
> >
> > while (@.@.fetch_status=0)
> > begin
> > fetch next from @.r_return
> > end
> > close r_cursor
> > @.body1 = @.r_return
> > deallocate r_cursor
> >
> > exec master..usp_send_cdosysmail
> > @.from='user1@.domain.com',
> > @.to ='user2@.domain.com',
> > @.subject ='Test',
> > @.body = @.body1,
> > @.attachments = 'C:\test.txt',
> > @.smtpserver = 'mailserver.domain.com',
> > @.bodytype ='TEXTBody' -- 'HTMLBody'
> >
> >
> >|||Hi
The id column will be necessary if you want to keep the order the same as
the order returned by the stored procedure. The CHAR(13) and CHAR(10) are to
add a carriage return and linefeed into your results, they have no impact on
the query as they are not part of it. If you don't need them then they can be
omitted, but then the columns may not align.
@.Body1 was the variable you used for the email body, if you return more than
one line then the cursor will loop through subsequent lines by returning them
in @.lineresult and then appending them to @.Body1. The first line returned can
go straight into @.Body1.
I am not sure how big the body of your text could be, but if it is 4000
characters it may not be large enough for your needs. You may want to look at
creating a DTS package to create the files and (say) using XPSMTP to send it
http://www.sqldev.net/xp/xpsmtp.htm. It may be better to put the results into
a spreadsheet rather than leaving them as text, DTS can do this. See books
online for more information on DTS and check out
http://www.sqldts.com/default.aspx
John
"Steve" wrote:
> Hi John - big thanks!
> I did not have an id property, only a column entitled results with datatype
> varchar(4000).
> Cursors need an id column (i'm familiar w/ the identity property - very
> handy).
> For my education, wow do the char(13) an char(10) work inconjunction with
> @.body1 and @.lineresult to concatenate all the rows together? I interpret
> @.body1 as being all the previous rows and @.lineresult being the current row,
> but don't understand how char(13) and char(10) impact the query?
> Thanks!
> Steve
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:81EFD80A-10CE-4308-B710-7ABB7E79FD53@.microsoft.com...
> > Hi Steve
> >
> > Assuming your result table is declared as something like:
> > CREATE TABLE dbo.result ( id int not null identity, result varchar(400))
> >
> > Then each row returned from your stored procedure will be a separate row
> in
> > dbo.result. You can then cursor through the table and get each row.
> >
> > INSERT INTO dbo.result (result)
> > EXEC dbo.sproc_name
> >
> > DECLARE @.Body1 varchar(4000)
> > DECLARE @.lineresult varchar(400)
> > SET @.Body1 = ''
> >
> > DECLARE r_cursor CURSOR FOR
> > SELECT result FROM dbo.result ORDER BY id
> >
> > OPEN r_cursor
> >
> > FETCH NEXT FROM r_cursor INTO @.Body1
> >
> > WHILE @.@.FETCH_STATUS=0
> > BEGIN
> > FETCH NEXT FROM r_cursor INTO @.lineresult
> > SET @.Body1 = @.Body1 + CHAR(13) + CHAR(10) + @.lineresult
> > END
> > CLOSE r_cursor
> > DEALLOCATE r_cursor
> >
> > John
> >
> > "Steve" wrote:
> >
> > > Thanks in advance - Steve.
> > >
> > > I'm running SQL 7.0 with Exchange 2003 SP2 (SP.?) which uses SSL to
> preclude
> > > using SQL Mail (as far as I know). So I've been working on using
> CDOSYSmail
> > > to send email, and attachment, and the results from a stored procedure
> (a
> > > set of queries that generates 6 summary reports with varying columns).
> I've
> > > inserted the results from the stored procedure into a table called,
> results
> > > varchar(4000).
> > >
> > > I'm trying to insert the results from 'sproc_name' into the body of an
> email
> > > and could use some help.
> > >
> > > The stored procedure, 'usp_send_cdosysmail' is working fine except I
> can't
> > > get the results from another stored procedure into the body of an email.
> The
> > > table 'result' is one column varchar(4000); I'd prefer just executing
> the
> > > 'sproc_name' and avoid the cursor since i'm new to cursors. I receive
> the
> > > error below:
> > >
> > > Server: Msg 170, Level 15, State 1, Line 17
> > > Line 17: incorrect syntax near @.body1
> > >
> > > declare @.Body1 varchar(4000)
> > > set @.Body1 = ''
> > > declare r_cursor cursor for
> > > select result from test.dbo.result
> > > open r_cursor
> > >
> > > declare @.r_return cursor
> > > exec db_name.dbo.sproc_name @.r_return = OUTPUT
> > >
> > >
> > > while (@.@.fetch_status=0)
> > > begin
> > > fetch next from @.r_return
> > > end
> > > close r_cursor
> > > @.body1 = @.r_return
> > > deallocate r_cursor
> > >
> > > exec master..usp_send_cdosysmail
> > > @.from='user1@.domain.com',
> > > @.to ='user2@.domain.com',
> > > @.subject ='Test',
> > > @.body = @.body1,
> > > @.attachments = 'C:\test.txt',
> > > @.smtpserver = 'mailserver.domain.com',
> > > @.bodytype ='TEXTBody' -- 'HTMLBody'
> > >
> > >
> > >
>
>

Thursday, March 8, 2012

Adding NT login using T-SQL

Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogin
doesn't seem to have this capability.
Thank you in advance for your help!
Use sp_grantlogin for that.
As of 2005, you use CREATE LOGIN for both types of logins.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
news:1C6B2795-8C35-45B2-B584-3B615CE505D9@.microsoft.com...
> Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogin
> doesn't seem to have this capability.
> Thank you in advance for your help!

Adding NT login using T-SQL

Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogin
doesn't seem to have this capability.
Thank you in advance for your help!Use sp_grantlogin for that.
As of 2005, you use CREATE LOGIN for both types of logins.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in me
ssage
news:1C6B2795-8C35-45B2-B584-3B615CE505D9@.microsoft.com...
> Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogi
n
> doesn't seem to have this capability.
> Thank you in advance for your help!

Adding NT login using T-SQL

Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogin
doesn't seem to have this capability.
Thank you in advance for your help!Use sp_grantlogin for that.
As of 2005, you use CREATE LOGIN for both types of logins.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
news:1C6B2795-8C35-45B2-B584-3B615CE505D9@.microsoft.com...
> Is it possible to create new login (NT or Windows) using T-SQL? sp_addlogin
> doesn't seem to have this capability.
> Thank you in advance for your help!

Thursday, February 16, 2012

Adding data in SQL server

This is probably a very basic question, so thanks in advance for not flaming the newbie.

I created a sample database in Access, then converted it into SQL Server format using the import/export wizard. I'm doing the "Creating a Distributed Application" walkthrough in Visual Studio and everything has compiled and runs fine. My problem is that I just created an empty database in access. It only has one table with two fields (a names table with lastName and firstName fields.) When I run the project I created in Visual Studio, I don't get any errors, but the data grid that I added doesn't have any data. This isn't surprising, because it is an empty data base. I'm very new to SQL Server and can not for the life of me figure out how to add data to a database. I feel dumb even asking such a question, but how do I create some dummy first and last names?

Thanks for the help.Use an insert statement In Query Analyser.

If your table is called names it would be something like:

INSERT Names VALUES('John', 'Smith')
INSERT Names VALUES('Jane', 'Doe')

Or you can open the table in query analyser and type the data directly into the table.

Hope this helps

Brent

Originally posted by orangewater
This is probably a very basic question, so thanks in advance for not flaming the newbie.

I created a sample database in Access, then converted it into SQL Server format using the import/export wizard. I'm doing the "Creating a Distributed Application" walkthrough in Visual Studio and everything has compiled and runs fine. My problem is that I just created an empty database in access. It only has one table with two fields (a names table with lastName and firstName fields.) When I run the project I created in Visual Studio, I don't get any errors, but the data grid that I added doesn't have any data. This isn't surprising, because it is an empty data base. I'm very new to SQL Server and can not for the life of me figure out how to add data to a database. I feel dumb even asking such a question, but how do I create some dummy first and last names?

Thanks for the help.|||Since you are familiar with MS Access you could create a link table in Access pointing to the SQL Server table and then enter data that way as well.|||OK, I'm confused. When I type in this query into the Query Analyzer:

INSERT names VALUES('John', 'Smith')
INSERT names VALUES('Jane', 'Doe')

I get the following error message:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'names'.

The name of the database is names, the table is called name and it has firstName and lastName entities. when i click on the dbo.name table in sql server, Edit is grayed out. why is this?

why is something so common completely obfuscated in SQL server?|||Here is an example:

create table myTbl (myKey varchar(20), myValue int)
go
insert myTbl (myKey , myValue) values ('a.1.red',99)
insert myTbl (myKey , myValue) values ('a.1.blue',7)
insert myTbl (myKey , myValue) values ('a.2.red',88)
insert myTbl (myKey , myValue) values ('a.2.blue',5)
insert myTbl (myKey , myValue) values ('b.1.red',9)
insert myTbl (myKey , myValue) values ('b.1.blue',1)
insert myTbl (myKey , myValue) values ('b.2.red',8)
insert myTbl (myKey , myValue) values ('b.2.blue',6)
go|||If the table is called name then modify:

INSERT name VALUES('John', 'Smith')
INSERT name VALUES('Jane', 'Doe')

name is whatever the table is called. If your table was called contacts then it would be:

INSERT contacts VALUES('John', 'Smith')
INSERT contacts VALUES('Jane', 'Doe')

Brent

Originally posted by orangewater
OK, I'm confused. When I type in this query into the Query Analyzer:

INSERT names VALUES('John', 'Smith')
INSERT names VALUES('Jane', 'Doe')

I get the following error message:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'names'.

The name of the database is names, the table is called name and it has firstName and lastName entities. when i click on the dbo.name table in sql server, Edit is grayed out. why is this?

why is something so common completely obfuscated in SQL server?|||OK...I figured it out. It's really easy to add data in SQL server, without adding links to an Access database or INSERT statements. All I did was navigate to the table in Enterprise Manager, right click on Open and then click "Return all rows." This pulls up an Access style representation of the data and allows you to easily enter or edit the data.

Thanks to all for your help though! Now if only I could get the update button in the web service to work....|||If you are having problems with UPDATE you should try SQL Profiler to verify the SQL statement is making it to SQL Server. If it is, then COPY/PASTE the statement from SQL Profiler into SQL Analyzer and run the SQL statement. When executing the SQL statement in Analyzer make sure you are logged in with the same UserID used for the Web to verify permissins as well.