Forum Replies Created

Viewing 15 posts - 12,361 through 12,375 (of 13,460 total)

  • RE: SQL Syntax for newbie...

    I would return a recordset/datatable of multiple rows instead, if it were me;

    something like

    ]SELECT UserRoles.UserId,UserRoles.RoleId,UserRoles.RoleName from UserRoles where UserRoles.UserID In (SELECT UserId from Users where UserId=12)

    Or

    SELECT UserRoles.UserId,UserRoles.RoleId,UserRoles.RoleName from...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Where is your sessions Current DATEFORMAT hidden

    doh so simple; thanks noeld

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: RBAR to Set Based Solution; for the honour and the glory.

    still looking at the problem, but here's the DDL I created for testing:

    SET DATEFORMAT dmy

    DECLARE @Sample Table(Account varchar(30), Product varchar(30), StartDate datetime,EndDate datetime,Bonus int)

    INSERT INTO @Sample

    SELECT '20943','A','26/01/2005',NULL,10 UNION

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Cursor Errors

    select * from master.dbo.sysmessages where error = 16945

    select * from master.dbo.sysmessages where error = 16937

    select * from master.dbo.sysmessages where error = 16954

    error = 16945: The cursor was not declared.

    error =...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Newbie: Copy database but not tables

    because you don't want to overwrite the database, it's much more difficult. foreign keys for tables may bite you in the tailfeathers.

    this is what I would do:

    restore a copy of...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Table size based on the structure of the table (very urgent)

    take a look at this thread:

    http://www.sqlservercentral.com/Forums/Topic385732-9-1.aspx

    it has solutions for the defined size you are looking for, as well as MarcusB's solution for the largest row in the table, and finally...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: equivalent column in sql server 2005 for cdefault column of syscolumns table

    yep already created view for you. try

    SELECT * FROM INFORMATION_SCHEMA.COLUMNS

    you'll see it has the definitions for all the columns int he database, including what that default value is.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Analyzing a T-Log, problems

    well WITH TRUNCATE_ONLY would truncate the log, but that's only whent he backup occurs.

    if you restored it locally, made sure it was set to Full, and then updated a...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Analyzing a T-Log, problems

    the server is local or remote from where you installed SQL Log Rescue? i know you have to install the extended stored procedures on each instance you want to use...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Analyzing a T-Log, problems

    in order to use SQL Log Rescue, the database Recovery Model Option had to be set to "Full" and not "Simple" prior to the UPDATE event occurring. Check the properties...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Data-Wiping

    usually you want to delete data in certain tables, but not "lookup tables".

    the script below will delete/truncate every table in foreign key hierarchy order, but you should add to the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: insert-update help

    Best (9/27/2007)


    table in which update has to be done --------------------Table a

    table from where update has to be made----------------Table b

    table structure of Table a--------------------contactid,lastname,firstname

    table structure of table b-------------------leacode,lastname,firstname

    table structure of table...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DateName Query

    in the ORDER BY section of a statement, you can refer to data by the alias that was assigned to it, isntead of the function. will that help you out?

    ie...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Help with SELECT involving 2 tables !!!

    What have you tried so far?

    This looks a lot like a homework question, so please bear with me;

    in order to get information from two tables, you want to use a...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Data READ Auditing

    yep your right...select statements don't produce a loggable item, so there's no way to track who reads a table, unless you set up a profile.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 12,361 through 12,375 (of 13,460 total)